SD card problems
Ale
Posts: 2,363
I have been trying (after everyone got it working ) to get the SD card to work without any luck :-(
I am using the fsrwFemto and sdspiFemto sources from the 3.007 FemtoBasic source.
My card is connected as follows:
Pin 1 (Alias /CS) to PA15
Pin 2 (Alias DI) to PA14
Pin 5 (Alias CLK) to PA12
Pin 7 (Alias DO) to PA13
There are pull-up of 13 kbytes in all other lines. Pin 4 is +3.3V and 3 and 6 are GND.
I initialize the card as follows:
Now I only get as far as the error: Returned from start -1669 either there is a card or not, but do not be that fast... When I sniff the communication with a ligic analyzer I see the following picture:
I thought the driver had to clock, i.e. using CLK! at least 80 times before any command could be sent... here there is nothing, nothing besides those 8 pulses in DI. What is going on ?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit the home of pPropQL, pPropQL020 and OMU for the pPropQL/020 at omnibus.uni-freiburg.de/~rp92
I am using the fsrwFemto and sdspiFemto sources from the 3.007 FemtoBasic source.
My card is connected as follows:
Pin 1 (Alias /CS) to PA15
Pin 2 (Alias DI) to PA14
Pin 5 (Alias CLK) to PA12
Pin 7 (Alias DO) to PA13
There are pull-up of 13 kbytes in all other lines. Pin 4 is +3.3V and 3 and 6 are GND.
I initialize the card as follows:
CON sdCS = 15 sdDI = 14 sdCLK = 12 sdDO = 13 VAR long i2cCtrl byte tbuf[noparse][[/noparse]20] OBJ sdfat: "fsrwFemto" term: "FullDuplexSerial" pub go | x x := \start term.str(string("Returned from start", 13)) term.dec(x) term.tx(13) PUB start | r, sta, bytes term.start(31, 30, 0, 9600) term.str(string("IOProp: Mounting.", 13)) sdfat.start(@i2cCtrl) sdfat.mount(sdDO, sdCLK, sdDI, sdCS) term.str(string("Mounted.", 13)) term.str(string("Dir: ", 13))
Now I only get as far as the error: Returned from start -1669 either there is a card or not, but do not be that fast... When I sniff the communication with a ligic analyzer I see the following picture:
I thought the driver had to clock, i.e. using CLK! at least 80 times before any command could be sent... here there is nothing, nothing besides those 8 pulses in DI. What is going on ?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit the home of pPropQL, pPropQL020 and OMU for the pPropQL/020 at omnibus.uni-freiburg.de/~rp92
Comments
m thinking of mparks ED, or OBCs PropDOS? This way you could rule out if its yours hardware or your software.
Rick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit the home of pPropQL, pPropQL020 and OMU for the pPropQL/020 at omnibus.uni-freiburg.de/~rp92
The femto routine requires an eeprom to be present. I modified the sdspifemto routine to release the SD cards D0 pin (because I use it for multiple purposes). Otherwise it just ran on the TriBlade with the pin changes.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index)
· Search the Propeller forums (via Google)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
I think the problem may be with your call to
sdfat.start(@i2cCtrl)
You defined i2cCtrl as:
long i2cCtrl
I believe it needs to be defined as:
long i2cCtrl
The fsrwFemto routine needs two longs to work with.
Jim
I forgot the forum formatting doesn't allow you to show these subscripts [noparse]:([/noparse]
So it should be:
Hard to tell what you really have it the forum doesn't show what you enter.
Jim
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit the home of pPropQL, pPropQL020 and OMU for the pPropQL/020 at omnibus.uni-freiburg.de/~rp92
Check your wiring and try another SD card.
I did not say, I'm using a 6.5 MHz crystal with PLL16x. (But that sure is not the problem). I'm worried about the lack of clock pulses...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit the home of pPropQL, pPropQL020 and OMU for the pPropQL/020 at omnibus.uni-freiburg.de/~rp92
My view is that you may be able to get away with operating out-of-spec, but, if you're running into problems, you first make sure that you're operating within specs ... your problems may go away. If not, you leave it that way (in spec) until you figure out what's really wrong and fix it, then try it out-of-spec.
Check out the table and pin photo on this page:
http://www.rayslogic.com/propeller/Programming/SD_Card/SD_Card.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
You should swap the PA12 and PA13 connection: DO on PA12 and CLK on PA13. Many application that uses Rockikis SD card driver define only an SD-basepin and expects the pins in the order: DO, CLK, DI, CS.
But this can not be the only reason, for your problem, because the Femto code allows to define all the pins separatly.
Andy
I have a prop that won't clock above 103 mhz. For me that could be the result of a bad layout (or a lack of a layout, my prop is deadbugged.) Above 103 mhz the prop starts to run the program wrong, it will partially work for a while.
But even a deadbugged prop clocks in at 103 mhz. Im sure if I threw in a few caps right on top of the VDD/VSS pins, i could get more speed. Perhaps you just need a few caps near the props VDD/VSS pins?
BPM: My layout is a bit better, 2 decoupling CAPS 1uF and 100 nF, crystal is quite close, few mm away... see the layout in my sig's page. I'll investigate further.
Rayman: I got a head start looking at your page. But now I do not know what is wrong
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit the home of pPropQL, pPropQL020 and OMU for the pPropQL/020 at omnibus.uni-freiburg.de/~rp92
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
If it was only Clock isue You wil not have that fine Data pulses on DI pin.
Have You PulUpps on all SD signal pin's ?.
I use 15K resistors and it funktion corectly with 15MHz PLLx8
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nothing is impossible, there are only different degrees of difficulty.
For every stupid question there is at least one intelligent answer.
Don't guess - ask instead.
If you don't ask you won't know.
If your gonna construct something, make it·as simple as·possible yet as versatile as posible.
Sapieha
Does anyone knows if the current driver in propDOS supports MMC cards at all ?
I can see that the card answers something like :
CMD 40: response 01
CMD 77!: 05
CMD 69!: 05
The 77 and 69 shouldn't be 55 and 41 ?! (I'm testing at 48 MHz, so no clock problems)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit the home of pPropQL, pPropQL020 and OMU for the pPropQL/020 at omnibus.uni-freiburg.de/~rp92
Post Edited (Ale) : 6/12/2009 1:14:56 PM GMT
There is a small bug in sdspiFemto.spin:
The commands should be $55 and $41 HEX and not decimal !!
Here the fixed version: The following code may only work with MMC cards !
The two images show one the bad commands that get both a $05 answer, and the good commands with the right answer for the $41 command ($01)
See next posts please!!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit the home of pPropQL, pPropQL020 and OMU for the pPropQL/020 at omnibus.uni-freiburg.de/~rp92
Post Edited (Ale) : 6/12/2009 4:23:29 PM GMT
I generated some confusion. Firstly I tested a SD card (well, three) with a SD socket. It does not work, there is something funny with that socket.
Then I bought a MMC card and used a MMC only socket. This seemed to work (post: I downloaded propDOS...) but failed to mount because the command 55 (dec) + 0x40 = 0x77 is unknown or something like that. Command 41 (dec) is also unknown. But CMD1 (0x41) works. Why are you using CMD55/ACMD41 instead of CMD1 directly ? (I see that the commands are in dec, I saw them in another table where 0x40 was already or'd to them). The point is as it is it does not seem to be compatible with MMC cards, at least not with this "extreme memory" card I got :-(.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit the home of pPropQL, pPropQL020 and OMU for the pPropQL/020 at omnibus.uni-freiburg.de/~rp92
It's probably fine, but I discovered a newer one from 2006.
It seems to cover a lot of the same stuff, so you could compare the two if that helps.
Jim
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit the home of pPropQL, pPropQL020 and OMU for the pPropQL/020 at omnibus.uni-freiburg.de/~rp92
http://forums.parallax.com/showthread.php?p=746666
That version can handle MMC, SD, and SDHC cards.
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lonesock
Piranha are people too.
I tried the SD/SDHC driver you referenced.
It says to use this (sdspifasm_ls) in place of "sdspiqasm" in the "fsrw" routine.
I tried this, by modifying a version of fsrw. When I did this, it worked perfectly with a standard SD card (1 GB).
However, when I tried an SDHC card (8 GB), I got an abort error of -20.
When I looked in fsrw, I discovered this piece of code in the "mount" routine:
Does anyone know if there is a special version of 'fsrw' that will work correctly with this driver?
Thanks for the help. Tell me if you think I should move this to another thread.
Jim
You could partition a flash card > 2GB with multiple 2GB partitions, each of which is formatted as FAT16, except you can't under Windows, as Windows will not let you put more than one partition on a flash drive. So you could do it under Linux, but I'm not sure if Windows would read anything other than the 1st partition.
Typically cards larger than 2GB are formatted FAT32, which can handle larger partitions. The FAT32 code isn't too much more complicated than FAT16, but I think there are various reasons what FSRW does not support FAT32. 1) most people are happy with < 2GB, 2) there are licensing issues with long filename support, and 3) nobody just jumped in and added FAT32 support yet (at least I haven't [noparse][[/noparse]8^)
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lonesock
Piranha are people too.
I thought it said it could handle MMC, SD and SDHC cards. I didn't realize they had to be formatted as FAT16.
The larger ones always come formatted as FAT32.
I'll stick with the SD cards for now. I hope they keep selling them.
Jim