Shop OBEX P1 Docs P2 Docs Learn Events
femto basic can´t read or write sd cards — Parallax Forums

femto basic can´t read or write sd cards

propelleruser999propelleruser999 Posts: 39
edited 2008-02-03 18:22 in Propeller 1
hi,
i have installed femto basic in order to test my SD card interface(VGA_Demo_wPrtScrn.spin also has a SD Card Interface, but my screen responded with unsupported·screen resolution ). basic itself works fine. however SD-card support is telling me always "Can´t mount SD card".
inside the fsrw.mount there are a lot of more detailed error codes available, however femtobasic does only display this message.
i have scoped my pins during access to the SD-card . DO and DI stay always high, CLK, shortly shows some high frequency pulses( 8 or 9 negative pulse bust sequences; without a datalogger it is nearly impossible to count the bursts and the number of them ), CS shows one longer pulse.
How can i get to the more detailed codes inside fsrw.mount or can get them displayed·within femtobasic ? i have tried several SD cards. one of them (128mb) doesnt work in my camera but is accessible under XP, 4 others (work both in my digicam and under XP).
Maybe its only the format of the SD-Card . I choosed FAT from FAT,FAT32,NTFS under Windows XPSP2. FAT16 was not separately selectable.

best regards, René

Comments

  • rjo_rjo_ Posts: 1,825
    edited 2008-02-02 16:54
    the recommended format is to use FAT with 32k as your ?sector? size. has to be a hardware problem. I've seen all kinds of recommended setups... the one I like the best is a direct connection... Oldbitcollector has tried it and it works fine for him... but that doesn't mean that it works will all cards. It's possible to just solder up a solution... but it is pretty fragile.

    By the way 9 means "not" in German... which gives you a triple negative in your username[noparse]:)[/noparse]

    Rich
  • Mike GreenMike Green Posts: 23,101
    edited 2008-02-02 17:14
    Download Rokiki's SD card routines from the Object Exchange. Read the documentation and try the test programs which use a TV for a monitor.

    As Rich suggested, you either have a hardware (connection) problem or a card format problem. The SD card routines check several values on the SD card's boot block and, if they're not what is expected, report that they can't mount the card. Choosing FAT for formatting should work, but you may need to select a proper cluster size. Rokicki's documentation discusses this.
  • RaymanRayman Posts: 14,162
    edited 2008-02-02 17:24
    I have the table of what cluster size you should use here:
    http://www.rayslogic.com/propeller/Programming/SD_Card/SD_Card.htm
  • propelleruser999propelleruser999 Posts: 39
    edited 2008-02-02 18:21
    i appreciate that many responses.

    however, this weekend is Fastnacht in Germany, which will last until tuesday night. If , i´m however able to do some work on my propeller, i will post my results.

    many thanks for your help so far

    best regards, René
  • Mike GreenMike Green Posts: 23,101
    edited 2008-02-02 18:40
    Fastnacht sounds like much more fun than debugging SD card access with a Propeller. The Propeller and the SD card will still be there on Wednesday.
  • propelleruser999propelleruser999 Posts: 39
    edited 2008-02-03 18:22
    I have double checked the wiring on my self-built SD-card adapter.. I have also added 2 22kohm resistors to unused pins 8 and 9 of the SD card (some people mean they are needed,others say, that it works completely without any pullup resistors).
    I have also formatted a new SD Card (256MB) with a clustersize of 32K. How can i proove,that it is now really FAT16 ?
    XP tells me its FAT. During formating it also only offers me FAT, FAT32 or NTFS. Is the cluster size really that,what determines FAT16 ?
    Then i installed Tomas Rokickis FAT16 routines. Now i get more error info
    With the adapter and SD card installed i get error -13; however,there is no hardcoded abort returncode -13,the only abort with flexible returncode is in pflushbuf. If i remove the whole SD-Card-adapter i get error code -20; which means „not a fat 16 volume“, which could make sense, since it is the first check in the „mount“ procedure.

    By the way: i have to admit some faults, i made during building the adapter. I had not recognized that pin 8 is above pin 1 on the SD card;so all wires were soldered one pin up. This caused a short on my propeller board, since VDD was now brigded to VSS. The card also got hot. This card is no more in use. I have checked my prototypeboard by installing a LED-bar to pins 0 to 7 and running a (modified for pins 0 to 7) blinker2.spin (page 124 in Propeller manual). The board responds ok.

    On http:\\www.rayslogic.com i got some good ideas, how to do better next time. If i cannot find the fault , i will have to scrap the adapter (too much soldered on it)and built or buy a new one.

    However, any further ideas are welcome.

    Regards, Ren
Sign In or Register to comment.