Shop OBEX P1 Docs P2 Docs Learn Events
SD card impersonation — Parallax Forums

SD card impersonation

RegorRegor Posts: 19
edited 2006-12-07 19:26 in General Discussion
Does anyone have experience on making a Basic Stamp or Propeller emulate an SD card?

I recently received a digital picture frame with an SD card slot. I'm interested in hooking up a device that would look like an SD card with a bunch of .bmp files to the picture frame. The microcontroller would be used to implement the SD card methods and generate·the bitmaps to display·the data. An example of this would be to create a bitmap based on the current temperature or other information I could RF over.

I haven't been able to find any hardware that would effectively be an adapter with one end I could put into the SD card socket and the other end some type of header I could use to attach to a breadboard. I was also searching for some software examples for the SD card's Card Interface controller's implementation but again came up empty.

Any advice or examples would be appreciated.

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-12-05 22:48
    A Stamp can't, by itself, "impersonate" an SD card.·· You can take a look at this and see if it will further your ends -- www.sddatalogger.com
  • RegorRegor Posts: 19
    edited 2006-12-06 00:00
    The www.sddatalogger.com stuff looks like a good way to read/write to an SD card but doesn't look like it fits my needs.

    What are the reasons the stamp by itself can't impersonate an SD card?
  • ForrestForrest Posts: 1,341
    edited 2006-12-06 00:26
    For starters, a BS2 has 26 bytes of RAM.
  • David BDavid B Posts: 592
    edited 2006-12-06 01:54
    Well, I got a propeller to read files from an SD card.

    I understand what you're proposing, and I don't know why it couldn't be done, except that SD cards are supposed to be fast, down at the bit level. You might get timeouts if your gadget can't provide data at a 20 mHz bit rate.

    You'd just need to make a gadget that responds like a card. Basically, it would have to correctly initialize, present internal card parameters if and when requested, then provide a generic 512-byte sector read. Then it would have to emulate a FAT filesystem built from those sectors.

    If you're serious about doing this, I'd suggest starting by building an SD reader. I don't see how anyone could possibly build such a thing when the only debugging available was to stick it into the picture frame and see if pictures appeared.

    But with your own reader, as you develop your SD emulator, you can get feedback for how it is responding. Plus by building the reader you'll become much more familiar with the general SD card interface.

    Search the propeller forum for "SD" and you should find my code. It's not polished code; it's just there to help others get started at reading SD cards. But it works for me, and I believe that at least one other person has also gotten my code to run on a propeller.

    Good luck!

    David
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-12-06 05:03
    When you say a bunch of .bmp files, how many bytes do you really want?

    At the end of the day, I suspect nothing really would be a cost effective replacement for the actual SD card.
    The first limitation is you need a large enough RAM [noparse][[/noparse]my SDcards go to 1/2 a gigabyte and there are bigger],
    The second is you need to mimic the SPI or proprietary serial interface.
    The third is that you need to configure it to fit into the very small slot or hack into the device someother way.
    The fourth is that you need to provide power for all the additional items.

    I suspect you are up against a much better technologic solution.

    I suggest you learn more about creating your own SDcard reader for a variety of projects rather than trying to recreate the actual card. The knowledge gained would be much more useful as other projects could use the extra ram.

    I bought one of Bean's Dataloggers to get started.· You could always used the SDcard that comes with it in the picture frame when not in use elsewhere.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "If you want more fiber, eat the package.· Not enough?· Eat the manual."········
    ···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

    Post Edited (Kramer) : 12/6/2006 1:55:53 PM GMT
  • GadgetmanGadgetman Posts: 2,436
    edited 2006-12-06 12:58
    Another option...

    Use a real SD-card, but stick a bi-directional buffer between it and the Pictureframe.
    Then attach a Propeller to the SD-card side of the buffer and let it control the state of the buffer.
    Maybe even use a DOS-on-A-Chip system.
    (Then you could theoretically use a BS2)

    Whenever you need to update the SD-card, you set the buffer to lock the frame out, update the card, and switch the buffer to allow the frame to read the card again.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't visit my new website...
  • RegorRegor Posts: 19
    edited 2006-12-07 19:26
    I'm not trying to reinvent an SD card what I'm trying to do is dynamically update the information displayed on the picture frame.

    The original idea was that the .bmp file bits would be generated based on the requested memory location. The FAT table would be hardcoded to have a number of files at specific locations.

    Gadgetman's idea is better to just take the SD card offline and update it. This would also have the benefit of not having to worry about what information the picture frame has cached or when it is safe to switch how a bitmap is rendered. Only problem with this is that while the SD card is offline the picture frame goes to a default screen and when back online it resets to it defaults.

    For now I'll just stick with manually updateing the SD card via sneakernet.

    Thanks everyone for their input.
Sign In or Register to comment.