Go Down

Topic: Mmc spi problem no start byte error (Read 663 times) previous topic - next topic

renasis

Hello,

I am having an issue with reading an sd card using an mmc library in bootloader with 328p. Initializatio fine. Reading sectors good, most of the time. Occasionally have error reading sector. Byte Address correct, data at location. Spi doesn't read. I get back no start byte error back. Not sure what this means or how to remedy. Tried re-init spi at spot where error occurs, but doesn't help. Is this spi problem, sd card problem or timing problem?

Thanks,

ren

MarkT

It might be any of those really - what speed SPI are you using (try slower if you're using a fast clock).  There might be a bug in the library, try a different one (I believe there are several).  If you tell us which library and card details someone might have more info.
[ I won't respond to messages, use the forum please ]

renasis

MarkT,

I adjusted read speed from 0<<SPR1 | 0<<SPR0 to 0<<SPR1 | 1<<SPR0 and it fixed the problem. Nice call.

Thanks,

-ren

MarkT

Ah good to hear it worked.  You may find that some manufacturer's cards are better (faster) than others.
[ I won't respond to messages, use the forum please ]

Go Up