Shop OBEX P1 Docs P2 Docs Learn Events
shutdown procedure with i2c memory — Parallax Forums

shutdown procedure with i2c memory

Erik FriesenErik Friesen Posts: 1,071
edited 2007-12-05 21:33 in Propeller 1
I have a prop running all eight cogs that updates a i2c fram chip every second or two as a·way to keep the·last info recorded on shutdown.· I am figuring on·powering the board with 12+v through a 8v reg with a 22uf cap feeding a 3.3reg with a 22uf cap.· I will be monitoring the 12+ voltage·with a mcp3208 or·directly to a pin.··The memory·saved is approximately 12 bytes.· Is there·any way to figure my margin of time (safety) so that I am not shutdown in the middle of a write?· Why does·the prop shutdown so quick on low voltage?· Would I be best off with the boen held high or low?·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-12-05 20:48
    FRAM will write within the transfer time for a byte. At 100KHz clock, you're talking about less than 100us per byte.
    The discharge time of the power supply capacitors depends primarily on the current drain of the circuits attached to it.
    For the 8V supply, you've got about 4V of "headroom" before the 3.3V regulator loses regulating ability. Why don't you
    see if you can measure how much time it takes for the 8V supply to drop to 4V when you cut off the 12V under load?
    You'll need a couple of milliseconds to save the data plus the time to read and react to the voltage drop.

    The Prop shuts down quickly on low voltage because it's designed for operation down to 2.7V only. It only takes small
    voltages below this point for it to stop working reliably.

    Use the existing brown-out detector. You should finish an orderly shutdown way before the voltage gets to the point
    where the parts won't work properly.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-12-05 20:53
    In order to compute the time you have before shutdown, you will need to measure the current consumption of your board supplied by the regulator. I do not recommend disabling the brown-out since operating in that region can lead to corrupted execution. The amount of charge on a capacitor is provided by the equation Q=CV where Q is the charge (in coulombs), C is the capacitor's value (in farads) and V is the voltage differential. Since voltages less than 2.7V cannot be used, the useful capacity of the capacitor is much less. Given 3.3-2.7 = 0.6 Volts of headroom and your 22uF, the usable capacity is 13.2 uC. Since current is coulombs per second, to calculate the running time on the capacitor divide the capacity by the current draw. So if the current consumption is 20mA (this is a low-ball estimate), the propeller will operate for 660 us. If you need this time to be increased, substitute a larger capacitor.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2007-12-05 21:04
    Do you know what the update rate in us is on the 3208 asm routine? I have also been puzzling how to measure my 8-4 volt drop in a decent way in us or clock cycles. I am using james burrows I2c routines and I know they are a bit slower because they are written in spin but my project has all 8 cogs loaded already.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-12-05 21:33
    If you have a scope or a frequency counter, it's easy to toggle an I/O pin with every reading of the 3208 or with each byte written to the FRAM and measure the time it actually take rather than estimating it.

    You may find that other parts of your logging code are just as important. In the end, you need to know how much time it really takes to store the data,
    add a large fudge factor, and design the power supply to keep everything going long enough to do the job.
Sign In or Register to comment.