Are shure you go to pick RUN and then enter "compmgmt.msc" for formatting in WXP.
I missed that in my start with the SDcard routines. I tried the format which is found in the explorer and that one dont give you the choice to change the sector size.
I also made the mistake to try with some MMC cards, which is the predessesors to the Secure Digital cards.
Are you shure the 16 Mb card mentioned earlier is a SD and not a MMC?
FYI I have used 22K as pullup all the time, No problem
Hi All,
Here is the error handler I put together for use with the fsrw_speed.spin
I got both the SD Flash Media Card and the Micro SD working just fine.
-jay-
-=-
PUB main | x
Num.Init
x := \start
ErrorTrap( x )
-=-
Recently I got a SD/MMC Breakout card from Spark Fun Electronics.
The· pin outs od this card does not agreed with pinouts shown above.
Could anyone please show me how to connect this Breakout card to the demo board?
Okay, I just got my Spark Fun SD/MMC Breakout card yesterday. I've added the "Propeller Accessories Kit" (VGA, mouse and keyboard) to my Protoboard. No TV out though. How do I make this work using VGA? Has anyone modified the SD card code for VGA yet or is everyone with an SD card using a TV for output using a demo board?
To my knowledge there should be no conflict between the SD card and the VGA (at least, on the protoboard or the demo board).
Why do you think there's a conflict?
Cyberbound,
FemtoBasic will work with either a TV display or a VGA display and uses the SD card code. There's a precompiled version in the posted archive (http://forums.parallax.com/showthread.php?p=634092) for VGA. The Demo Board version uses pins 0-3 for the SD card. The Protoboard version uses pins 8-11. Otherwise they're the same. You can also read and write to the extra 32K of EEPROM.
rokicki, no... I didn't say there was a conflict.· I just wasn't finding any example code that used VGA.· Sorry if there was any confusion.· I'm just looking for the simplest way to implement reading and writing to the SD card using spin on my proto board. Thanks again for your efforts on this.· Adding an SD card to the prop is one of the reasons I moved to the prop in the first place.··
rokicki said...
To my knowledge there should be no conflict between the SD card and the VGA (at least, on the protoboard or the demo board).
Why do you think there's a conflict?
Mike, I have to admit I haven't touched FemtoBasic yet.· I'll have to take a look.· THANKS!
Mike Green said...
Cyberbound,
FemtoBasic will work with either a TV display or a VGA display and uses the SD card code. There's a precompiled version in the posted archive (http://forums.parallax.com/showthread.php?p=634092) for VGA. The Demo Board version uses pins 0-3 for the SD card. The Protoboard version uses pins 8-11. Otherwise they're the same. You can also read and write to the extra 32K of EEPROM.
I have started an Eagle library for a Digikey part number HR845CT-ND cut tape $4.97 no min. It is a pricey part in small quantities, but I spent a half an hour and still couldn't locate a PCB layout for the mouser part mentioned in this thread.
The part I found is SMT but would be easy to hand solder. Are the switches used at all for card detect and lock? I didn't think so, so I left out the connections, but the pads are there. It would be a neat feature in code where when the card is inserted, the Prop could do something when inserted, like auto-update the software etc.
Below is the library and some pics. I need to proof this further.
Here's the Alps data sheet for the·Mouser SD Socket. May not be a current inventory item for Alps since I could not find it on their web site. It's also on order according to www.mouser.com inventory status.
Almost all the posts i've read about using the SD cards with the propeller seem to focus on the regular size SD cards. Has anyone used the Micro SD cards directly with the Propeller and FemtoBASIC? In particular SparkFun has their MicroSD adapters with the following signals:
CS
DI
VCC
SCK
GND
DO
CD
It appears that all the lines (CS, DI, SCK, DO, and CD) should have pull-ups to 3.3v The remaining connections would be:
P0 - DO
P1 - CLK
P2 - DI
P3 - CS
GND - gound
VCC - 3.3v
Robert,
I've bought one of the MicroSD adapters and a Micro SD card, but haven't hooked it up yet. Tomas indicated that he has gotten SD cards to work without the pullups, but I plan to use them anyway. Your connections are the ones I'm going to use myself. It should work fine.
I was able to connect my own SD cards using my "Junkshop Floppy" interface without the pullups. I've ordered some of those microSD adapters with the idea of soldering some pins directly to the adapter and using microSD cards.
Oldbitcollector
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The comments and code above are proof that a million monkeys with a million propeller chips *could* write Shakespeare!
can anyone explain to me how to use the "brwlong(w, v)" methode for writing longs to the sd card. Sorry for the beginer question but i'm not realy sure what i'm suposed to pass to the method as "w" and "v" ? anyone have a quick example or explanation of writing longs to the sd card? thanks!
I just wanted to say thank you to rokicki. This code that you have created is amazing. I have been using it to create a number of applications. See thread:
Just wondering, is there any way to update the date on the files manually? I saw an application that used a clock DIP connected to the Propeller to do it but I was wondering if there was a way around that.
Comments
Are shure you go to pick RUN and then enter "compmgmt.msc" for formatting in WXP.
I missed that in my start with the SDcard routines. I tried the format which is found in the explorer and that one dont give you the choice to change the sector size.
I also made the mistake to try with some MMC cards, which is the predessesors to the Secure Digital cards.
Are you shure the 16 Mb card mentioned earlier is a SD and not a MMC?
FYI I have used 22K as pullup all the time, No problem
Regards Goran
Here is the error handler I put together for use with the fsrw_speed.spin
I got both the SD Flash Media Card and the Micro SD working just fine.
-jay-
-=-
PUB main | x
Num.Init
x := \start
ErrorTrap( x )
-=-
-=-
PUB ErrorTrap( ErrNum )
' Error Handler/Trap reporting
'
term.str( string( "ERROR " ) )
term.dec( ErrNum )
term.str( string( " : " ) )
'
IF( ErrNum =< -21 )
IF( ErrNum == -21 )
term.str( string( "bad bytes per sector" ) )
ELSEIF( ErrNum == -22 )
term.str( string( "bad sectors per cluster" ) )
ELSEIF( ErrNum == -23 )
term.str( string( "not two FATs" ) )
ELSEIF( ErrNum == -24 )
term.str( string( "bad FAT signature" ) )
ELSEIF( ErrNum == -25 )
term.str( string( "too many clusters" ) )
ELSEIF( ErrNum == -26 )
term.str( string( "bad cluster number" ) )
ELSEIF( ErrNum == -27 )
term.str( string( "not open for writing" ) )
ELSEIF( ErrNum == -28 )
term.str( string( "???" ) )
ELSEIF( ErrNum == -29 )
term.str( string( "???" ) )
ELSEIF( ErrNum == -30 )
term.str( string( "???" ) )
ELSEIF( ErrNum == -86 )
term.str( string( "metadata event updated - conditionally" ) )
ELSEIF( ErrNum =< -11 )
IF( ErrNum == -11 )
term.str( string( "???" ) )
ELSEIF( ErrNum == -12 )
term.str( string( "???" ) )
ELSEIF( ErrNum == -13 )
term.str( string( "SD card removed from socket" ) )
ELSEIF( ErrNum == -14 )
term.str( string( "???" ) )
ELSEIF( ErrNum == -15 )
term.str( string( "???" ) )
ELSEIF( ErrNum == -16 )
term.str( string( "???" ) )
ELSEIF( ErrNum == -17 )
term.str( string( "???" ) )
ELSEIF( ErrNum == -18 )
term.str( string( "???" ) )
ELSEIF( ErrNum == -19 )
term.str( string( "???" ) )
ELSEIF( ErrNum == -20 )
term.str( string( "not a fat16 volume" ) )
ELSEIF( ErrNum =< -1 )
IF( ErrNum == -1 )
term.str( string( "???" ) )
ELSEIF( ErrNum == -2 )
term.str( string( "no empty directory entry" ) )
ELSEIF( ErrNum == -3 )
term.str( string( "bad argument" ) )
ELSEIF( ErrNum == -4 )
term.str( string( "???" ) )
ELSEIF( ErrNum == -5 )
term.str( string( "???" ) )
ELSEIF( ErrNum == -6 )
term.str( string( "no permission to write" ) )
ELSEIF( ErrNum == -7 )
term.str( string( "EOF repeat while following chain" ) )
ELSEIF( ErrNum == -8 )
term.str( string( "???" ) )
ELSEIF( ErrNum == -9 )
term.str( string( "bad cluster value" ) )
ELSEIF( ErrNum == -10 )
term.str( string( "???" ) )
ELSE
IF( ErrNum == 0 )
term.str( string( "test completed with no errors." ) )
ELSE
term.str( string( "unknown error ???" ) )
term.out( 13 )
return
-=-
The· pin outs od this card does not agreed with pinouts shown above.
Could anyone please show me how to connect this Breakout card to the demo board?
http://forums.parallax.com/showthread.php?p=634499
for convenience.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Mike
Why do you think there's a conflict?
FemtoBasic will work with either a TV display or a VGA display and uses the SD card code. There's a precompiled version in the posted archive (http://forums.parallax.com/showthread.php?p=634092) for VGA. The Demo Board version uses pins 0-3 for the SD card. The Protoboard version uses pins 8-11. Otherwise they're the same. You can also read and write to the extra 32K of EEPROM.
The part I found is SMT but would be easy to hand solder. Are the switches used at all for card detect and lock? I didn't think so, so I left out the connections, but the pads are there. It would be a neat feature in code where when the card is inserted, the Prop could do something when inserted, like auto-update the software etc.
Below is the library and some pics. I need to proof this further.
www.hirose.co.jp/cataloge_hp/e60900048.pdf
Post Edited (originator) : 3/9/2007 11:00:17 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Mike
CS
DI
VCC
SCK
GND
DO
CD
It appears that all the lines (CS, DI, SCK, DO, and CD) should have pull-ups to 3.3v The remaining connections would be:
P0 - DO
P1 - CLK
P2 - DI
P3 - CS
GND - gound
VCC - 3.3v
Does that look right?
Robert
I've bought one of the MicroSD adapters and a Micro SD card, but haven't hooked it up yet. Tomas indicated that he has gotten SD cards to work without the pullups, but I plan to use them anyway. Your connections are the ones I'm going to use myself. It should work fine.
great for me.
Your connections look good. You should have no trouble.
Oldbitcollector
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The comments and code above are proof that a million monkeys with a million propeller chips *could* write Shakespeare!
Owen
To write a long you can use
pwrite(@var, 4)
This writes the long as four bytes in "native" order (whatever order it is
stored at in the propeller itself).
i followed the instructions and tried to make this work on a breadboard.
I keep geting the message
Mounting.
Returned from start
-13
what is this error code?
sd not connected
http://forums.parallax.com/forums/default.aspx?f=25&m=339479
Keep up the good coding.
Just wondering, is there any way to update the date on the files manually? I saw an application that used a clock DIP connected to the Propeller to do it but I was wondering if there was a way around that.
Pullups shouldn't be necessary.
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
I am a new user and have successfully tested this code.
I used my camera card (full of photos) with good results: AData 2GB SD (FAT16)
I also tried another card, but did not work. It is those selling on eBay from China/HK:
SanDisk micro-SD 8GB SD-HC (FAT32)
Someone else has tried with a card like that?
Thanks.
The old code you have does not support FAT32 nor SDHC.
The new code does:
http://forums.parallax.com/forums/default.aspx?f=25&m=368563
It should be pretty close to a drop-in replacement.
I think I'm using the latest version fsrw26.
I used the program serial_terminal.spin
The result:
mount [noparse][[/noparse]ENTER]
mount returned
And the program stops working (until reset again the Propeller).
Apparently the reader (microSD-USB) often corrupt values, but the computer reads the memory without problems.
TestDisk was very helpful.
I hope this report serves to improve the code.
Thank you.