Playing Sound From An SD/MMC CardPosted: October 30, 2009 Introduction This is an Atmel ATmega168 circuit demonstrating how to grab data off an SD/MMC card, send that data out through an SPI DAC connected to an amplifier, and how to use the A/D converter with an infrared proximity detector. The way I have it programmed here, when the proximity detector detects something geting close it plays 1 sound. When the proximity detector no longer detects the object it plays a second sound. Since it's halloween tomorrow I figured I'd make it a halloween theme. There is a video of it working here:Related Projects @mikekohn.net
Video
Problems Not SD/MMC related, I'm experiencing horrible noise out of the LM386 amplifier when the infrared proximity sensor is connected to the circuit. If I disconnect the 5v power supply from the circuit the noise heard in the circuit above goes away. I probed the circuit with my oscilloscope between the DAC and the amplifier and the signal is perfectly clean so I guess it's somewhere in the amplifier. I tried some capacitors too but had no luck with that. My second problem seems to be that the SD card doesn't honor the /CS pin. In that I mean, when I send data out of the SPI with the DAC selected, the SD card seems to shift the next byte in/out. So I wrote all my samples to the SD card twice and assume only 128 two byte samples per flash block. Pictures Above is the small test circuit from the schematic below. Above is the small test circuit from the schematic below. Source code
Copyright 1997-2024 - Michael Kohn
|