SD card using static SPI
Does anyone have success using Harmony SD card using STATIC SPI drivers?
I am developing code for my PIC32MZ2048EP using Harmony 2.06
We have several peripherals which use SPI and up to this point we have had good experience setting up SPI busses with STATIC drivers.
However, when I attempted to create a driver for the SD card, which has it's own SPI bus, I had serious difficulty getting it to work at all. The card would never register properly, and observing the signals on the SPI bus I could see the card was never getting out of its 400kHz initialisation state. I could see several instances where the bus was not being driven according to the SD Card spec, and it appeared to me that there were serious flaws in the code.
- The initial 74 clock pulses should be driven with the CS and MOSI pin high, but the CS pin was low.
- Waiting for a response from the SD card with the MOSI pin low instead of high.
It was only when closely following project examples which always recommend using DYNAMIC SPI drivers that I had any success, and now I can cheerfully read and write with my SD card at will.
However, it would be our strong preference to set the SD card up with STATIC SPI drivers, since we find this very much simpler to debug.
Does anyone have any comment on this? Is it proven to be possible to work with the SD Card using STATIC SPI?
Many thanks for your time.