 |
Thanks to Thomas Rokicki (forum user "rokicki"), we can easily interface
to a Secure Digital flash memory card for mass storage. His original
post is
here.
You can download his code from the
Object Exchange.
|
 |
Mike Green used this code as part of "Femto
Basic", which reads and writes data and programs to the SD Card (as well
as running "Basic"). |
 |
There are two cheap ways to connect an SD card to a breadboard:
 |
Get a Mini or Micro SD card. These usually come with an
adapter to full size SD card. You can solder directly to this
adapter to make the connections. Here, I've soldered to a uSD card
to full size SD card adapter:
 |
It is important to prewet both wires and SD card to minimize
melting! |
 |
Note that only pins 1..7 only really need to be connected!
|
|
 |
Get a full size surface mount connector and solder it to a single
row pin header like this: |
 |
 |
Note: If you stick the pin header up the connector, like I
did above, just make sure that your connector doesn't have a metal
edge on the bottom that shorts out some pins (I had to bend some
metal away from the pins to get one working...). |
|
|
 |
The better way is to buy an SD card adapter...
 |
|
 |
Or, many vendors sell surface mount connectors
|
|
 |
Here's the pinout for the SD card and connections to Propeller:
|
 |
Rokicki's Object comes with two programs "sdrw_test" and "fsrw_speed"
ready to use to test your setup.
 |
Note: To use VGA instead of TV with demo board, as in the
above photo, just change:
 | term: "tv_text" to
term: "vga_text" |
 | term.start(12) to
term.start(16) |
|
 |
Also, note that the speed test takes several seconds to complete and
the time indication may come out negative... I got this with a 1
GB Lexar SD card.
 |
"Writing 2M took -1598624256" , "Reading 2M took
477277616"
|
|
 |
Also, be aware that you must format your SD card so that it comes
out being FAT16. Here's a table from Rokicki that says what
cluster size range you can pick (my Lexar card came formatted
correctly):
 | Card Size min max
4M 512 512
8M 512 1K
16M 512 2K
32M 512 4K
64M 1K 8K
128M 2K 16K
256M 4K 32K
512M 8K 32K
1G 16K 32K
2G 32K 32K
|
|
|