Closed bog-dan-ro closed 10 months ago
Do you have any evidence that off the shelf SD cards can work with CS hardwired?
Physical Layer Specification Version 3.01 says:
Every command or data block is built of 8-bit bytes and is byte aligned to the CS signal (i.e. the length is a multiple of 8 clock cycles). The card starts to count SPI bus clock cycle at the assertion of the CS signal. Every command or data token shall be aligned to 8-clock cycle boundary... The host starts every bus transaction by asserting the CS signal low.
I think I have encountered SD cards that insist on having CS raised between transactions. That's not to say that there are not SD cards that will work with CS tied low; I just don't know.
Ah, you're right
If you want to save pins, I think a better approach is to use 1-bit SDIO.
For SPI, you need:
For 1-bit SDIO you need:
There is an implementation in pico_sd_card. I am considering adding that functionality to this library.
It's very useful for projects that are using a single SPI sdcard and the CS is hardwired, this way we save a pin ;-) .