SD card with driver fsrw26
ayume
Posts: 19
hi guys,
this my first time accessing sd card with propeller. i was following tuturials in gadgetgangster http://www.gadgetgangster.com/tutorials/331, but the result is failed to mount.
i've checked my sd card connector, made a new connector from http://www.parallaxsemiconductor.com/an006 and still same.
now i use EMS SD card from Innovative Electronic, this is the schematic
and use program test.spin from frsw26, the result is
Mount tests first
First mount.
Succeeded; stopping cog.
Second mount.
Succeeded.
Reading block 0 (should be a boot block)
Erroneously returned from start!
-255
i've already use SD card 1 gb, 2gb and SDHC 4gb and have same fail to maount
anyone can explain to me????
this my first time accessing sd card with propeller. i was following tuturials in gadgetgangster http://www.gadgetgangster.com/tutorials/331, but the result is failed to mount.
i've checked my sd card connector, made a new connector from http://www.parallaxsemiconductor.com/an006 and still same.
now i use EMS SD card from Innovative Electronic, this is the schematic
and use program test.spin from frsw26, the result is
Mount tests first
First mount.
Succeeded; stopping cog.
Second mount.
Succeeded.
Reading block 0 (should be a boot block)
Erroneously returned from start!
-255
i've already use SD card 1 gb, 2gb and SDHC 4gb and have same fail to maount
anyone can explain to me????
Comments
OBC
EMS schematic
FSRW also comes with such a speed test (indeed that's what he is running), and I believe fsrw will work with at least as many cards as Kye's driver, and quite a bit faster, as well.
I would not use any buffering circuitry at all; you can also skip all resistors for testing. Just a straight four-wire connection (along with power and ground of course.) This should work easily and be trouble-free. (When this works, I recommend adding the 10K pullups to help avoid floating inputs.)
I don't quite understand the limitations in fsrw 2.6 as described: Could you explain more what that mean in terms of file size and card compatibility? Say the cluster size is 32k, does that mean it will only work with a file of size =<32 kbytes, or am I misunderstanding something basic? This would have to do with reading out the Nth entry in a file that has >N fixed field records. The workaround is to open the file for read and then read and throw out records out in turn up to N.
Kye's does not mention any limitations, I think.
@Rokicki - Yep, FSRW is like 4 to 8 times faster and much smaller. My driver is more about just supplying everything and the kitchen sink to the user than being lean and mean.
With frsw2.6 driver, success just at 2nd mount with error -255
With key driver, led 23 blink at 1Hz
I'll use (really really) new sd card
Is'nt any problem if I use micro sd with adapter?
Mosi at sd card is di to p2 at propeller
Right?
Please, I still stuck in here...
My little bit of help is here:
http://www.rayslogic.com/propeller/Programming/SD_Card/SD_Card.htm
But, I have found you don't need the pull-up resistors...
You do have to format the SD card a certain way, at least with older versions of FRSW.
Also, make sure the pins you are using matches with the code.
Reading block 0 (should be a boot block)
That could indicate something wrong with the card format, but the fact that you already tried it with several cards makes that less likely. I have found that fsrw works with practically all cards I have purchased new recently, usually 1GB or 2GB, or 4 or 8GB HCSD cards.
Maybe there is a power glitch when it goes to read the block? It might help in that case to include a capacitor right across the power at the SD card, if one is not included already.
The circuit you have is complicated, with the SN74LVC07 non-inverting buffer and all the resistors and connectors. If possible, try it with the simpler connections direct to the Prop and power supply as suggested by others above. Maybe there is a loose connection or delay in that extra circuitry.
Dave, I do see that code that appears to be crossing cluster boundaries. And it only seems to throw the error if the position being requested is greater than filesize, without regard for clustersize. I'm just not sure how to test it to give it the most-likely-to-fail challenge. How many bytes are in a cluster anyway? Say a sector is 512 bytes, and a cluster is 32768, does that mean that a cluster is made up of 32768/512 = 64 sectors?
Kye, I appreciate that your driver includes everything, and luckily I use BST so that it can pass up unused methods. Still, I'm after optimizing both footprint and speed, more specifically, low power, which is the other side of the same coin.
On the problems you're seeing: I'm not exactly sure what's going on. You are able to
mount the card (twice), but then read block is failing.
Why don't you upload *all* of your code (use the make archive feature of the
PropTool) and I'll test it on my system.
I've added a 10uF cap at the power, still error -255. I tried with 470uF cap, same. It has happened for all my card. I've reformatted all of them and no change.
Is it possible that you have a corrupted version of the archive and test program? Upload the firmware you are using here so someone else can check it.
i get frsw26 driver at http://obex.parallax.com/objects/92/
and key driver at http://www.parallaxsemiconductor.com/an006
i didn't make any significant change
Are you sure the Prop is working right? An easy way to make sure is try full-duplex serial communications back to the PC at 115200 baud.
Hey, that's hilarious! I'll have to use that, "legacy documentation". Almost sounds like a feature!
Unfortunately, the seek support is for reading files only. Arbitrary cluster sizes are supported (but on the
Prop, whether for my driver or Kye's, larger clusters are almost always better for several reasons.)
Thanks for the kind words! I need to spend some time cleaning up those docs.
Original poster: not sure why you can't upload. General guidance here includes: post a picture of your setup, and upload all code. How big is the archive you are trying to upload?
I attached a note (a "review") about this to the the fsrw OBEX listing, until such time as you are inclined to update it for such a small matter of legacy (hehe) wording in a comment. Those reviews seem to be the only place to add notes of that sort, in addition to pats on the back.
can you please explain to me more about full-duplex serial communications back to the PC?
what should i do?
i just connect the 4I/O pins (DO, DI, SCK/CLK, CS) and a 10uF cap between the power and ground
and the respond error is -255
but sometime -1
any advice?
thank you for not giving up on me
this are my archive (finally i can attach them )
test - Archive [Date 2011.10.01 Time 05.14].rar
test - Archive [Date 2011.10.12 Time 17.14].zip
But, it appears to me that you have the SD wired up to the wrong pins!
Your code indicates you are using P0..P3, but your photo looks like you're using P4..P7.
You need to either change the code or your wiring...
ya, when i try P4..P7 i changed the code become
sd_DO = 4
sd_CLK = 5
sd_DI = 6
sd_CS = 7
but still error -255
http://www.rayslogic.com/propeller/Programming/SD_Card/SD_Card.htm
about half way down, you'll see a blue SD card with the pin#s written on it.
Below that is a table saying which pin goes to what Prop pin.