H0420 Internals

Skip to main content (skip navigation menu)






H0420 Internals

 

This pages describes the general design of the H0420 Programmable MP3 Player. Programming notes on one of the core components, the "STA013" MP3 decoder chip (by STMicroelectronics) are on their own page.

Most of the core components are mounted at the "solder side" of the PCB ("printed circuit board") of the H0420 MP3 player: the MP3 decoder, the analogue to digital converter and the microcontroller. Apart from these components, the PCB contains logic for interfacing with RS-232, a parallel I/O connector (low speed), an LCD connector and a connector for up to 16-switches. Depending on the model, the H0420 may also be equipped with an "extension connector" with a high-speed parallel data bus and I2C and SPI interfaces.

The decoder that we used is the "STA013" by STMicroelectronics. This is a flexible MP3 decoder with three communication channels: an I2C interface for "control", an SPI-compatible interface for input data and another serial channel for PCM sample data (output).

The STA013 generates the PCM data and the clock for (stereo) Digital-Analogue Converter, for which we chose the PCM1741 from Burr-Brown/Texas Instruments. This is a high quality DAC, allowing up to 24-bit resolution, a good signal-to-noise ratio and a zero-detect (no audio signal) per channel. The DAC outputs are linked to a line amplifier that produces standard line out levels on two RCA connectors. There is a mute filter in this analogue line with a dual purpose: to reduce a power-on/off plop and to branch it to the zero-detect signal of the DAC for an auto-mute functionality.

The third core component of the MP3 player is the microcontroller. Its primary task is to read the MP3 data and to "clock" the compressed MP3 data into the decoder. In addition, the microcontroller also manages (monitors) external switches, the I/O bus and the RS-232 line, as well as an optional slave controller through an extension connector. Finally, the pawn abstract machine (or virtual machine) also takes a slice of the processing power of the microcontroller. Our choice has been the LPC213x microcontroller series from NXP (formerly Philips): a 32-bit ARM7 core that runs at a clock speed of (nearly) 60 MHz, with on-chip Flash-ROM and SRAM. The LPC213x controllers provide a generous assortment of on-chip peripherals: two I2C buses, two other serial buses compatible with SPI, two UARTs (RS-232 or RS-485), parallel out, and more. One of the I2C buses drives the STA013 and two I/O expansion chips (for the switch and I/O interfaces), the second I2C bus is available on the optional extension connector.

As mentioned, the MP3 data comes from a CompactFlash card (type 1 or 2). The PC sees a CompactFlash card as an external hard disk. For Microsoft Windows and most other operating systems, such a disk is usable only after formatting. The MP3 player and the PC must agree, of course, on the file system with which the CompactFlash is formatted. The H0420 supports FAT16 and FAT32, and nested subdirectories. Although FAT12 is technically possible for disks up to 32 MB, Microsoft advises against FAT12 for any medium above 4 MB. In addition, CompactFlash cards with sizes of 32 MB are now obsolete (and difficult to find). See also the "References" section of this paper for our design notes on the FAT16/FAT32 formats and interfacing a CompactFlash card in True IDE mode.

With all of the functionality that the firmware of the H0420 has to run, combined with the timing constraints of keeping the (fairly small) internal queue of the STA013 filled, a real-time operating system kernel is mandatory. We used FreeRTOS, version 3.2.4. FreeRTOS is a tiny kernel with good performance, and it is available for several architectures. The drivers for the peripherals and software components were developed in-house. The code is written in C and built with the GNU GCC compilers for the ARM7 core. We used the compiler toolchain from the GNU-ARM web site; see also the "References" section below.

References & further reading

Development information

GNU ARM toolchain
The GNU GCC compiler and tools pre-built for the ARM instruction set.
FreeRTOS
The FreeRTOS preemtive multitasking kernel for embedded systems.
Programming the CompactFlash card
Technical information on the lay-out of the master boot record and the FAT file system on a CompactFlash card (or USB memory stick), plus interfacing to a CompactFlash card in True IDE mode.
FAT standard
Technical information about FAT (FAT12, FAT16 and FAT32).
See also "The FreeDOS Kernel", Pat Villani, R&D Books, 1996, ISBN 0-87930-436-7.
CCS Inc.
Developer of C compilers for the PIC microcontrollers from Microchip.

Device information

NXP LPC2138
Information on the microcontroller; the datasheet of the component is available here.
STMicroelectronics STA013
Information on the MP3 decoder that is used, including a link to the datasheet.
STA013 programming notes
Our programming notes on the "STA013" MP3 decoder chip —the information lacking on the STA013 datasheet.
VLSI Solution
Manufacturer of the VS1011 MP3-decoder. The data sheet of the component is available here. We do not use this component in our MP3 player model H0420.
Microchip
Manufacturer of the PIC microcontrollers. Data sheets are available on this site. We do not use these components in our MP3 player model H0420.