I used one of my XMega32E5 breakout boards today to get a proof of concept for the audio generation.
I took one of my favorite songs (Waste by Seether) and converted it into 8 kHz 16 bit raw audio and loaded that onto a microSD card. I built a microSD slot breakout board and stitched the two together on a breadboard.
I was able to make the intended design functional without too much trouble. TCC4 is configured as an 8 kHz timer. Its overflows are used as an event to trigger a DAC conversion. The DAC data-register-empty bit is used as a trigger for DMA. The DMA system is set up for double-buffering (so the transfers will be completely gapless), and Petit FFS used to read the data from the card. TCD5 is used to generate a 1 kHz square wave on one of the pins. This is turned on and off by changing that pin from an output to an input and vice versa. As a side effect, that same timer will generate overflow interrupts to keep a millisecond (it's actually half milliseconds, since the timer actually counts at 2 kHz) counter for SD card timeout handling.
No changes to the circuit are required, at least for this part of the system.
I think now I have enough confidence to actually order the first boards.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.