Shop OBEX P1 Docs P2 Docs Learn Events
How to add an SD card — Parallax Forums

How to add an SD card

lardomlardom Posts: 1,659
edited 2010-03-16 16:52 in Propeller 1
Someone please tell me how to begin. I want to add an SD card to my project so that·users can configure the machine to their preference. I want to add a setup mode. I want to use the PST to debug but I will adapt it to an LCD. Should I buy a VGA adapter to start?

Comments

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2010-03-15 02:11
    That's three consecutive sentences that start with "I want", just ease up.
    Adding an SD card is easy, even if you do breadboard it but a pcb is preferred. The SD card only requires 4 I/O. The setup mode is entirely up to you how you do it but usually small LCD displays and tiny keypads make it that little bit harder sometimes. SD, LCD, VGA we all know, but I have to scratch my head when someone says PST and the like, they are not common acronyms and perhaps something more generic should be used such as "serial terminal" perhaps.

    Some questions then:
    1) Why do you want SD, is it so you can remove it? Otherwise EEPROM holds config data fine.
    2) Why do you want VGA? What are you going to use it for?
    3) Why do you want (just repeating myself) smile.gif

    BTW, it is super easy to put a few resistors on the board for VGA. You don't even need the standard VGA connector as that is easily handled off the board by an adapter lead. This is something I do quite often.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • ElectricAyeElectricAye Posts: 4,561
    edited 2010-03-15 02:22
    Peter is correct: adding an SD card is pretty easy. My biggest anxiety was getting the SD socket, but I found a reasonably priced breakout board for the SD that comes from Sparkfun:

    www.sparkfun.com/commerce/product_info.php?products_id=204

    Parallax also sells a kit:
    www.parallax.com/StoreSearchResults/tabid/768/List/0/SortField/4/ProductID/611/Default.aspx?txtSearch=sd+card
    and
    www.parallax.com/StoreSearchResults/tabid/768/List/0/SortField/4/ProductID/597/Default.aspx?txtSearch=sd+card

    but I can't vouch for those Parallax products because I've never tried them yet.

    hope that helps,
    Mark
    smile.gif
  • lardomlardom Posts: 1,659
    edited 2010-03-15 05:29
    Thanks Peter and ElectricAye

    ·· The SD card will preserve settings. The user won't even see it.

    ···Most demo's I've seen use a VGA display. I would adapt it to the Parallax serial terminal because it·doen't require additional hardware.

    ·· Peter, Are you saying there is a way to store configuration settings without an SD card? How? That would be the best choice.

    ···How do you·put resistors on the board for VGA. I bought the connectors thinking I would wire them up. But simple is better.

    ·· ElectricAye, programming the card is my biggest anxiety. I will check out Sparkfun.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2010-03-15 05:37
  • ElectricAyeElectricAye Posts: 4,561
    edited 2010-03-15 05:40
    lardom said...
    ....
    ElectricAye, programming the card is my biggest anxiety. ....

    Check out the object in the OBEX for working with the SD cards. It's outstanding.

    obex.parallax.com/objects/92/
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2010-03-15 05:51
    The EEPROM can also be written to using the i2cobject. If say for instance you have a variable that you want to make non-volatile all you have to do is after you have updated it in RAM is to do a write to EEPROM in this manner:

    i2cobject.eewr(@variablename,variablename)

    I think eewr is one of the methods in there but either way that's what I do. What happens is that EEPROM holds the image for all the spin code and PASM code etc but of course there are the memory addresses which correspond to the variables. By writing to this address in EEPROM as it is the same address mirrored in EEPROM and RAM, you will have updated the contents of the variable so that next time it reboots or powers-up it will automatically load in the updated contents that you last wrote. So you only need to write this sometime maybe right after you update it, the loading back in again is an automatic process.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • MagIO2MagIO2 Posts: 2,243
    edited 2010-03-15 06:27
    Unless you don't need >64MB of setup-data (I guess even a 64MB MMC card will be hard to find these days), I'd also suggest to use the EEPROM. It's there already, no extra cost. You can use a 64kB or a 128kB EEPROM if you really need some extra-space. It also saves you the extra pins.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2010-03-15 07:16
    Larry, you were asking about the VGA resistors but it's all there in the datasheet with the schematic. You can use the resistor values shown (470 and 240) or you can just use 470R resistors either individually or in a resnet. The 240 and 470 are supposed to be binary weighted (half or double) for RGB luminance but close enough is good enough, you can just parallel two 470's to get a real half value of 235R. There are two 240R resistors just for the synch lines and the values there are not so critical (in case you are improvising). So you need 3x 470R and 5x 240R and I have often used more common 220R in place of the 240R. For the connector I would just cut an old modular monitor cable and terminate one end into a 6 or 8 pin header to run from the board. Connect up the shield to ground.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • lardomlardom Posts: 1,659
    edited 2010-03-15 15:00
    "Heh Heh Heh!!" lol.gif That's what giddiness sounds like when the lights finally go on in my head. Thanks everybody.
  • VaatiVaati Posts: 712
    edited 2010-03-15 21:53
    If you need an SD card adapter, I made one on Gadget Gangster. (see my signature for the link) You have to assemble it, but it's fairly straightforward... smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!

    (no longer new) SD Card Adapter·Now available!· Add extra memory to your next Propeller project with ease!
  • LeonLeon Posts: 7,620
    edited 2010-03-15 22:05
    I've got a simple DIY mini-SD card PCB design you can have. I've used it plugged it into a socket soldered on a Proto board:

    miniSD.jpg

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM

    Post Edited (Leon) : 3/15/2010 10:41:35 PM GMT
  • lardomlardom Posts: 1,659
    edited 2010-03-16 16:52
    Thanks Vaati and Leon. I'm studying everything·I can. Vaati, I noticed you have pcb terminal blocks on your variable power supply. Where can I get a supply? I ordered an SD card adapter from Parallax soon after I saw the first replies to my post. I will be studying code to learn to use it. I will also study objects·to read and write directly to eeprom which is what I really want because I think less hardware would provide fewer opportunities for things to break down.
    .
Sign In or Register to comment.