Shop OBEX P1 Docs P2 Docs Learn Events
MicroSD Cards that work with Parallax boards — Parallax Forums

MicroSD Cards that work with Parallax boards

GenetixGenetix Posts: 1,754
edited 2015-03-27 20:27 in Propeller 1
I am confused about MicroSD support on Parallax boards. Andy says in his SD Card tutorial on Learn not to use anything larger than 2GB but Parallax seems to be the only one who still sells that size. Other stores sell much larger modules and the only reference I can find in Parallax documentation is that the modules can range from 1 to 32GB. I tried searching the forums but I couldn't find any postings regarding modules that work.

Is there a list of MicroSD cards that work with Propeller boards?

Comments

  • msrobotsmsrobots Posts: 3,709
    edited 2015-03-26 18:57
    It depends.

    FSRW first just supported FAT16, but FAT32 is added already.

    Kye's Fat_Engine supports both also.

    The difference between smaller SD cards and bigger ones is the addressing modes available. Smaller cards can directly address and access bytes on the card, bigger ones can just address 512 byte sectors.

    So to change a byte you need to read a sector, change the byte and rewrite the sector. Usually the driver does that for you.

    Since you are talking about the Learn site I assume you want to use C or C++. I am not familiar there. But my guess is that PropGCC is able to handle FAT32. So bigger cards should be no problem.

    I have very good success with the Scandisk brand.

    Enjoy!

    Mike
  • SRLMSRLM Posts: 5,045
    edited 2015-03-26 19:16
    I use a variant of FSRW, and haven't had any problem with any of the cards that I've used (mostly cheap ones). I've used up to 16GB.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2015-03-26 19:59
    Genetix wrote: »
    I am confused about MicroSD support on Parallax boards. Andy says in his SD Card tutorial on Learn not to use anything larger than 2GB but Parallax seems to be the only one who still sells that size. Other stores sell much larger modules and the only reference I can find in Parallax documentation is that the modules can range from 1 to 32GB. I tried searching the forums but I couldn't find any postings regarding modules that work.

    Is there a list of MicroSD cards that work with Propeller boards?

    It is extremely difficult to get 2GB cards anymore and the difference between them and higher capacities is a little more than memory. All the new cards are SDHC and these have a different initialization procedure from the old SD cards. Also as mentioned they are sector not byte addressable, that's 512 bytes/sector. So a 32-bit address will select one of 4 billion sectors or 2 TB max for 512 byte sectors.

    So I would recommend using cards that are readily available (and cheap), so use the common SDHC cards and ones from 4GB to 32GB are quite cheap although even 4GB are harder to get now. If the driver you use supports FAT32 then it will support SDHC for sure.
  • RaymanRayman Posts: 14,652
    edited 2015-03-26 20:45
    It used to be that FSRW could only address cards up to 2 GB, but that was a long time ago...

    I'd bet that the PropGCC drivers can also work with the bigger cards now.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2015-03-26 21:52
    Uh oh, I may be in trouble. A couple of my students lost the uSD cards that came with their ActivityBots, so I went to Costco and got the cheapest ones I could find: 32GB. I hope the latest FSRW Spin driver works with them.

    -Phil
  • DavidZemonDavidZemon Posts: 2,973
    edited 2015-03-27 08:00
    PropWare's SD & FAT classes also support SDHC. Actually... they only support SDHC lol. Maybe I'll fix that some day, but probably not since they're so uncommon.
  • mindrobotsmindrobots Posts: 6,506
    edited 2015-03-27 08:09
    Uh oh, I may be in trouble. A couple of my students lost the uSD cards that came with their ActivityBots, so I went to Costco and got the cheapest ones I could find: 32GB. I hope the latest FSRW Spin driver works with them.

    -Phil

    Phil,

    I have a handful of 2GB cards I bought off of Ebay a while back. The ones I've used so far have worked fine. If you want/need, I can toss a couple in the mail your direction "for the children". It's covered under my "supporting education" grant! :D

    P.S. If the kids have cats, the cats are probably the culprits. My cats seem to think micro-SD cards great toys until they lose them!
  • GenetixGenetix Posts: 1,754
    edited 2015-03-27 10:01
    Where do I get the version of FSRW that supports SDHC?
  • Dave HeinDave Hein Posts: 6,347
    edited 2015-03-27 10:05
    It's in the OBEX at http://obex.parallax.com/object/15 .
  • prof_brainoprof_braino Posts: 4,313
    edited 2015-03-27 10:26
    If you are not limited to Windows OS compatible, there are more options. For example if you intend to use the micro SD as "internal to the prop system".

    In PropFORTH, we access the blocks directly, A "File" is just a series of blocks associated with a name. There is no garabage collection, etc; Because there is no FAT/FAT32 overhead, is is very fast. To "delete" a file, we can unlink the last file created, or just make another file with the same name, and the newest version is the only one visible. An SD card has so much space that we do not often run out of room. There's plenty of space for application code, configuration data, and logging. I have a logger running for over a year, one record every ten seconds, and I think there is still room left (although I've already moved on to other projects, I just left it running. )

    In this context, we have not found any card that does NOT work, so far.
  • wmosscropwmosscrop Posts: 409
    edited 2015-03-27 10:50
    It is extremely difficult to get 2GB cards anymore

    At retail, yes. And I'm cheap and hate to buy 100x the capacity I need for a project's card. I've even "rescued" the actual workings from a couple of SD cards where the outer casing broke (why do they use such cheap plastic anyway?)

    To get back on topic, I've bought a few used 512MB/1GB cards off of ebay and have not had any problems with them. Of course, it's a gamble, and you may get a bad card.

    Walter
  • DavidZemonDavidZemon Posts: 2,973
    edited 2015-03-27 11:25
    In PropFORTH, we access the blocks directly, A "File" is just a series of blocks associated with a name.

    That's interesting. Just out of curiosity, does PropFORTH contain support for a FAT filesystem when needed?
  • Cluso99Cluso99 Posts: 18,069
    edited 2015-03-27 13:49
    I am not sure of what GCC uses as a basis for SD access.

    FYI
    I do know that Kye's FATEngine works with SanDisk 8GB SDHC Ultra microSD cards.
    There was discussions about some brands not working with various drivers.
    The general consensus was that SanDisk was the preferred brand as they seemed to always work.
  • Dave HeinDave Hein Posts: 6,347
    edited 2015-03-27 15:03
    I believe the driver used in PropGCC will work with SD and SDHC cards. It supports FAT16 and FAT32, and it should support any size card that's available. I wonder if anyone ever uses more than a few mega-bytes on an SD card on the Prop.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2015-03-27 16:33
    wmosscrop wrote: »
    At retail, yes. And I'm cheap and hate to buy 100x the capacity I need for a project's card. I've even "rescued" the actual workings from a couple of SD cards where the outer casing broke (why do they use such cheap plastic anyway?)

    To get back on topic, I've bought a few used 512MB/1GB cards off of ebay and have not had any problems with them. Of course, it's a gamble, and you may get a bad card.

    Walter

    I still have a stack of these 2GB Elite Pro SD cards that I bought a hundred of off ebay or somewhere ages ago to sample. Paid less than $2 for them, maybe $1.80 IIRC. Well I had problems with them so I stopped using them, however more recently I needed some 2GB for an older product and having scoured everywhere I couldn't find any in a reasonable price range. The ones that you can get now cost more than a 16GB SDHC. So I decided to look at my Elite Pro rubbish and tested the cards thoroughly with my Tachyon powered Prop.

    Well I couldn't really fault it but it seems that some were not FAT16 formatted as they normally are from the factory, so I went through the lot of them and on the PC I formatted them and tested them out by writing a 2GB file and they all passed. So I ended up with a whole pile of 2GB SD cards and to think that a lot of them were effectively discarded because I didn't trust them for anything but giving someone files on SD rather than having to burn a CD/DVD (ugh!).

    So Walter how do you sleep at night knowing that you saved a couple of bucks and wasted all that time instead fixing and looking?
    I expect you'd probably say "well" :)
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2015-03-27 16:43
    Dave Hein wrote: »
    I believe the driver used in PropGCC will work with SD and SDHC cards. It supports FAT16 and FAT32, and it should support any size card that's available. I wonder if anyone ever uses more than a few mega-bytes on an SD card on the Prop.

    Easily use more than a few megabytes when you are running a network server with images, pdfs etc. Of course my various wave file players use many gigabytes.

    As regards to standard SD and FAT16 support, I can't see the need for it. If you did then you may as well provide support for floppy disks.

    On a related topic I remember clicking onto element14's webpage and one of the "specials" they had was for an SD card socket, nothing special really, just a plain old socket. Then I clicked on the pricing, now, that was special. To think, for 100 off I would get the much better price of $4.69 AUD (each)!!!!!!!
    I have about 2,000 here from 4UCON that I picked up for around 20c each. So for roughly the same cost as 2,000 connectors I could get 100 from element14, what are they thinking???
  • Dave HeinDave Hein Posts: 6,347
    edited 2015-03-27 17:17
    As regards to standard SD and FAT16 support, I can't see the need for it. If you did then you may as well provide support for floppy disks.
    As long as you have control over the formatting of the SD card, FAT32 is sufficient. However, if you need to read files from an SD that's been formatted as FAT16, then you would obviously need to support it. I think floppy disks use FAT12, which is included in the PropGCC driver, but it's commented out to save code space.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2015-03-27 17:39
    Dave Hein wrote: »
    As long as you have control over the formatting of the SD card, FAT32 is sufficient. However, if you need to read files from an SD that's been formatted as FAT16, then you would obviously need to support it. I think floppy disks use FAT12, which is included in the PropGCC driver, but it's commented out to save code space.

    That bit about floppies was a joke though but it did emphasize the redundancy of supporting such methods. If we were making a PC then yes we would need to support FAT16 but the Prop is an embedded system and since 2GB cards are now redundant like cassette tapes and floppies then there is no need to provide support. Anything is possible but I'd rather not waste anymore precious resources and effort than necessary for something that I would never use, just because someone might scour the net for a second-hand 2GB card and wants to use that is not justifiable.

    Now seeing you have support for FAT12 then maybe someone would like to interface a floppy - directly to the Prop of course, no FDC chip cheating! :)
  • DavidZemonDavidZemon Posts: 2,973
    edited 2015-03-27 19:35
    Funny you speak such nonsense. PropWare's FAT classes were made in just such a way so that interfacing with a floppy disk would be very simple! :D All that's needed is the driver code to read and write blocks - the FAT classes have a single dependency on a "PropWare::BlockStorage" device which could very easily be a floppy disk, SD card or DVD
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2015-03-27 20:17
    Funny you speak such nonsense. PropWare's FAT classes were made in just such a way so that interfacing with a floppy disk would be very simple! :D All that's needed is the driver code to read and write blocks - the FAT classes have a single dependency on a "PropWare::BlockStorage" device which could very easily be a floppy disk, SD card or DVD

    MFM timing in C code? Like to see that! Stepper stuff would be easy.

    Tachyon treats a block storage device such as SD or serial Flash as virtual memory, randomly addressable that is and then whatever filesystem is implemented such as the current FAT32 although for serial Flash I will use a much simpler file system.
  • DavidZemonDavidZemon Posts: 2,973
    edited 2015-03-27 20:27
    MFM timing? Way over my head :P. I just know someone in another thread mentioned floppies are block storage devices.

    The PropWare::BlockStorage device is an abstract class with a few virtual functions that need to be implemented. Whatever is behind them could be simple (like SD) or not (like MFM timing for floppies I guess?)
    virtual ErrorCode read_data_block (uint32_t address, uint8_t buf[]) = 0;
    virtual ErrorCode write_data_block (uint32_t address, const uint8_t dat[]) const = 0;
    

    Having the card accessible as virtual memory makes absolute sense when you have complete control over your environment, like Tachyon & PropFORTH. It is, as far as I can tell, essentially an OS. So the SD card is just an extension of RAM - page data. But that's what XMM memory models are for in PropGCC, not PropWare's SD & FAT classes.
Sign In or Register to comment.