Simple SD Audio Player with an 8-pin IC
Posted: Mon Feb 01, 2010 10:48 pm
This is a simple SD audio player biult with only an 8-pin microcontroller. The ATtinyX5 series (25/45/85) 8-pin AVR microcontroller has two fast PWM outputs in 250kHz carrier frequency. This can output wide frequency range audio signals. I built an audio player with the 8-pin AVR and an SD memory card (SDC). The SDC can be controlled with only six lines, two for power supply and four for control signals. It can also be easily attached to 8-pin microcontrollers. The main application of the tiny X5 series AVR seems SMPS and related according to its integrated peripherals.
Anyway this audio player is very simple and a few wires to be solderd so that it is suitable for brief handiwork before bed or breakfast.
Hardware
Right image shows the built SD audio player. I wrote two schematics for the players in different configurations because there is a limitation on programming method due to the pin usage. The card type to be used is MicroSD. Of course the standard SDC and MiniSD can also be attached by pin conversions.
The speakers are driven directly with PWM output of the AVR. The load may be too heavy for the output port. However the output current will not exceed the absolute maximum ratings at 3 volts supply voltage even if the port is tied to the rails. Therefore it cannot sound loud but it will create sufficient sound that listen on the desk with high efficiency speakers. When connect the audio outputs to the amplifier, the high frequency component must be filtered out with LPF. Do not input the PWM signals directly to the amplifier or the amplifier and speakers can be damaged
Software
Using the memory cards on the board means that the firmware must manipulate the FAT file system. I used Petit-FatFs module branched from full featured FatFs module. The Petit-FatFs was developped for very small memory system that available RAM size is less than 512 bytes. It is suitable for tiny AVRs.
There are two different firmware files in the archive for each hardware configuration. The dual output configuration that other than mono uses all I/O pins including RESET pin. To switch RSTDISBL fuse, it must be programmed in HVSP method that most AVR programmer does not support. ISP method can also program it only first time but never re-program. The monaural output configuration uses five I/O pins and it does not need to switch RSTDISBL fuse. It can be programmed in ISP method that supported by all AVR programmers.
The SD audio player supports only RIFF-WAVE format files in LPCM, 8/16-bit, mono/stereo and upto 48kHz sampling rate. MP3 files must be converted to the WAVE file. The player start to play on power-on or card insertion. The WAVE files on the root directory will be played in order of directory listing. Push button switch is to jump to the next file.
Schematics
(1) Mono (2) Stereo (3) Mono Hifi Firmware and Hex File
Anyway this audio player is very simple and a few wires to be solderd so that it is suitable for brief handiwork before bed or breakfast.
Hardware
Right image shows the built SD audio player. I wrote two schematics for the players in different configurations because there is a limitation on programming method due to the pin usage. The card type to be used is MicroSD. Of course the standard SDC and MiniSD can also be attached by pin conversions.
The speakers are driven directly with PWM output of the AVR. The load may be too heavy for the output port. However the output current will not exceed the absolute maximum ratings at 3 volts supply voltage even if the port is tied to the rails. Therefore it cannot sound loud but it will create sufficient sound that listen on the desk with high efficiency speakers. When connect the audio outputs to the amplifier, the high frequency component must be filtered out with LPF. Do not input the PWM signals directly to the amplifier or the amplifier and speakers can be damaged
Software
Using the memory cards on the board means that the firmware must manipulate the FAT file system. I used Petit-FatFs module branched from full featured FatFs module. The Petit-FatFs was developped for very small memory system that available RAM size is less than 512 bytes. It is suitable for tiny AVRs.
There are two different firmware files in the archive for each hardware configuration. The dual output configuration that other than mono uses all I/O pins including RESET pin. To switch RSTDISBL fuse, it must be programmed in HVSP method that most AVR programmer does not support. ISP method can also program it only first time but never re-program. The monaural output configuration uses five I/O pins and it does not need to switch RSTDISBL fuse. It can be programmed in ISP method that supported by all AVR programmers.
The SD audio player supports only RIFF-WAVE format files in LPCM, 8/16-bit, mono/stereo and upto 48kHz sampling rate. MP3 files must be converted to the WAVE file. The player start to play on power-on or card insertion. The WAVE files on the root directory will be played in order of directory listing. Push button switch is to jump to the next file.
Schematics
(1) Mono (2) Stereo (3) Mono Hifi Firmware and Hex File