I am working on an NEC v850ES/JH3 controller for testing an SD card driver in SPI mode. We interfaced the SD card slot directly to the v850ES/JH3 controller without any pull-up resistors. Does it have any negative effects?
I am able to initialize the SD card in SPI mode. I am also getting a 0x00 response for CMD16.
After SD card initialization I am changing the clock frequency to 4 MHz.
I am checking SD card busy or not (if the response is 0xFF then the SD card is not busy).
When I am sending a read command (CMD17) and dummy data, I get the response 0xC1, and after that, the next byte is 0x3F. That means the read command failed.
If we don't send dummy data after the read command then I am getting response 0x04, meaning an illegal command. In this case also, read is failing.
If we won't check the SD card is busy or not then I am getting response 0x00 for the read command, which means the read command was accepted. And I am also getting the start token (0xFE), meaning the SD card will send a block of data. If I read 512 bytes of block data then I am getting all zeros. I am trying to read the boot record. That means some data is there other than zeros.
I am also facing the same issue with SD card block write.
What is the problem and how can I fix it?