■ FIGURE 4.
❑ Set the baud rate to 19,200.
As a basic MP3 player, the
hardware does pretty much
everything you need, but there
is plenty of room for adding
features to the software. The
user interface, especially, is ripe
for enhancement. For example,
the STA013 is capable of volume, balance, bass, and treble
adjustments; all that’s required
is some firmware to set them.
would be nice, as would
support for M3U style playlists.
And let’s not forget scan
forwards and backwards,
shuffle play, and repeat play.
Doing all this with a single knob
and button for the user interface
requires a little imagination, but
it can be both very practical and
To embed this device, the
rotary encoder could be
replaced with up to three push
button switches. The firmware
would have to be modified to
detect push button closures and
do what’s needed. This is how
you’d make a doorbell or an
alarm, for example.
For more sophisticated
interfaces, the entire I2C bus is
available from connector J8;
with the appropriate firmware,
this could be used to interface
almost any peripheral.
And finally, the firmware
can be modified to accept
commands over the serial port;
this way, you could use this
player as a generic MP3
playback device controlled by
another microprocessor. An
MP3 player peripheral for your
BASIC Stamp? Maybe.
rotary encoder at this
time. Apply 9 to 15
volts DC and check
that the output of VR1
is 3. 3 volts; if you have a milliammeter, the total
current draw should be 100 to 150 mA. Next, check
that the output of VR2 is 5 volts. If any of these
readings are way off, pull the plug immediately and
figure out where you went wrong.
❑ Select the microcontroller type — either
89C664 or 89C668 — depending on which
❑ Enter 18.432 for the crystal frequency.
Remember that this refers to the CPU
crystal — not the STA013 oscillator!
Now you’re ready to program the microprocessor.
This can be done in-system using the serial port,
a PC, and the FlashMagic programming software
supplied to Philips by the Embedded Systems
Academy. Download FlashMagic from the ESA
website (see References sidebar) and follow the
instructions supplied to install it on your PC.
Be sure that the board’s jumpers are set
for programming as shown in Figure 2 before you
proceed. Connect the serial port cable and power
up the MP3 player. Start FlashMagic and you’ll find
that ESA has done an excellent job of making it easy
to use — just follow the numbers 1, 2, ... 5 like this:
❑ Check the “Erase all Flash+Security” box.
All other options will be grayed out
when you do.
❑ Click the BROWSE button and open
the firmware file.
❑ Check the “Verify after Programming” box.
All other options should be unchecked.
❑ Click the START button!
❑ Select your COM port from the dropdown
Figure 3 shows an image of the FlashMagic
screen after all the correct options
have been selected. Erasing the
flash, downloading the firmware,
and verifying it takes a minute or
so; if all goes well, then you’re
ready to proceed to the next step.
One last point — notice that
the firmware is different for LCD
and VFD displays; be sure you
load the correct firm-ware for the
display you’re using. Loading the
wrong firmware will usually cause
the POST to fail with code 5
◗ CompactFlash Specification Revision 3.0,
◗ Programming the Compact Flash card or Memory Stick,
◗ Detailed Explanation of FAT Boot Sector,
◗ How to Control a HD44780 Based LCD,
◗ How to Use the STA013 MP3 Decoder Chip,
◗ Bit Banging I2C Interfaces,
◗ STA013 MPEG 2.5 Layer III Decoder,
STA013 Application Note AN1090,
◗ Cirrus Logic CS4334 Data Sheet,
◗ P89C664 80C51 8-bit Flash microcontroller,
◗ In-application Programming of the 89C66x Microcontrollers,
Now remove the power and
connect the display and rotary
encoder, but don’t install a Flash
card just yet. Set the jumpers for
playback as shown in Figure 4.
Hold your breath and apply power once again. If the programming
worked, the firmware will execute
the power on self test and then
display the copyright notice.
If you don’t see the copyright
40 NUTS & VOLTS November 2005