Pages: 1 ... 3 4 [5]   Go Down
Author Topic: Atmega328p Power Saving Techniques  (Read 4360 times)
0 Members and 1 Guest are viewing this topic.
Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 118
Posts: 4554
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

No, I don't answer questions sent in private messages...

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 118
Posts: 4554
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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.
Logged

No, I don't answer questions sent in private messages...

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 118
Posts: 4554
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

No, I don't answer questions sent in private messages...

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12283
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: 1 ... 3 4 [5]   Go Up
Jump to: