Board index › Products › Audio Codec Shield

Adding another SPI device along side the Codec shield

4 posts · 19806 views

Adding another SPI device along side the Codec shield

by yamanoorsai » Sat Aug 16, 2014 06:03 UTC
I am trying to record audio data from the Codec chip to an SD card @ 8 kHz using the shield + Arduino Uno(not sure if it is possible - Just an experiment). I tried connecting an SD card to the SPI interface with a different CS pin. The moment I connect anything to the clock pin (D13 of the arduino) apart from the codec shield, it generates a lot of static noise. I assumed that the SPI pins are held at a high impedance state unless the CS pin is low.

Re: Adding another SPI device along side the Codec shield

by guest » Sat Aug 16, 2014 15:03 UTC
you have 3 options for this:

1. bit bang SPI on another set of pins - not really reccomended, but it might work
2. use the UART in SPI mode - this should work well, but make USB not work
3. multiplex the SPI lines - a bit complicated, but works well

here is more info on multiplexing spi lines:
viewtopic.php?f=21&t=487

SDcards need 3.3V and a level translator anyways, so its not any extra hardware (unless you were planning on using resistor dividers instead of a level translator chip). so you put another buffer IC (like on the codec shield), and you turn only one device on at a time. you cant just connect the lines to each other, as they will fight with each other. for example: data out from codec and data out from sdcard both need to go to data in on the spi peripheral. but, these are both outputs, so if one tries to go high while the other goes low, they short out the powersupply. the output of the codec does not hi-z between data packets.

Re: Adding another SPI device along side the Codec shield

by yamanoorsai » Sun Aug 17, 2014 04:31 UTC
the output of the codec does not hi-z between data packets.


Thanks. I plan to write to SD card @ 8 kHz. According to my research. It is possible.

Re: Adding another SPI device along side the Codec shield

by guest » Mon Aug 18, 2014 16:27 UTC
if you figure it out, please post back to let us know how you did it.