Shop OBEX P1 Docs P2 Docs Learn Events
Power consumption estimate of SD card usage with fsrw — Parallax Forums

Power consumption estimate of SD card usage with fsrw

ElectricAyeElectricAye Posts: 4,561
edited 2008-10-16 20:14 in Propeller 1
Hi all,

I'm trying to compile an energy budget for my Propeller application and I was wondering if anyone knows how to predict how much power an SD card will consume for a given number of bytes writing at a given rate. I'm only writing to the card using the SD card object, fsrw, and never reading from it. I'm writing about 100 bytes of data every 2 seconds. Anyone know any rough rules of thumb or quick way to guesstimate this? An estimate plus or minus 30 milliamps should be good enough.

many thanks,
Mark

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-16 18:59
    The power demands of SD cards varies widely from manufacturer to manufacturer and from SD card model to SD card model. It's impossible to make any kind of estimate because of the wide variation. Pick a specific manufacturer and model and download the datasheet to get an estimate for that SD card.
  • rokickirokicki Posts: 1,000
    edited 2008-10-16 19:00
    I would start by measuring it; beyond that, it's hard to tell; there are many variables.

    The qasm driver has some (minor) code to reduce the power consumption just a bit (instead of spinning
    furiously on a memory location waiting for a command, it waitcnt()'s some amount of time before
    checking again); this way you don't always have a full-speed cog "running".

    But at a two-second interval, you may save energy overall to close the file and stop the fsrw object,
    and then remount. I'm not sure about this; it would need to be measured.

    Another option is to make a minor change to the sdspiqasm driver to increase the waitcnt on the
    polling loop to a significantly larger value (even, say, 50ms or some such) if you don't care too
    much about the latency; this may give more savings than shutting down and remounting each
    time.

    As for the card itself, it's anyone's guess; the cards vary widely. I believe almost all enter into a
    low-power mode automatically after some interval idle, but this would have to be tested.

    The tricky thing is the power consumption is not going to be a nice easy 30ma or anything like that;
    it's going to be a complex curve as you go through the various phases of writing data, with probably
    significant spikes but mostly very low usage. You'll need to come up with a reasonable way to
    measure the actual energy use rather than any particular current consumption.

    Your best bet might just be to tweak sdspiqasm as I describe above (significantly increase the
    polling interval), figure out what else you can do to lower consumption during your two second
    intervals, and then just run it for a while and see how long it takes to drain a battery. But it could
    be a long time; sd cards are generally pretty low-power.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2008-10-16 20:14
    Thanks, Mike and rokicki,

    One spec sheet stated that the SD card used: Read <33mA; Write <35mA; Standby <100µA
    So if I take those as an upper bound, I should be okay. I plan on using a table top power supply rather than batteries, so I guess I don't have to be as concerned as I had first thought.

    thanks again,
    Mark


    smile.gif
Sign In or Register to comment.