We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
It seems the str9 processor will always loop-back data sent on the SSP if the NSS pin is low. This is true whether that pin is programmed as an input or output. In order to create a chip select signal to use the SD card in SPI mode then, I cut the track and use another GPIO pin for the purpose.
This fixed the "always looping back" problem and lets me read replies from the card.
However, I'm still having trouble. The card never seems to go into SPI mode. Has anybody got this working?
Dave
I added pullups to all the lines, and it made little difference, although it did change the responses somewhat.
As a last resort, I wrote "bit banged" SPI send and receive routines. That is, I don't use the SSP at all, but control the pins directly as GPIO. Now everything works perfectly!
Maybe there is something about the SSP signals in idle states that the SD card (a Sandisk 1 Gig card) doesn't like. I'd still like to get the SSP working in order to improve speed and reduce the processor load.
Did you initialize the card to SPI mode with SPI clock only 400kHz? When the card is initialized, you may use a 25MHz clock.
Yes I did, that's not the problem.
I'd like to heard from anyone who has it working using the SSP. I must be missing something.