Shop OBEX P1 Docs P2 Docs Learn Events
Bit bang initialize SD card in SPI mode — Parallax Forums

Bit bang initialize SD card in SPI mode

AKruzelAKruzel Posts: 25
edited 2011-10-22 14:47 in Accessories
Hello all,

I'm working on reading and writing to the SD card on the spinneret and right now i have code written to initialize the SD card in SPI mode however it's not working as expected. I can't figure a way to hook the prop scope to the SD card on the spinneret so i can read the signals, so i have the DIP propeller mounted on a breadboard and run the same code in the DIP propeller and monitor the outputs. The pins i'm monitoring on the DIP are the same ones that are connected to the SD card on the spinneret. The outputs on my prop scope seem to match EXACTLY with what i've found on other websites with people who've worked with SD cards, however the issue is that after sending the CMD0, i wait to receive the low bit that marks the start of the response token but it never comes. I'm stuck, if anyone could take the time to try out my code i would appreciate it!!

to explain my code, when the code is downloaded, the prop initializes the necessary pins (SCLK, MISO,MOSI, CS) as outputs and inputs and then goes to the LIVE command which is simply there to stop the code and wait for user input on the serial terminal so that the user can see what happens instead of the code running through really fast. type E in the serial terminal and the code will continue by sending CMD0. after sending CMD0 it monitors the MISO line waiting for the low bit to mark the start of the response token and if the pin is high, it loops and toggles SCLK until the MISO line goes low. This is where my problem is, the MISO line never goes low.

Thanks to anyone who can help me out!

Cheers!

Adam
Sign In or Register to comment.