Do I need to delay after doing an SPI.transfer to allow the byte to clock out before setting the SS pin high.
void SpiRAM::writeByte(long address, byte data_byte){
// Write 24bit address, write byte
digitalWrite(_ss_Pin, LOW);
SPI.transfer(WRITE);
SPI.transfer((byte)(address >> 16));
SPI.transfer((byte)(address >> 8));
SPI.transfer((byte)address);
SPI.transfer(data_byte);
delay(10); // <=- Do I need this & what is a sensible delay value if I do.
digitalWrite(_ss_Pin, HIGH);
}
Not normally. I have used delayMicroseconds(1) after taking the SS LOW to wait for a slow SPI device to get ready before starting a transfer, but not after the transfers. SPI.transfer doesn't return until the transfer is complete.
SurferTim:
Not normally. I have used delayMicroseconds(1) after taking the SS LOW to wait for a slow SPI device to get ready before starting a transfer, but not after the transfers. SPI.transfer doesn't return until the transfer is complete.
Thanks, The chips CS setup time is 25ns so no problems there.