The response timing for ACMD41 , which is used to detect the completion status of initialization, value 0x00 is for completion.
From the timing capture by logic analyzer, it is seen that response data comes half clock period Working SD Card, so it is highly suggested that sampling response data
Not Working with half clock period earlier . otherwise, it is possible to get a wrong
data of 0x01 instead of 0x00 .
How I can fix with Not Working SD card SPI read write half clock period earlier ? can anyone to help with this ?
These example are all the response timing for CMD8 , which is used to send SD card interface condition , value 0x08 is the correct response value .
From the timing capture by logic analyzer, it is seen that response data comes half clock period
earlier for Notworking SD Card, so it is highly suggested that sampling response data
for Notworking SD Card with half clock period earlier . otherwise, it is possible to get a wrong
data of 0x10 instead of 0x08 .
Welcome!
You need to look into SPI modes which refer to the different configurations of clock polarity (CPOL) and clock phase (CPHA) used in the Serial Peripheral Interface protocol to control data transmission timing. There are four modes: Mode 0, Mode 1, Mode 2, and Mode 3, each defining how data is sampled and shifted relative to the clock signal. Check the following link: https://www.analog.com/en/resources/analog-dialogue/articles/introduction-to-spi-interface.html
Hopefully the following answeres your question. Please note I do NOT know how to program your processor, somebody else will have to help.
SPI Mode
CPOL
CPHA
Clock Polarity in Idle State
Clock Phase Used to Sample and/or Shift the Data
0
0
0
Logic low
Data sampled on rising edge and shifted out on the falling edge
1
0
1
Logic low
Data sampled on the falling edge and shifted out on the rising edge
2
1
0
Logic high
Data sampled on the falling edge and shifted out on the rising edge
3
1
1
Logic high
Data sampled on the rising edge and shifted out on the falling edge