MyThe device I am developing is an SD Cardcard storage add-on to a retro computer., SanDisk Ultra II 1.0GB0 GB SD Cardcard in an SD Cardcard socket (noI have no idea if the brand is significant, it just happens to be what I have). The
The SD Cardcard is the only device on the SPI bus; a level shifter ensures the card is fed signals at 3.3V;3 V; MISO feeds via bus-switch to a 3.3V3 V FPGA. The FPGA implements a clocked shift register mechanism, which clocks 8eight times, shifting out output data to MOSI and capturing input data from MISO.
Many devices attached to many computers work fine.
I use SPI mode. I initalise the card, speed it up to 4MHz4 MHz, and send the read single block command.
I observe that first data byte returned occasionally has an 1a one-bit corruption. Typically bit 0 is set when shouldn't be, but I have also seen bit 1 set when it shouldn't be. All other bytes are perfectly correct, always.
Multiple devices were tested attaching to multiple host computers. ProblemThe problem was only seen with one device attaching to one computer. DeviceThe device or computer works fine with other computers or devices.
I suspected timing errors in my driver code, but I am sure I have done the 8eight clock cycles (sending 0xFF
, reading first data byte) before I read it.
I'm wondering, could this be related to voltage or current levels, which might be subtly different depending on device or computer. I'm?
I'm wondering, does an SD Cardcard suddenly need to draw extra current, just as it starts to output data?
Ideas?