Power consumption during EEPROM write

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A have a tiny low power project using ATTiny13A running from the internal 128kHz oscillator. I would like to save a few bytes to the EEPROM when power fails. I have tried to find the current consumption during the EEPROM write to size a capacitor accordingly but managed to find only questions, not answers. Does anyone know how much it can be?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Does the datasheet not give any statement on that?

With that clock speed you might need a long time before writing is done, would be more worried about that.

 

practical check...

without power fail...

make a pin low right before you start writing to the eeprom, and make it high again when you are done.

that will give you time.

Next you can add a little series resistor in the power circuit and measure the voltage drop over it while you are writing. That will give you the current.

Then just add a multiplier to make sure you are safe and you know what you got to do to get it done.

Do not forget to enable brownout detection, as else you might end-up ruining your eeprom contents when things might fail.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


meslomp wrote:
With that clock speed you might need a long time before writing is done,

Hmmm.  I guess I have to poke at that model.  Some models do not have timing that depends on the system clock speed, right?  Extra microseconds of overhead would be dwarfed by the milliseconds of [erase/]write time.

 

[edit]

The calibrated Oscillator is used to time the EEPROM accesses. Make sure the Oscillator fre-quency is within the requirements described in “OSCCAL – Oscillator Calibration Register” on

page 27.

I guess I don't know what that means, in the context of this thread.  But seeing the table

...I'd guess it is the nominal 9.6MHz, adjusted by OSCCAL.

 

'32A:

and a perhaps more "modern" model, '88 family:

 

 

 

 

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

Last Edited: Thu. Jun 11, 2020 - 03:21 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 I have tried to find the current consumption during the EEPROM write to size a capacitor

What about your leds, motors, temperature sensor, etc?  All of those will also drain your cap (maybe immediately).  Power the AVR through a Schottky diode and  cap---so the cap powers ONLY the AVR.  Turn off any leds, outputs so the AVR isn't driving anything during this time. 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

On one of my projects I wanted to save settings to eeprom on an ATtiny2313A, also running on the internal 128 kHz RC oscillator with very limited power available. Found that I couldn't write to the eeprom, suspected the low clock rate. I wasn't looking at power consumption at the time.

 

From the tiny2313A data sheet: 

5.3   Data Memory (EEPROM)

...

The internal 8MHz oscillator is used to time EEPROM operations.

 

I had to prove which was not explicitly stated - That eeprom write was not possible with the internal 128 kHz oscillator.

 

An external SPI eeprom was the solution.

 

edit:  The project operated at 5V with a 500uF bulk electrolytic along with several MLC 0.1uF bypass caps.

Last Edited: Thu. Jun 11, 2020 - 09:21 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The Calibrated RC oscillator is used fro timing the EEPROM write. It is possible to write EEPROM with any clock source.

I did some quick measurements of a single ATTiny, writing random data to random locations of the EEPROM. The current consumption does not depend on which data are written or if it is write or erase operation. Surprisingly the current consumption increases nearly linearly with supply voltage (I expected the on-chip charge pump needs to draw more current from lower supply to generate needed programming voltage). It is about 1mA/V of supply voltage (i.e. 5mA@5V and just 2mA@2V).

As a byproduct I have found interesting feature: the "atomic" EEPROM write operation is probably done as erase followed by write internally: in the middle of the programming the current consumption drops to the "baseline" briefly.