Shop OBEX P1 Docs P2 Docs Learn Events
Guesstimated max SD card throughput with Propeller? — Parallax Forums

Guesstimated max SD card throughput with Propeller?

Lord SteveLord Steve Posts: 206
edited 2008-10-07 05:44 in Propeller 1
What are some guesses or actual empirical data about the maximum bytes per second which can be read from a 170x SD card via SPI on the Propeller reading just raw sector data in 512-byte chunks (NO file format)?· I'm hoping at least·8 Megabits per second.

Thanks for any info.

·

Comments

  • rokickirokicki Posts: 1,000
    edited 2008-10-05 05:43
    I think you can get 8 megabits/sec just for raw reads. Of course, the real problem is *using* that data, not just reading it.

    You may have to unroll a loop a bit, do a 32-bit read-at-a-time using two instructions per read bit and then a WRLONG.
    You will have to ensure your overhead though is minimal.
  • JavalinJavalin Posts: 892
    edited 2008-10-06 13:44
    I get 512bytes in 2-3ms from mine (sanDisk microSD 2gb). This is in ASM obviously - using single sector read's. The write time is the same.

    J
  • Lord SteveLord Steve Posts: 206
    edited 2008-10-06 14:47
    Javalin said...
    I get 512bytes in 2-3ms from mine ...
    That's only about 2 megabits per second.· If 1x = 150,000 bits per second,·that speed is akin to 13x.· That seems like really bad performance to me.· I would think there's either a slow card or a slow driver or both.

    Which driver are you using?· Do you know the speed rating of your particular card?
    ·
  • JavalinJavalin Posts: 892
    edited 2008-10-06 14:55
    The driver is home grown and fairly basic. I don't know the speed rating on the card - its very ample for me. You could improve this with block reads and writes.

    Additionally I'd guess the 8megabits rokicki is quoting is using more than the 2 I/O lines available on the micro SD - in which case you'd definatly improve that.

    Say at 5ms per 1k thats 200k per second?

    James
  • Lord SteveLord Steve Posts: 206
    edited 2008-10-06 16:03
    Javalin said...
    Additionally I'd guess the 8megabits rokicki is quoting is using more than the 2 I/O lines available on the micro SD
    I believe Rokiki was assuming SPI communication.· Both Wikipedia and the SD spec mention read speeds in excess of 25 megabits per second via SPI.· SPI mode is the mode I'm interested in anyway.
  • JavalinJavalin Posts: 892
    edited 2008-10-06 16:40
    Steve,

    That is SPI comms. I was taking the CLK & CS as granted. What I mean is that on some cards you have 2 IO (cmd/dat) and some 4, and 8 - so with the parallisum you'd get more data back quicker

    james
  • Lord SteveLord Steve Posts: 206
    edited 2008-10-06 16:52
    I see.· To use the additional IO lines one must use a different communication protocol.· My current understanding is that that protocol is kinda ugly and hairy to implement.

    If anyone knows more about that method of interfacing to the SD cards, I would like to know more.· Thanks.
  • JavalinJavalin Posts: 892
    edited 2008-10-06 16:54
    >My current understanding is that that protocol is kinda ugly and hairy to implement
    yeah it gets more interesting - but is a LOT faster as you say

    J
  • rokickirokicki Posts: 1,000
    edited 2008-10-06 17:49
    Yeah, I was talking just SPI. And like I said, this assumes that you really reduce the overhead, so you're just reading
    block after block after block. Indeed, you may have to use multiblock reads. But I am fairly sure, on the prop, using
    just SPI, you should be able to get a megabyte a second into hub RAM. The limiter here is the instruction rate on the
    prop (to generate clock, read bits, and set the bits correctly in your output word, and get that data into the HUB.)
  • Lord SteveLord Steve Posts: 206
    edited 2008-10-06 22:30
    It may be time to crank out an actual SD-protocol object.· That way the burst speed can be (way) faster than 8 megabits per second and thereby reduce the ratio of overhead processing time to data transfer time.

    Has anyone implemented the SD protocol (as opposed to SPI) to read SD cards?

    Thanks.
    ·
  • rokickirokicki Posts: 1,000
    edited 2008-10-06 23:19
    I'm fine with someone *else* doing this, but I am wary of the legalities of distribution or use. This is the primary reason I have
    not implemented it yet.

    I think you will find right now the bulk of time is in overhead, not data transfer, so improving the various overhead parts would
    make more impact anyway. For instance, right now the low-level routines use WRBYTE/RDBYTE because they cannot be certain
    the buffer is 32-bit aligned. And there are other sources of overhead as well.

    And finally, that's pretty fast data transfer for an 20 MIPS box. What sort of application do you have in mind that can
    profitably use that data?
  • Lord SteveLord Steve Posts: 206
    edited 2008-10-07 05:44
    The Rokikinator said...
    What sort of application do you have in mind that can profitably use that data?
    Basically, video streaming.
Sign In or Register to comment.