LowPowerLab Forum

Hardware support => Moteino => Topic started by: chalupien on April 12, 2014, 12:39:45 AM

Title: SPI SD Shield
Post by: chalupien on April 12, 2014, 12:39:45 AM
Hello All, I have an SD shield setup for SPI on an UNO, the pin select is set to pin 6, and a radio transceiver is also on the SPI port with pin 10 as the pin to select HIGH/LOW for selecting either device.

In my sketch I first start by seeing the SD cardInfo, which works perfect, then initialize the radio, then begin to loop to receive a packet of data from the RFM69 and then save it immediately to the SD card. I set the radio CS pin to HIGH (to deselect is) and the SD CS pin to LOW (to select it) and  save the data to a file.

BUT it only (100%) works the very first time.

I've been looking into the SPI datamode being the problem. I'm not sure where to look next. I have an O-scope and can see the CS pins moving correctly however the CS pin for the radio seems to jump around...

Anyone know what I should look at?

Thanks
Title: Re: SPI SD Shield
Post by: chalupien on April 12, 2014, 10:34:56 AM
Figured it out. SD.begin should only be called once!