Shop OBEX P1 Docs P2 Docs Learn Events
Non-volatile storage — Parallax Forums

Non-volatile storage

jb1311jb1311 Posts: 20
edited 2005-11-18 18:41 in General Discussion
Does the SX have a way store a value when powered down? I want to be able to store some values and have the SX 'remember' them even without power. It doesn't look like it has EE memory, but maybe there is some other technique? The are calibration values that won't be available at the time the device is initially programmed.

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-11-14 19:34
    Hello,

    ·· You can always connect and external EEPROM or NVRAM device.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-11-14 19:35
    You can embed constants in your programs but you can't store nonvolatile data while the program is running -- you'd have to use an external EEPROM.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • John CoutureJohn Couture Posts: 370
    edited 2005-11-15 02:50
    Many Real Time Clocks have RAM that can be accessed. To keep accurate time and maintain the memory you can connect the RTC to a coin battery (or my favorite a 9vdc batt and a 1M ohm resistor). You communicate with the RTC / RAM using the SX's built in I2C commands.

    There are a plethora of EEPROM devices that also communicate via I2C protocol and you are mainly limited by your pocketbook.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College
  • Lord SteveLord Steve Posts: 206
    edited 2005-11-15 03:08
    The SX has built-in I2C commands?
  • ForrestForrest Posts: 1,341
    edited 2005-11-15 03:15
    SX/B has I2C commands. Connecting an I2C device to an SX processor is very simple - check the docs for SX/B.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-11-15 03:58
    john couture said...
    To keep accurate time and maintain the memory you can connect the RTC to a coin battery (or my favorite a 9vdc batt and a 1M ohm resistor).
    John, were you aware that 9V's have the worst charge capacity of standard non-coin cells? They are comprised of 6 AAAA (yes quadruple A) batteries wired in series and have ~ 1/2 the charge capacity of AAAs, take one apart and you'll see the 6 cells inside, its what I do when I need a AAAA (use to need them for my sketch pad's pen). If you need 3V to power your RTC consider either 2 AAAs or 2 N cells, they provide more bang for the buck in approximately the same space.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10

    Post Edited (Paul Baker) : 11/15/2005 4:08:18 AM GMT
  • ElectronegativityElectronegativity Posts: 311
    edited 2005-11-15 18:05
    Hmm... I have been pondering the smallest possible devices one could build with an SX20.

    Two of those AAAA batteries would put out 3V and almost 200mAH of current.

    The SX20 only draws 7.5mA at 4MHz, so I bet it would run for a long time at 32kHz.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I wonder if this wire is hot...
  • BeanBean Posts: 8,129
    edited 2005-11-15 18:47
    If you want smallest size, I would think a 3V lithium coin cell would be the smallest.
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    "SX-Video OSD module" Now available from Parallax for only·$49.95
    http://www.parallax.com/detail.asp?product_id=30015

    Product web site: www.sxvm.com

    Those that would give up freedom for security will have neither.
    ·
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-11-15 19:02
    According to the spec sheet for the SX20, with clock of 32kHz @ 3V Vdd, the current consumption would be ~175 µA. This extremely low power consumption puts it into the viable range for lithium coin cells. Chemistries: Lithium Manganese Dioxide, Lithium Thionyl Chloride and LIR, would work.

    What looks even more promising is fractional AA sizes, the ER14250 from http://www.powerstream.com·is a 3.6V 1/2 AA· Lithium Thionyl Chloride High Capacity cell, sold for $3.25 in single, $1.50 in quantities of 100. its capacity is 900mAh, continuous discharge capability of 50mA weights 9g and measures 14.5 dia x 25 mm.

    Running the SX @ 3.6V, 32kHz will up the current consumption to 275 µA, but if you use a ultra low power smt LDO regulator such as the TPS77030DBVR, you can drop the voltage supply back down to·3V with only 17 µA consumption by the regulator, resulting in·~190 µA total current, or ~4740 hours or nearly 200 days of continual operation. Plus the charts show for the expected current discharge of the particular battery, the actual capacity is roughly 1175 mAh leading to a lifetime of nearly 6200 hours or 260 days. [noparse]:)[/noparse]


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10

    Post Edited (Paul Baker) : 11/15/2005 7:08:55 PM GMT
  • ElectronegativityElectronegativity Posts: 311
    edited 2005-11-15 19:06
    Hi Bean, do you know of any rechargeable versions of those tiny coin batteries?

    I found some 9 volt NiMh batteries that charge all the way up to 9.5V and hold 270 mAH.

    If they are constructed as Paul described then I could make a tiny rechargeable 3V device with 270 mAH by using 2 of the AAAA's inside.

    I don't have a specific application in mind right now; just thinking about what is the lower size limit for an SX controlled portable device.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I wonder if this wire is hot...
  • ElectronegativityElectronegativity Posts: 311
    edited 2005-11-15 19:13
    Hi Paul, you must have been typing the same time I was.

    I looked at the battery you linked and it's 1'' long by 1/2" diameter.
    Three AAA's together would be about that size and would give 4.5V (or 3.6V for rechargeables) and something like 3000 mAH.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I wonder if this wire is hot...
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-11-15 19:14
    Rechargable 9Vs have a different chemistry and are typically internally stacked 3 rechargable lithiums which can not be diasected, believe me I tried with a hacksaw on the internal plastic casing inside the metal jacket and resulted in only getting electrolytic fluid everywhere and ruining a shirt and staining the tabletop. If you want lithium rechargables coin cells, you'll need to go with LIR, or lithium ion rechargables. Word of caution, thier capacity is nowhere near that of non-rechargable lithium cells, and take special chargers to avoid overcharging which results in leaking of electrolytic solution or explosions (small, but sprays electrolyte everywhere which is corrosive).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10

    Post Edited (Paul Baker) : 11/15/2005 7:18:17 PM GMT
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-11-15 19:15
    Yes but the 1/2 AA I showed is 3.6V itself and requires only a single cell, I was operating off the idea you wanted the longest running for the smallest size.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-11-15 19:17
    Also when serially stacking cells you don't add the capacities, its: parallel, add capacity; serial, add voltage. So the capacity would be the same as a single cell.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • ElectronegativityElectronegativity Posts: 311
    edited 2005-11-15 19:30
    Thanks Paul, you just saved me from going home and destroying one of my rechargeable 9V batteries, and maybe a shirt as well. [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I wonder if this wire is hot...
  • BeanBean Posts: 8,129
    edited 2005-11-15 20:38
    Running the SX @ 3.6V, 32kHz will up the current consumption to 275 µA, but if you use a ultra low power smt LDO regulator such as the TPS77030DBVR, you can drop the voltage supply back down to·3V with only 17 µA consumption by the regulator, resulting in·~190 µA total current, or ~4740 hours or nearly 200 days of continual operation. Plus the charts show for the expected current discharge of the particular battery, the actual capacity is roughly 1175 mAh leading to a lifetime of nearly 6200 hours or 260 days. [noparse]:)[/noparse]
    Paul,
    · Can't you just put a diode in series to drop the voltage down to 3.0V ? I realize it won't be regulated.
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    "SX-Video OSD module" Now available from Parallax for only·$49.95
    http://www.parallax.com/detail.asp?product_id=30015

    Product web site: www.sxvm.com

    Those that would give up freedom for security will have neither.
    ·
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-11-15 20:59
    hmmm, Im not sure what the power consumption the diode would have (dusting off the semiconductor physics section of my mind) there is the hole-electron recombination effect which accounts for some current consumption, but I don't know how much that is, J to I comparisons also complicate the issue. Also the LDO aspect of the voltage regulator being ~35mV means the battery could be run down to it's last drop, something not capable with a diode. But the idea does have merit for its size and simplicity and would be an interesting comparison.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2005-11-15 23:24
    Paul,

    keep it simple and stupid:

    Assuming the voltage drop across the diode is 0.6 Volt, and the current is 275 µA, the power "heating" up the diode is 165 µW. No need to worry about hole-electron recombination effects, etc. smile.gif .

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    Günther
  • BeanBean Posts: 8,129
    edited 2005-11-15 23:46
    Guenther,
    The whole idea of using the diode is to drop the voltage so the current goes down. Paul said at 3 volts the SX would draw 175 uA. So that would be 175 uA * 0.6V = 105 uW for the diode and 175 uA * 3.0 V= 525 uW for the SX for a total of 630 uW.
    Without the diode the power would be 275 uA * 3.6 V = 990 uW, so with the diode the circuit uses 36% less power.

    That is how I calculate it anyway. Maybe I'm wrong... No I thought I was wrong once, but I was mistaken [noparse];)[/noparse]

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    "SX-Video OSD module" Now available from Parallax for only·$49.95
    http://www.parallax.com/detail.asp?product_id=30015

    Product web site: www.sxvm.com

    Those that would give up freedom for security will have neither.
    ·
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2005-11-16 00:55
    Bean,

    for my "KISS" calculation, I just took the 275 µA, Paul mentioned. I agree, the SX is not simply a resistor, i.e. power consumption vs supply voltage is not a linear function at all.

    I support your idea using a diode (or two in series) for reducing the supply voltage instead of using an LDO regulator. The regulator would dissipate similar power as the diode would do for dropping down the voltage plus some additional power "eaten" (i.e. converted to heat) by the regulator's internal circuity.

    Nevertheless, this all is a bit of guesswork. Although the SX datasheets present various diagrams showing the relationship between supply voltage, Idd drawn, and clock frequencies, it would be an idea to analyze this in more detail by measuring some "real" SXes under various conditions. I'd really like to do it if I'd only had the time...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    Günther
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-11-16 03:44
    Id have to dig the book out, too late, too lazy at the moment. But I dont think power consuption in diodes follows ohms law, the voltage potential drop is due to overcoming the built-in "no mans land" (forget the technical term ?inversion zone?) caused by the p-n junction, though perhaps the hot electons interacting with the semiconductor lattice has an ohmic equivalent effect, so I just don't know, and I don't specifically know if we covered that in class, though that was one of two courses I really struggled with in grad school, so I may just be blocking it out. But I do agree, nothing beats real world testing.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • dkemppaidkemppai Posts: 315
    edited 2005-11-18 16:26
    Paul Baker said...
    : Lithium Manganese Dioxide, Lithium Thionyl Chloride and LIR, would work.

    hmmm, Lithium Thionyl Chloride, now there's some buck for your bang!·AA cells are·about $50
    each. On top of that, without an internal fuse in the cell, a short circuit can cause them to explode,
    even with an internal fuse, they can detonate if shaken violently enough (1000's of required)
    Oh, yeah, don't forget that the FAA won't let you put them on a plane, period! Means UPS, or FEDEX
    or DHL ground shipping only... They do have a really nice flat discharge curve, but it's probably better to stick with the other lithium cells...

    Power in a diode is equil to V*I period. Delta V changes with I, so·if you have a V-I cirve, you can figure it out·(or set it up and measure it).·Delta V also changes with·temperature, so knowing the ambient operating temperature will help you be more accurate.
    Although, I agree that with a good LDO, you can probably get·more life out of the·cell, because the delta V will change to maintain the output voltage, whereas the output voltage with the diode will follow the discharge curve, less the diode voltage, so you will get to an unusable voltage at the SX, when the battery would still run it...

    -Dan


    Post Edited (dkemppai) : 11/18/2005 4:39:09 PM GMT
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-11-18 16:45
    Thanks for the heads up on problems with LTCs, the AA price you quote seems out of whack considering the $3.25 per 1/2 AA price I found in single quantities, just buy two and place them in parallel to gain the same capacity. The short circuit problem can be all but eliminated by proper design of the power connections, a pico fuse (just in case) and use of an overcurrent protection LDO (meaning the diode method shouldn't be used), this ultralow current application shouldn't be a serious risk unless you do something really bone-headed. Im assuming that your (1000's of required) quote means g force, droping a cell from 3 feet is in the hundreds of g's so to generate that kind of shock you'd need to be in very rapid deccelleration such as a high speed auto accident, and I think a cell exploding would be the least of your worries at that point. Maybe they should be outlawed alltogether for national security reasons. A potential terrorist could pass them off as standard alkalines then short circuit them on a plane, perhaps not as deadly as HDX but would certainly cause considerable mayhem when cruising at 5000 feet.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • John CoutureJohn Couture Posts: 370
    edited 2005-11-18 18:32
    (grin) while you guys are debating and poring over datasheets, I just break out a box of cheap 9vdc batteries with my 1m ohm resistor. By the time I work my way through the 1000 batteries for $1 from CostCo, you guys will probably have it figured out! LOL

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College
  • ElectronegativityElectronegativity Posts: 311
    edited 2005-11-18 18:41
    You spent $1000 on 9V batteries? shocked.gif

    I don't understand about the 1M resistor, seems like you would only get 9 microamps out of the battery that way.
    Admittedly it would last a long time, but I don't think there's much you could do with it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I wonder if this wire is hot...
Sign In or Register to comment.