the Technic |
Here is a simple description of the system.
Hard disk access
Usually, when a processor want to access a HD, it will read datas on it and transfer them to an other device later. In our case, the Pic is a little bit slow to do such a job efficiently. To go around this issue, our design uses a PISO (74HC166) to route datas to the decoder after having multiplexed the 16bits wide ATA bus to a 8bits wide Pic port. We are able to reach a serial speed of about 500kHz to 1MHz that is greater than the MP3 bit stream. The buffer of the MAS is so never empty.
The access to the HD datas is done through 3 layers in the soft.
The bottom layer handles the electrical protocol of the ATA-ATAPI
bus. It's only two small routine (all the code is written in
assembly).
The middle layer accesses to the HD Registers and handles the whole
ATA protocole (ReadSector, WriteSector, ...) (ATAPI is not implemented
yet).
The top layer handles the file system.
About this file system, we decide to use FAT32 (even if it is a very
complicated FS) to be compatible with a HD loaded on
a PC with mp3 files.
At present, no directory is understood by the code, but it will be
implemented.
Fragmented files are not yet supported. Only fragmented directories
entries (mandatory) are supported.
To avoid a little limitation of the HD specs (you must read a sector
until end before reading an other one) we use some I2C EEPROM from
Microchip.
The file structure is read from the HD and saved in a proprietary
format in the EEPROM chips. The system supports upt to 8 ROM of 256kb
that allow us to handle ~8000 songs.
Decoder
Here, the classical MAS3507 and DAC 3550 are used.
Most of the details about the schematics are provided by Micronas in
the datasheets. But thoses ones are sometimes totally unclear ! So
what you need to know is that NO init sequence are really need by I2C.
The MPEG mode is the default in both chips.
LCD and keypad
As big fans of I2C, we decide to use a "monster" device from
Matrix Orbital that is
able to do "all-in-one".
It is 4x20 chars wide.
Height switches are used on the keypad interface. Four for the Play,
Stop, Next and Previous option and four for the context-dependent
options.
CPU
The need in ports was so big that we decide to use the famous Pic16F877.
The advantage was that we had the material to download code in it
from Didel.
The frequency used is the biggest one : 20MHz.
All the preliminary code uses only ~2500 inst.
The MAS data demand pin (PI19) is connected to the Interrupt (PB0) pin
and (of course) datas are send to the MAS by interrupts.
Bill of material
Here is a part of the chips used in our design :