I'm currently researching a system that has the ability to playback multiple sound files from an SD-card, add them together then output the signal to a DAC. I'm basically looking for specifications on how fast the SPI port of any given DSP microcontroller would need be to playback 16 tracks (or alternatively 1 track * 16) simultaneously, the sampling frequency is 44.1kHz standard CD quality for each track. And if anybody knows a good microcontroller (with strong development documentation) for this application..

This feat is the only bottle neck I can currently see in the overall system design, if I can overcome this 16 track playback hurdle, it's all downhill from here.


The equipment will have preset audio tracks on the SD card stored as .wav on FAT32. The equipment also has the capacity to record using an ADC and store .wav on the SD card. There will also be a looping feature, but I dont think that requires extra onboard memory as it can stream directly from the SD-Card


3 Answers 3


Let's do some math:

16 tracks * 44 ksample/s *2 channels *16 bit = 22.528 Mbps

This is the minimum speed you need for the SPI interface, if you want to transmit all the data through a single serial port. Can be done, with an adequate clock, but you need a fast SD card (see here for the speed).

Then there is the microcontroller: you have to add 16 tracks and output them through a DAC, so you have 44*2 ksamples for each track, or

$$ 44 \cdot 10^{3} \cdot 2 \cdot 16 = 1408 \cdot 10^{3} $$

16-bit sums for every sample (probably with some scaling to avoid overflow) result in about 1.4 M operations/sec, that can be handled by a good 32-bit microcontroller. Probably a Cortex-M3, or better M4 (but M3 is probably better documented) can work for you.

I've just seen this which can be clocked up to 204 MHz, has 4 SPI interfaces, up to 40 MB/s, and has also a floating point unit that can help in the accumulation process (but may be too slow). You may also use the dual core structure to handle separately the processing and the output.

But for the DAC I think that you should go for an external converter, specifically designed for audio (which means 16 bit probably).


It's not so clear how are you going to manage the 16 different tracks on the SD:

  • what about pre-loading tracks on the internal memory of the MCU?

Check the I2S interface, which is a 4-wire serial protocol especially designed for audio applications.

Important question:

You said that you want also to record tracks and save them to the SD card: do you want to do that at the same time? You need the controller to encode the audio in WAV and store it, and the writing bandwith of the SD card is lower.

The looping feature WILL need some buffering memory (may also use the internal memory) because looping requires real time operation, and the SD card will introduce too much latency. You may need an external RAM, and you may also think about storing some data there to reduce delays.

  • \$\begingroup\$ Thank you for answering, hit the nail on the head. I am familiar with AVR/Atmega chipsets, I've never touched Cortex before. Is there an Atmega chip comparable to this Cortex-M3? I admit, I am curious about Cortex microcontrollers. \$\endgroup\$
    – Ospho
    Mar 13, 2012 at 11:43
  • \$\begingroup\$ Specifically Atmega32 (since i have a dev-board for it).. \$\endgroup\$
    – Ospho
    Mar 13, 2012 at 11:51
  • \$\begingroup\$ The 8-bit AVRs don't have anything like the performance required for that application. \$\endgroup\$ Mar 13, 2012 at 12:07
  • \$\begingroup\$ @Oliver look here \$\endgroup\$
    – clabacchio
    Mar 13, 2012 at 12:12
  • \$\begingroup\$ Clarification: Input = Stereo RCA, Output = Stereo RCA (CD quality). So i assume thats its 16bit per channel. \$\endgroup\$
    – Ospho
    Mar 14, 2012 at 7:24

The dsPIC33E series from Microchip is a controller + DSP, with up to 512K flash, 52K RAM, four 15 Mbps SPI modules, DMA, and can run at 60 MIPS. The DSP features include hardware MAC, (16×16)-bit single-cycle multiplication, barrel shifting, bit-reversal, and two 40-bit accumulators.

About $12 in single quantities at Digi-Key.

  • \$\begingroup\$ On a offside note: How would you setup a development board for something like this? use an SMT to through-hole style adapter and then use a USB port to connect it to the computer? I need to work with breadboards for initial prototyping. \$\endgroup\$
    – Ospho
    Mar 13, 2012 at 23:37
  • \$\begingroup\$ Microchip makes a "Audio Development Board" using a 512K dsPIC33E, which Digi-Key sells for $149. They have some versions in 28-pin DIPs, although they only have 128K flash and 16K RAM. \$\endgroup\$
    – tcrosley
    Mar 13, 2012 at 23:47
  • \$\begingroup\$ @Oliver, BTW many of the chips in the dsPIC33E series can act as either a USB host or slave, as they have USB 2.0 OTG onboard. However it is only rated for full-speed (12 Mbbs), not high-speed (480 Mbs). \$\endgroup\$
    – tcrosley
    Mar 14, 2012 at 0:15
  • \$\begingroup\$ With a $250 development budget (university limitations) i will most likely need to build a development board myself... \$\endgroup\$
    – Ospho
    Mar 14, 2012 at 4:09

Have a Look at the XCore series www.xmos.com. They have a bit of a learning curve, but are extremely powerful and come with (relatevly) cheap devtools and a free IDE. There is also a community at xcore.com.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.