I'm reading BMP images with hundreds of kB's raw from an SD card and parse/write the image data to a TFT LCD with an AVR MCU with 2kB RAM.
Reading a single block of 512 bytes with CMD17, passing it to the display, reading the next block and so on works fine but I'd like to see if it goes faster when reading multiple blocks with a single CMD18 instead:
- start reading multiple blocks (CMD18)
- read one block of 512 bytes
- (deselect SD card)
- parse user data and send it to display
- (select SD card)
- read next block...
- when done, stop reading (CMD12)
I am deselecting the SD card in the SPI bus when sending image data to the display so it won't receive the commands and data meant for the display. However, it doesn't seem to be a good idea to deselect the SD card during execution of a command.
The spec says about CMD7:
Command toggles a card between the stand-by and transfer states or between the programming and disconnect states.
But instead of sending two CMD7 per block (including waiting for the card to be no longer busy), reading a single block with one CMD17 should be more efficient? Any other options?