Help With SD/MMC On Propeller
soshimo
Posts: 215
I've downloaded the FAT library from Tomas Rokicki and Jonathan Dummer off the object exchange. I have the SD/MMC breakout card from SparkFun. My connections are as follows:
P0 -> DO
P1 -> CLK
P2 -> DI
P3 -> CS
All pulled up to 3.3v through a 10k resistor
I've got IRQ from the breakout pulled up to 3.3v through a 10k resistor
The raw reading and writing tests pass. The mounting tests fail. The first test where it reads the boot record fails because it thinks there is no boot record. I've formatted the card as FAT16 with a 1.88GB volume size (the SD card is 2GB). I can read and write files from windows no problem.
The second mount test fails when it tries to start the spsi object. I am receiving a -100 error. Looking at the code it seems like it could be ERR_ASM_NO_READ_TOKEN which is returned from read_single_block. I think it's happening in the code path from start_explicit but I haven't spent the time to trace how it get's from start_explicit to read_single_block.
This is a blocking issue for my project so any and all help would be greatly appreciated.
TIA
Post Edited (soshimo) : 7/15/2010 3:22:42 PM GMT
P0 -> DO
P1 -> CLK
P2 -> DI
P3 -> CS
All pulled up to 3.3v through a 10k resistor
I've got IRQ from the breakout pulled up to 3.3v through a 10k resistor
The raw reading and writing tests pass. The mounting tests fail. The first test where it reads the boot record fails because it thinks there is no boot record. I've formatted the card as FAT16 with a 1.88GB volume size (the SD card is 2GB). I can read and write files from windows no problem.
The second mount test fails when it tries to start the spsi object. I am receiving a -100 error. Looking at the code it seems like it could be ERR_ASM_NO_READ_TOKEN which is returned from read_single_block. I think it's happening in the code path from start_explicit but I haven't spent the time to trace how it get's from start_explicit to read_single_block.
This is a blocking issue for my project so any and all help would be greatly appreciated.
TIA
Post Edited (soshimo) : 7/15/2010 3:22:42 PM GMT
Comments
also, don't be afraid to try at least three different SD cards. It's amazing how many times these are the trouble.
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Feature Projects: PropellerPowered.com
Visit the: PROPELLERPOWERED SIG forum kindly hosted by Savage Circuits.
I just ordered 2 of the uSD adapters from Parallax this morning, and I am very glad to see your post.
I will down load and try the SD Trainer recommended in your post.
I need to buy 2 SD cards.
Are there any specific brands of SD cards that you know usually work?
Are there any brands we should stay away from?
What is the largest mb size card that will work with the Prop?
Thanks,
Zappman
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit Zappman's Blog at Savage Circuits
I think I have something wired wrong or I'm missing a connection.
My output from your test program is as follows:
Running the propeller SD training program
No SD card present.
SD card expected on: P0, P1, P2, P3
Program halted.
I changed the constants in the program to match my connections as I was too lazy to change them. I have DO, CLK, DI, and CS going to P0, P1, P2, and P3 respectively. All are pulled up to 3.3v through 10k resistors. I have Gnd and VCC connected to gnd and the 3.3v rail (regulated). I am pulling IRQ up to 3.3v through a 10k resistor (because I read somewhere to do that). I have no other pins connected from the breakout board (which, coincidently is very similar to Parallax's board). I've tried 2 different cards (all I have on me). I'm going to the shack to buy some more cards to try out. I still think I have something wired wrong or am missing a connection. I'll try to post a schematic.
Thanks for bringing that to my attention.. I'll add updating the SD Trainer to my "to do" list.
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Feature Projects: PropellerPowered.com
Visit the: PROPELLERPOWERED SIG forum kindly hosted by Savage Circuits.
(From fsrw2.6, not from SDTrainer). Normally if raw read/write pass, then
things should be connected okay.
Yeah, I'm pretty sure I'm talking to the card. I was able to see some output but now the function I wrote to return the buffer is suspect. I'll be working on some more diagnostics using the low level block reading routines. I hope to post some data soon. Thanks!
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Feature Projects: PropellerPowered.com
Visit the: PROPELLERPOWERED SIG forum kindly hosted by Savage Circuits.