Go Down

Topic: Atmega328p Power Saving Techniques (Read 6726 times) previous topic - next topic

fungus


Are you sure?  The datasheet makes a point of saying that the ADC must be disabled (ADCSRA) before being shutdown (PRR).  You commented that disabling the ADC doesn't seem to do anything, but it should make a noticeable difference.


Bingo!

By putting the "power_all_disable()" at the end of setup() the voltage across my 10K resistor went from 2.2V to 68mV(!)

That means power consumption is 6.8uA ... and that's exactly where it should be for "5V power down with Watchdog".

Damn datasheets, you have to read *every* word.

++karma for you.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

fungus

It all seems to be working now so I can get on with my project. :)

As an aside...I just tried measuring the current directly with a cheapo multimeter on the 20uA scale instead of using the resistor method.

Result? It works just fine - gives exactly the same reading as with the resistor.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

fungus



You've misunderstood my reply, I didn't say anything about the programmer. What have you done to ensure that none of the I/O pins is a floating input?

I set them to input with pullup resistors.


I found that enabling pullups while sleeping might use a LOT more power.

If there's a switch attached to a pin and the switch is held closed it uses over 0.1mA because of the pullup resistor. This could happen if a device with buttons on it is stuffed in a bag/pocket/whatever.

Maybe this is why they say to enable pullups on unused pins.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Coding Badly

If there's a switch attached to a pin and the switch is held closed it uses over 0.1mA because of the pullup resistor. This could happen if a device with buttons on it is stuffed in a bag/pocket/whatever.


Udo Klein demonstrated a way to reduce that to nearly zero.  I believe he used a combination of pin-change interrupts, polling, and disabling/enabling the pull-up.  He posted a fairly detailed explanation.  If you have trouble finding the posts, let me know.

Go Up