Skip to main content

Occasionally the first byte of data from an SD Cardcard SPI read is bad

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?

Occasionally first byte of data from SD Card SPI read is bad

My device I am developing is an SD Card storage add-on to a retro computer. SanDisk Ultra II 1.0GB SD Card in SD Card socket  (no idea if brand is significant, just happens to be what I have). The SD Card is the only device on the SPI bus; level shifter ensures card is fed signals at 3.3V; MISO feeds via bus-switch to 3.3V FPGA. The FPGA implements a clocked shift register mechanism, which clocks 8 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 up to 4MHz, and send the read single block command.

I observe that first data byte returned occasionally has an 1-bit corruption. Typically bit 0 is set when shouldn't be, but have also seen bit 1 set when shouldn't be. All other bytes are perfectly correct, always.

Multiple devices tested attaching to multiple host computers. Problem only seen with one device attaching to one computer. 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 8 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 wondering, does an SD Card suddenly need to draw extra current, just as it starts to output data?

Ideas?

Occasionally the first byte of data from an SD card SPI read is bad

The device I am developing is an SD card storage add-on to a retro computer, SanDisk Ultra II 1.0 GB SD card in an SD card socket  (I have no idea if the brand is significant, it just happens to be what I have).

The SD card is the only device on the SPI bus; a level shifter ensures the card is fed signals at 3.3 V; MISO feeds via bus-switch to a 3.3 V FPGA. The FPGA implements a clocked shift register mechanism, which clocks eight 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 4 MHz, and send the read single block command.

I observe that first data byte returned occasionally has a 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. The problem was only seen with one device attaching to one computer. The 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 eight 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 wondering, does an SD card suddenly need to draw extra current, just as it starts to output data?

Tweeted twitter.com/#!/StackElectronix/status/299052079174000641

My device I am developing is an SD Card storage add-on to a retro computer. San Disk SanDisk Ultra II 1.0GB SD Card in SD Card socket (no idea if brand is significant, just happens to be what I have). SDThe SD Card is the only device on the SPI bus. Levelbus; level shifter ensures card is fed signals at 3.3V. MISO3V; MISO feeds via bus-switch to 3.3V FPGA. The FPGA implements a clocked shift register mechanism, which clocks 8 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 up to 4MHz, and send the read single block command.

I observe that first data byte returned occasionally has aan 1 bit-bit corruption. Typically bit 0 is set when shouldn't be, but have also seen bit 1 set when shouldn't be. All All other bytes are perfectly correct, always.

Multiple devices tested attaching to multiple host computers. Problem Problem only seen with one device attaching to one computer. Device 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 8 clock cycles (sending 0xFF0xFF, 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 wondering, does an SD Card suddenly need to draw extra current, just as it starts to output data?

Ideas?

My device I am developing is an SD Card storage add-on to a retro computer. San Disk Ultra II 1.0GB SD Card in SD Card socket (no idea if brand is significant, just happens to be what I have). SD Card is the only device on the SPI bus. Level shifter ensures card is fed signals at 3.3V. MISO feeds via bus-switch to 3.3V FPGA. The FPGA implements a clocked shift register mechanism, which clocks 8 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 up to 4MHz, and send the read single block command.

I observe that first data byte returned occasionally has a 1 bit corruption. Typically bit 0 is set when shouldn't be, but have also seen bit 1 set when shouldn't be. All other bytes are perfectly correct, always.

Multiple devices tested attaching to multiple host computers. Problem only seen with one device attaching to one computer. 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 8 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 wondering, does an SD Card suddenly need to draw extra current, just as it starts to output data?

Ideas?

My device I am developing is an SD Card storage add-on to a retro computer. SanDisk Ultra II 1.0GB SD Card in SD Card socket (no idea if brand is significant, just happens to be what I have). The SD Card is the only device on the SPI bus; level shifter ensures card is fed signals at 3.3V; MISO feeds via bus-switch to 3.3V FPGA. The FPGA implements a clocked shift register mechanism, which clocks 8 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 up to 4MHz, and send the read single block command.

I observe that first data byte returned occasionally has an 1-bit corruption. Typically bit 0 is set when shouldn't be, but have also seen bit 1 set when shouldn't be. All other bytes are perfectly correct, always.

Multiple devices tested attaching to multiple host computers. Problem only seen with one device attaching to one computer. 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 8 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 wondering, does an SD Card suddenly need to draw extra current, just as it starts to output data?

Ideas?

removed specific name in post
Source Link
Gustavo Litovsky
  • 7.7k
  • 3
  • 27
  • 44

My device I am developing is an SD Card storage add-on to a retro computer. San Disk Ultra II 1.0GB SD Card in SD Card socket (no idea if brand is significant, just happens to be what I have). SD Card is the only device on the SPI bus. Level shifter ensures card is fed signals at 3.3V. MISO feeds via bus-switch to 3.3V FPGA. The FPGA implements a clocked shift register mechanism, which clocks 8 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 up to 4MHz, and send the read single block command.

I observe that first data byte returned occasionally has a 1 bit corruption. Typically bit 0 is set when shouldn't be, but have also seen bit 1 set when shouldn't be. All other bytes are perfectly correct, always.

Multiple devices tested attaching to multiple host computers. Problem only seen with one device attaching to one computer. 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 8 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 wondering, does an SD Card suddenly need to draw extra current, just as it starts to output data?

Ideas?

{{{ Andy

My device I am developing is an SD Card storage add-on to a retro computer. San Disk Ultra II 1.0GB SD Card in SD Card socket (no idea if brand is significant, just happens to be what I have). SD Card is the only device on the SPI bus. Level shifter ensures card is fed signals at 3.3V. MISO feeds via bus-switch to 3.3V FPGA. The FPGA implements a clocked shift register mechanism, which clocks 8 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 up to 4MHz, and send the read single block command.

I observe that first data byte returned occasionally has a 1 bit corruption. Typically bit 0 is set when shouldn't be, but have also seen bit 1 set when shouldn't be. All other bytes are perfectly correct, always.

Multiple devices tested attaching to multiple host computers. Problem only seen with one device attaching to one computer. 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 8 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 wondering, does an SD Card suddenly need to draw extra current, just as it starts to output data?

Ideas?

{{{ Andy

My device I am developing is an SD Card storage add-on to a retro computer. San Disk Ultra II 1.0GB SD Card in SD Card socket (no idea if brand is significant, just happens to be what I have). SD Card is the only device on the SPI bus. Level shifter ensures card is fed signals at 3.3V. MISO feeds via bus-switch to 3.3V FPGA. The FPGA implements a clocked shift register mechanism, which clocks 8 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 up to 4MHz, and send the read single block command.

I observe that first data byte returned occasionally has a 1 bit corruption. Typically bit 0 is set when shouldn't be, but have also seen bit 1 set when shouldn't be. All other bytes are perfectly correct, always.

Multiple devices tested attaching to multiple host computers. Problem only seen with one device attaching to one computer. 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 8 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 wondering, does an SD Card suddenly need to draw extra current, just as it starts to output data?

Ideas?

Source Link
Loading