Go Down

Topic: Audio playback with 2 PWMs in ATmega328p using SimpleSDAudio Library (Read 773 times) previous topic - next topic

Rtchtam

My project wants to play audio from SD card with minimum power and smallest size (for toy usage). I am using SimpleSDAudio library in ATmega328p now. (http://www.hackerspace-ffm.de/wiki/index.php?title=SimpleSDAudio)

I want to use 2 PWM for 16-bit mono playback (reduce the noise), the library is required to use pin 9 and 10. However, the SD card SS pin is fixed in the pin 10.

How can I use 2 PWMs output for ATmega328p using SimpleSDAudio library?

Any comments and suggestions are welcome.
Thank you very much!!

xl97

I'm pretty sure you can switch the CS/SS pin for the SD card....no?


That being said.. I'm not sure you can only 2 files on the SD card at once to get 2 difference PWM outputs (or am I reading your intent wrong?)


Grumpy_Mike

Quote
I want to use 2 PWM for 16-bit mono playback
How will that work then?

Here is a clue, it will not. Is your thinking that you have one PWM output for the upper 8 bits and another for the lower 8 bits and then you smooth them and then mix them together in to proportion 1:256? This mixing would have to be done with an accuracy of greater than 0.39% requiring accurate and stable resistors.

This would mean that the lower PWM has a maximum output of 19.5mV with a step size of 76.6uV, way too small not to be swamped by digital noise.

Quote
(reduce the noise)
The simplest way is to get an external D/A.

Go Up