Hi,
I am trying to initialize microSD Card using Olimex LPC1766-STK Board and CMSIS
Libraries. I have tried with 3 uSD Cards from different manufacturers and all 3
are initializing BUT with different timings (one card can be initialized with
one try of sending commands with no additional delays like timers, but other
needs at least 8 tries and delays between).
The problem is not only when initializing but it exists when I am trying to Read
or Write Data Blocks (Write can somehow succeed).
All 3 cards works when using IARs code (Mass Storage Device)…
The only difference that I saw is the working frequency of the Core (and the
peripheral).
With CMSIS it is 100MHz and for the SSP1 (used as SPI) peripheral is 25MHz, With
IARs example the working frequency is 96MHz and for the SSP1 peripheral is 24
MHz (divided by 4).
It is possible to Write Data Block (512B) and getting the response 0x5 telling
wrong CRC that can be ignored (same with IARs code that works), CRC is not
required in SPI mode (MCU to uSD is working), but when I try to read the same
block from the card I get zeros (uSD to MCU problem).
I’ve tried with different delays, but nothing.
When I should read 512B I get zeros (busy bus ?), and after those 512B I get 0xFF which means lines are high and there is no data.
The problem might be the synchronization between the Core and the Peripheral (?).
Thanks in advance,
Regards,
Sasko Krstevski