This is only a preview of the October 2024 issue of Silicon Chip. You can view 45 of the 112 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Items relevant to "3D Printer Filament Dryer, Part 1":
Items relevant to "8Ch Learning Remote Receiver":
Articles in this series:
Items relevant to "JMP012 - WiFi Relay Remote Control":
Videos relevant to "JMP015 - Analog Servo Gauge":
Articles in this series:
Items relevant to "Dual-Rail Load Protector":
Items relevant to "Micromite Explore-40":
Purchase a printed copy of this issue for $13.00. |
MICROMITE
EXPLORE-40
A wealth of software has been written for the Micromite;
The Back Shed online forum is a great place to find much
of it. This compact Explore-40 board is a Micromite
in the same form factor as the popular Pico boards,
allowing a Micromite to be used with hardware
designed for the Pico.
PROJECT BY TIM BLYTHMAN
T
HE RASPBERRY PI PICO has taken a
well-deserved place as one of the
most popular microcontroller
boards. It is cheap, easy to use and can
be programmed in C, BASIC, Micro
Python & even with the Arduino IDE.
Our Pico BackPack (March 2022;
siliconchip.au/Article/15236) capitalised on those features, providing stereo audio and a microSD card interface
with the 3.5in LCD panel that we had
previously used with the Micromite
V3 BackPack.
These new features can now be
accessed from Micromite BASIC, since
the Explore-40 board allows a Micromite processor to be plugged into the
Pico BackPack. Thanks in part to the
ongoing work of The Back Shed forum
members, software is available to use
these new features.
The Micromite Explore-40 is not just
a Micromite/PIC32 breakout board. It
has been designed to include niceties
like an inbuilt USB-serial converter,
plus some LEDs and pushbuttons. It
can even plug into a Pico Digital Video
Terminal (March & April 2024 issues;
siliconchip.au/Series/413).
Since this board is patterned after
the Raspberry Pi Pico and thus a bit
larger than the Explore-28, we have
taken the opportunity to add some
extra features.
Circuit details
Fig.1 shows the circuit of the
Explore-40. IC1 is a PIC32MX170F256B
in a relatively large 28-pin SOIC package. This is the familiar 28-pin part
The Explore-40
we have used for many Micromite
The Explore-40 is typical of min- projects.
imal Micromite implementations
Its I/O pins are connected to pins on
that include the Microbridge USB- the pair of 20-way headers that match
serial converter. The circuit resem- the pinout of the Pico. We’ll explain
bles earlier Micromite boards like the our choices for this specific mapping a
Explore-28 from the September 2019 bit later. As the Pico has more pins than
issue (siliconchip.au/Article/11914).
the 28-pin PIC32, there are some empty
positions on those 20-way headers.
IC2 is a PIC16F1455 programmed
Micromite Explore-40 Features & Specifications
with the Microbridge firmware. The
» Allows a PIC32 Micromite processor to be plugged into a Pico socket
Microbridge was originally published
» All 28-pin Micromite I/O pins are available
as a separate board (see May 2017;
» Onboard Microbridge serial interface/programmer
siliconchip.au/Article/10648); it has
» USB-C socket for power and data
since been incorporated into many
Micromite designs. It can function as
» Micromite BASIC software examples for all Pico BackPack features
a USB-serial converter, allowing com» Supports LCD touch panel with backlight control
munication between a computer and
» Supports IR receiver
the Micromite chip.
» Stereo audio output
The Microbridge can also act as a
» microSD card interface
programmer, allowing new firmware
» Realtime clock interface
(such as a new version of Micromite
» Add-on 3.5mm board provides 3.5mm stereo audio socket with Pico BackPack
BASIC) to be easily installed on the
Micromite chip.
» Power and status LEDs
As such, it connects to the data lines
» Reset and Mode pushbuttons
on USB-C connector CON1, as well
» In-circuit serial programming (ICSP) header for the PIC32 Micromite chip
as the serial and programming pins
82
Silicon Chip
Australia's electronics magazine
siliconchip.com.au
of IC1. IC2 also drives LED1, which
indicates its mode (USB-serial or
programming) and shows serial traffic. Onboard pushbutton S2 selects
IC2’s mode.
CON1, the USB-C socket, has connections to power via the VBUS pins.
The CC1 and CC2 pins are connected to
ground via 5.1kW resistors, signalling
to the USB source (eg, a computer) that
it should supply 5V on the VBUS pins.
The VBUS voltage goes via schottky
diode D1 to REG1, an MCP1700 3.3V
low-dropout regulator. The diode also
connects to pins 40 and 39 of the Pico
headers, emulating that handy feature of the Pico boards. It means that
an alternative source of 5V power
can be fed into pin 39 (possibly via
another diode) without any risk of
back-feeding the USB power supply.
REG1 and its capacitors provide
a 3.3V rail that powers IC1, IC2 and
power indicator LED2 (the latter via
a 1kW resistor). The 3.3V output is
also available on pins 35 and 36 of the
headers, as it is on the Pico boards.
IC1’s pin 1 (the MCLR reset input)
has also been taken to pin 30 (RUN
on the Pico).
Pins 3, 8, 13, 18, 23, 28, 33 and 38 of
the headers are connected to ground,
like the Pico, and we have connected
as many of the PIC32’s I/O pins as we
can to the remaining I/O pins on the
headers. Because of this compatibility, we’re sure readers will find the
Explore-40 handy in other situations
where a Pico might be used.
IC1’s MCLR reset pin, 3.3V, ground
and the two ICSP programming pins
are also available at the CON2 ICSP
header, allowing the chip to be programmed by an external programmer. IC1 can also be reset by pressing
S1, which pulls MCLR to ground. A
10kW resistor pulls this up otherwise.
A reset button is one feature that the
real Pico lacks!
Micromite Explore-40 Kit (SC6991, $35)
A complete kit is available for the Micromite Explore-40 with all the parts
listed in the parts list on page 87 (not including the Audio Breakout Board
or Pico BackPack).
Pin mapping
The mapping of the 40-pin header
has been mostly chosen to match the
functions of the Pico BackPack to that
of the Micromite. For example, the
Micromite has fixed SPI and I2C pins,
so the mapping matches the wiring
of these two peripherals on the Pico
BackPack.
Similarly, the pins for interfacing
with the LCD on the V3 BackPack
have been arranged identically on
the Explore-40. This allows identical
siliconchip.com.au
Fig.1: the Explore-40 has much in common with the Micromite V2 BackPack
and the Explore-28, although we’ve added a USB-C socket, power indicator LED
and a reset button. The I/O pin mapping to the two 20-pin headers is designed to
allow the Micromite processor to work with the Pico BackPack and retain some
compatibility with software designed for the V3 BackPack.
Australia's electronics magazine
October 2024 83
Micromite OPTIONs to be used. The
IR pin (Micromite pin 16) has also
been connected to the IR receiver on
the Pico BackPack.
Pins 21 and 22 on the Micromite
have been connected to pins 11 and
12 of the Pico header; these are used
for audio on the Pico BackPack and are
a convenient pair for this purpose. If
not used for audio, they can be used
as the Micromite’s COM1 serial port.
The serial console pins have been
allocated to pins 1 and 2, allowing the
console to be connected to the Pico
Digital Video Terminal. That doesn’t
leave many pins spare to be allocated.
We have connected pins with analog
functions where possible, although
the Pico has fewer than the Micromite.
We’ll detail the OPTIONs and pins
that should be used with the Pico BackPack later, when we explain the software features in more detail.
A small add-on
While putting together this design,
A 3.5mm jack socket breakout board for the Pico BackPack
Building this board is simple, as you can see from our photos. As long as you connect
the R, G and L pins to the matching pins on CON3 of the Pico BackPack, the board can
be installed in a few different ways.
It can be mounted on either side of the board, giving four main configurations. We
think the method shown in our photos is the simplest, gives a compact result and does
not put the audio socket awkwardly close to the microSD card socket.
The Audio Breakout extends slightly beyond the Pico BackPack and is intended to
sit just inside a UB3 Jiffy box so that the socket can be accessed through a small hole
in the side.
We suggest fitting the audio socket to the PCB first. That will allow you to easily
check that your chosen positioning does not foul any other components. The photo
shows the assembly of the listed parts that can then be fitted
to the Pico BackPack.
Once fitted, you can simply plug in headphones or an
aux cord to hear audio from CON3 on the Pico BackPack.
This is the
recommended
placement of the 3.5mm
jack socket breakout board on
the Pico BackPack, sitting above
some passive components in
the audio section. Although it’s
designed to work with the Pico
BackPack, you can also use it for
breadboarding or prototyping.
Silicon Chip
Programming the chips
IC1 can easily be programmed via
IC2 once you have built the board,
but IC2 is best programmed before it
is soldered to the board, especially as
there is no ICSP header for it.
It is possible to use a Micromite to
program a Microbridge; there are notes
on how to do that included with the
Microbridge firmware at siliconchip.
au/Shop/6/4269
Still, it is easier to program IC2 with
something like a PICkit or SNAP if you
have an appropriate SMD adaptor, so
we recommend doing that if possible.
If you buy a kit from us, both ICs will
be programmed already; there is also
the option to buy programmed chips
separately.
Construction
The Explore-40 uses mainly SMD
parts, including SOIC ICs, M2012
(0805 imperial) passive components
measuring 2.0 × 1.2mm, and a somewhat fine-pitch USB-C socket. It is
not super difficult, but neither is it
extremely easy; it would be ideal
to have some SMD soldering experience before assembling it. There
are also components on both sides
of the PCB.
You will need the usual SMD tools
and consumables. A fine- or medium-
tipped soldering iron, solder, flux
paste, tweezers and good ventilation
are essential. Some solder-wicking
braid and a means of securing the PCB
are also advised. Blu-Tack will do the
job if you don’t have a PCB vice.
You should also have a suitable solvent for cleaning up flux, such as one
recommended by your flux supplier.
Fig.2 (below): when assembling
the breakout board, ensure the
socket is pushed firmly against
the PCB. We used straight
headers, but you could use rightangled headers.
84
we realised adding a 3.5mm audio
output jack socket to the Pico BackPack would be a nice touch. We initially omitted this from the Pico BackPack because the board is quite tight
for space.
To solve this, we’ve designed a very
small daughterboard that can be connected to the Pico BackPack, breaking
out the CON3 audio connector into a
3.5mm stereo socket. It is shown in
Fig.2.
You don’t need to use the Explore-40
to use the daughterboard; it can also be
used with a Pico or Pico W. You can see
it in our photos, mounted above the
Pico BackPack PCB. We have a panel
showing how to build this board and
add it to the Pico BackPack.
Australia's electronics magazine
siliconchip.com.au
Alternatively, isopropyl alcohol or
methylated spirits will be effective
for most fluxes. Fig.3 shows the PCB
overlays, which you should refer to
during assembly.
Start by soldering CON1, the USB-C
socket, since it has the closest pin
pitch. It will also be difficult to get to
once other components are installed.
Apply flux to the pads and slot the
socket into its holes on the top of the
PCB. Clean the iron’s tip and add a
small amount of fresh solder.
The end-most leads are a bit wider,
so tack one of those in place, then
check that the other leads are aligned
to their pads and that the part is flat
against the PCB. Adjust it until you
are satisfied. The locating posts should
help here.
You can then solder the mounting
pins from the reverse of the PCB. It
might help to add some flux to the bottom and top of those pins to help the
solder take. Try not to add too much
solder to the mounting pins, as it might
get in the way later.
Next, solder the remaining pins of
CON1 on the top of the PCB. Use the
braid and extra flux to remove any
bridges that have formed. Place the
braid on the solder, apply the iron and
gently move both away together once
the solder has been taken up.
Fit the two ICs next, being sure to
get the correct orientation. IC2 faces
the opposite direction to IC1 and is
on the opposite side of the PCB. Add
flux to the PCB, rest the ICs in place
and tack one lead before soldering the
others. Adding flux to the pins before
soldering will help it flow. Check for
bridges after soldering and remove
any with more flux paste and the solder wick.
Regulator REG1 mounts on the same
side as IC2. It’s easy enough to solder
but small enough to lose sight of easily.
Add some flux and place it as shown.
Tack one lead, then check the alignment of the others before soldering.
The diode mounts on the opposite side of the board from the USB-C
socket. Ensure that the PCB’s cathode
mark matches the diode orientation
and avoid bridging its pads to the socket’s mounting pins.
Now solder the remaining parts on
the underside of the PCB methodically. The resistors will have small
codes printed on top (per the parts list)
but the capacitors will be unmarked.
You may be able to tell them apart by
siliconchip.com.au
Fig.3: we’ve placed components
on both sides of the PCB to best
use the available space. The
CON1 USB-C socket and the
two microcontrollers have the
tightest pin pitches, so they
should be fitted first. Avoid
using too much solder for
CON1 through-hole mounting
pins in case it bridges to D1
or the nearby resistors. This
diagram is shown at 150% of
actual size for clarity.
their thickness if you manage
to get them mixed up. In each
case, add flux to the pads, rest
the part in place, tack one lead,
then check and solder the other.
Next come the two LEDs on
the top side of the board. We
recommend using red for LED1
(MODE) and green for LED2 (POWER),
although you could choose your own
scheme. You can test the colour and
polarity of the LEDs with a multimeter set to diode mode.
The cathode will be the end connected to the black multimeter lead
when the LED lights up. Fit the LEDs
with the cathodes towards the COM2
silkscreen marking (the overlay also
shows a K near each cathode).
Solder the last 1kW resistor and
100nF capacitor. Clean both sides of
the PCB thoroughly with your chosen
flux solvent and allow the PCB to dry.
It’s then a good time to inspect the soldering for any bridges or dry joints you
might have missed. If you find any, fix
them before proceeding.
Fit the two tactile switches next.
They have much larger pads, making
them easier to solder than the other
parts. Your board should look like the
photos now.
If something is not right, check for
5V at the USB pin, at upper right, and
around 4.7V (due to the diode) at the
SYS pin below it. Check the USB-C
socket and 5.1kW resistors if the USB
voltage is absent. An absence of voltage at the SYS pin suggests the diode
is reversed or not connected, while a
lack of 3.3V could point to a problem
with the regulator or a short circuit on
the 3.3V rail.
If you need to fit the CON2 ICSP
header to program IC1, do that now.
Be aware that you may not be able
to leave CON2 attached afterwards
since it might be too tall to fit between
the Pico BackPack PCB and the LCD
Testing
There are still some parts to fit, but
now is a good time to do some initial tests. Connecting USB power to
CON1 should cause LED2 to light up.
The 3.3V pin should measure between
3.2V and 3.4V relative to ground.
Pressing S2 should cause LED1 to
light up, assuming IC2 is programmed
correctly.
The Explore-40 is a compact board (51
× 21mm) that allows the Micromite to
substitute for a Raspberry Pi Pico in some
circumstances. IC1 and the two LEDs are
the polarised components on the top of
the PCB. We recommend using red for
LED1 and green for LED2.
Australia's electronics magazine
85
fitting the Explore-40 to a Pico BackPack with an LCD panel above. If you
just plan to use it on a breadboard, for
example, you just need to be sure that
the pins align with the sockets in the
breadboard.
using socket headers fitted to the top
of the Explore-40 that will mate with
pin headers mounted on the underside
of the Pico BackPack.
Software support
Combining the Explore-40 with the
Pico BackPack (and 3.5in LCD panel)
For our prototype, we used low- brings two new features that were
profile header sockets and removed the not present on the V3 Micromite LCD
plastic shroud from the pin headers to BackPack. These are the microSD card
allow the board to be swapped (eg, for and audio output.
a Pico) if needed. However, we found
First we’ll recap the features that are
that quite fiddly to achieve.
shared with the Micromite V3 BackAs you can see in the photo below, Pack and how they are configured
there is very little clearance above the and used. This will be a quick way to
Explore-40, even though we removed check that the Explore-40 is working
the SD card socket from the LCD panel as expected.
above. Still, that is an option to conThese features should all behave
sider since there is no connection to identically to a Micromite V3 Backthe SD socket on the LCD panel from Pack. Note, though, that the Explore-40
the Pico BackPack.
and Pico BackPack lack the RAM or
If you want to do that, use a pair of FLASH IC and temperature sensors
flush nippers to gently cut and detach that the V3 BackPack includes.
each pin from the SD card socket, then
The Micromite firmware does not
use a soldering iron to remove the rem- have a built-in driver for the 3.5in
nants of each pin. Follow with some LCDs, but there is a loadable driver
solder-wicking braid and flux paste to developed by Peter Mather. We have
remove any solder residue.
customised this to suit the configIf you are happy to permanently sol- uration of the Explore-40 and Pico
der the Explore-40 to the Pico Back- BackPack hardware; it is the “3.5IN
Pack, the height of the plastic spacers DRIVER.BAS” file in the software
on standard pin headers will prevent downloads package.
the underside components from touchThe code is much the same as that
ing the PCB below. To do this, sand- found in the Display Drivers folder of
wich the headers between the Pico the Micromite firmware download.
BackPack and Explore-40 PCBs, then We have just changed the line in the
tack a few pins in place before solder- MM.STARTUP subroutine to suit our
ing the remainder and trimming the pin allocation. The “3” at the end indiexcess lengths away.
cates a landscape configuration, with
If you are doing something differ- the microSD card socket near the top
ent, we recommend test-fitting the of the screen.
parts first to be sure they will fit and
Load this file onto the Micromite (for
not cause any fouling with the LCD example, using the AUTOSAVE companel above. It’s also possible to fit mand), then perform a LIBRARY SAVE
the Explore-40 to the underside of the and restart the Micromite by pressPico BackPack PCB, although that will ing S1 or entering the CPU RESTART
make it difficult to access the buttons command. You should see the screen
or see the LEDs.
clear and you can run the GUI TEST
If you want to do that, we suggest LCDPANEL command to confirm it is
working.
To configure, calibrate and test the
touch panel, use these commands:
Fitting it to a Pico BackPack
The underside of the Explore-40
shown at actual size; note the
orientations of IC2 and D1. REG1
is also polarised, but its correct
orientation should be obvious.
panel. You can use IC2 to program
IC1, after all.
If you connect the Explore-40 to
a computer and open a serial terminal program such as TeraTerm, you
should be able to communicate with
the Micromite firmware. The default
baud rate is 38,400. You can press S1
and check that the Micromite’s boot
message is printed via the terminal.
The Explore-40 is now complete
enough to plan how you will fit it to
the Pico BackPack. The most significant difference is that the Explore-40
has components on its underside, so
it will not mount flush like a Pico
could.
The following assumes that you are
OPTION TOUCH 7,15
GUI CALIBRATE
GUI TEST TOUCH
We used low-profile header sockets to mount our prototype Explore-40, but if
you solder it directly to the BackPack PCB using standard header pins, you will
gain clearance since the Explore-40 will sit lower. With some care, the unused
SD card socket on the underside of the 3.5in LCD panels can be removed, giving
extra clearance below. Use solder-wicking braid to clean off any excess solder
left behind.
86
Silicon Chip
Australia's electronics magazine
If the required components and
jumpers are fitted to the Pico BackPack, the backlight is also driven from
IC1’s pin 26, just like the V3 BackPack.
This can be controlled using PWM
channel 2A. The following will set
siliconchip.com.au
the duty cycle and backlight brightness to 50%:
PWM 2,250,50
IR receiver & realtime clock
The IR receiver on the Pico BackPack is routed to the dedicated Micromite IR pin, pin 16, so the IR receiver
can be used by simply setting up the
IR interrupt with the IR command. The
command would be something like:
IR DevCode, KeyCode, IR_Int
A basic interrupt subroutine to test
this could be:
SUB IR_Int
PRINT “DEVICE:” DevCode
“KEY:” KeyCode
END SUB
The RTC commands support the
realtime clock chip:
RTC GETTIME
RTC SETTIME year, month, day,
hour, minute, second
You can then retrieve the current
time and date from the TIME$ and
DATE$ variables.
MicroSD card support
The Micromite lacks a native driver
for interacting with SD cards. Peter
Mather has again done some excellent
work in creating a CSUB driver to do
that. However, there are a few provisos to using this software. Since the
Micromite does not have an interface
for file handling (unlike the Micromite
Plus), everything is done via calls to
the CSUB.
The driver is quite simple and
cannot do things like create or
append to files. So, if you wish
to write to a file, the recommendation is to create a large file on
the card, which the driver can
then overwrite. Even with these
restrictions, the driver takes up
about one-sixth of the flash memory available for programs. More
background information on this
and suitable code can be found at
siliconchip.au/link/abxr
We have configured pin 4 as the
CS (chip select) pin for the microSD
card socket. This is the same pin
that is wired to the SD card socket
on the LCD panel for the Micromite
V3 BackPack. So you could try this
on a V3 BackPack, although we haven’t tested it.
siliconchip.com.au
Parts List – Micromite Explore-40
1 51 × 21mm double-sided PCB coded 07106241
1 16-pin USB-C data and power socket (CON1) [GCT USB4105]
1 5-way pin header, 2.54mm pitch (CON2; optional, for ICSP)
2 20-way pin headers, 2.54mm pitch
2 SMD 2-pin tactile switches (S1, S2)
Semiconductors
1 SS14 40V 1A schottky diode, DO-214AC/SMA (D1)
1 PIC32MX170F256B-50I/SO 32-bit microcontroller programmed with the
Micromite firmware, wide SOIC-28 (IC1)
1 PIC16F1455-I/SL 8-bit microcontroller programmed with the Microbridge
firmware, SOIC-14 (IC2)
1 MCP1700-3.3 3.3V low-dropout voltage regulator, SOT-23 (REG1)
1 red M3216/1206/SMA SMD LED (LED1)
1 green M3216/1206/SMA SMD LED (LED2)
Capacitors (all SMD M2012/0805, X7R)
1 22μF 10V X5R/X7R
2 1μF 16V
3 100nF 50V
Resistors (all SMD M2012/0805, ⅛W)
1 10kW (code 1002 or 103)
2 5.1kW (code 5101 or 512)
5 1kW (code 1001 or 102)
Optional extras
1 Pico BackPack (without Raspberry Pi Pico) plus 3.5in LCD (March 2022)
1 3.5mm jack socket breakout board (see panel and parts below)
Audio Breakout Board
1 double-sided PCB coded 07101222, 20 × 15mm
1 stereo 3.5mm PCB-mounting jack socket (CON3A) [Altronics P0094]
1 3-way pin header (CON3)
The Explore-40 module is a drop-in replacement for a Pico
on the Pico BackPack (described separately).
Kit (SC6991, $35): a
complete kit is available
for the Micromite Explore-40 with
all the parts listed (does not include the
Audio Breakout Board or Pico BackPack).
Australia's electronics magazine
October 2024 87
The driver file is named “SDCARD_
SPI1.BAS”. It is installed similarly
to the LCD panel driver, using the
AUTOSAVE and LIBRARY SAVE
commands.
We’ve also created a HEX file that
contains these two libraries loaded
into a working copy of Micromite
BASIC version 5.05.05, named “MM
BASIC SD ILI9488.HEX”. You can load
this with the onboard Microbridge or
a PICkit programmer.
Audio support
The audio driver is another CFUNCTION that is controlled via calls with
various parameters. This is based on
a similar driver we created for the
Advanced GPS Computer (June & July
2021; siliconchip.au/Series/366).
This uses a pulse-width modulation (PWM) output to synthesise an
analog voltage signal, with the PWM
switching frequency being filtered
out by a low-pass filter attached to
that pin. The analog voltage is varied
using a timer interrupt to update the
PWM duty cycle for each sample to
be played.
The big difference is that this driver
is capable of stereo output, although it
is limited to eight bits of resolution and
an 8kHz sampling rate. Given that the
Micromite has enough flash memory
to play only seven seconds of audio,
or enough RAM for about six seconds,
we think it is a fair compromise.
The AUDIO folder in the software
downloads contains several files,
including the CFUNCTION driver,
some encoded audio samples and
BASIC code to demonstrate how to
use the driver.
The samples are created as CFUNCTIONs, although they do not contain
executable code. They consist of a
32-bit header that indicates how many
bytes are in the sample, followed by
that many bytes. Stereo samples are
stored with the left channel data first.
A mono sample played in stereo mode
will play twice as fast since two bytes
are used every sample period.
The driver is installed by loading
the “CFUN_LIBS.BAS” file onto the
Micromite, then using the LIBRARY
SAVE command. Since the CFUNCTION returns a value, we need to do
something with that value, like print
it. Use this to start the driver:
PRINT AUDIO(0)
A sample is used by loading
its BASIC file, then performing a
LIBRARY SAVE. Tell the driver where
the sample is located like this:
PRINT AUDIO(1,
PEEK(CFUNADDR SAMPLE_NAME))
Then start playback with:
PRINT AUDIO(2) ‘mono
PRINT AUDIO(12) ‘stereo
The sound will play in the background and stop automatically. Using
values 6 (mono) or 13 (stereo) as
parameters will cause the playback to
loop endlessly. Playback can be forced
to stop with:
PRINT AUDIO(3)
You can also wait for playback to
finish with:
DO WHILE AUDIO(4)<>0:LOOP
The “BASIC_SUBS.BAS” file has
some more sample code and variables
that can be used to make it easier to
see what each parameter does.
The file named “AUDIO MMBASIC.
HEX” contains the libraries, samples
and BASIC code, alongside a working copy of Micromite BASIC version
5.05.05.
Notes
The 28-pin Micromite has somewhat limited peripherals, so there
are some limitations. For example,
the timer that provides the interrupt
to fetch new audio samples is the
same one used for the IR decoder. So
we don’t think it is possible to use
the IR and audio features at the same
time, although it should be possible
to switch between them.
The audio output uses two of the
remappable PWM channels, so the
PWM feature on pins 4 and 5 cannot
be used at the same time as the audio.
Pin 4 is mapped to the microSD card
socket, so we expect it will be used for
that feature instead.
In any case, the CFUNCTION libraries take up quite a bit of program memory, as do audio samples, if kept in
flash memory.
Remember also that the PIC32MX170F256B microcontroller can
be programmed in the C language
using the MPLAB X IDE. We did that
for the Digital Lighting Controller
(October-December 2020; siliconchip.
au/Series/351).
That older project can play stereo
audio from an SD card, so you might
find it helpful if you are thinking of
doing something similar using the C
language and the MPLAB X IDE.
Summary
The 3.5mm jack
socket breakout board
is a neat fit under the LCD panel,
even when mounted on header pins. Like
the Explore-40, you should trim any excess pin
length with flush nippers or sidecutters.
88
Silicon Chip
Australia's electronics magazine
If you are a Micromite fan and yearning for the features of the Pico BackPack, the Explore-40 is the perfect way
to bridge that gap. It adds microSD card
support and stereo audio features that
were missing from earlier Micromite
BackPacks.
There are some limitations to what
the Micromite can achieve, but it is
still a handy platform for learning the
BASIC language.
The Explore-40 also adds nice
touches, like the modern USB-C socket
and reset button. These features can
be handy regardless of whether the
Explore-40 is used by itself, on a breadboard or as part of a BackPack.
SC
siliconchip.com.au
|