I am trying to communicate with MMC/MicroSD cards, using 6502 microprocessor (and some FPGA between, which is de facto responsible for the whole communication on SPI protocol).
Firstly i developed library which allowed to communicate with MMC cards. It worked great. Then I tested it on small micro SD cards ( <= 2GB) and it worked too, without any changes. Then i wanted support SDHC cards. I am detecting card according to these diagram:
http://elm-chan.org/docs/mmc/mmc_e.htmlhttp://elm-chan.org/docs/mmc/pic/sdinit.pngOn SD/MMC, sectors were adressed like 0, 512, 10124, etc. On SDHC, they have adressees 0,1,2,3,...
It is also working without problems, I tested it on 8 GB & big 32 GB Kingston SDHC.
Few days ago I ordered a lot of random used 4 GB cards. Half of them are working, the other half (which are all branded by SanDisk) are not working at all. After sending CMD0, the card is answering 0x01, but then sending CMD8 returns odd results.
Here are my waveforms.
Do you have any idea what is the difference between Sandisk's SPI? I looked into their datasheed and for example CMD8 is reserved..
https://web.archive.org/web/20131115122620/http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Components/General/SDSpec.pdfWhen SandiskCards are inserted into computer's card reader, all of them are working of course.
SPI's !CS is permanently grounded, MOSI/MISO/SCLK are driven by fpga's pins at 3.3 V level. SCLK freqency is 800 kHz.