Too high power consumption of ATMega in Power-down

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

Hi,

I would like to make low power project (<10uA average) and use ATMega for it. During the first test it had higher consumption than expected. So I removed code and components to find what eats the extra current. I ended up with this code:

int main(void) {
	WDTCSR=(1<<WDCE)|(1<<WDE);
	WDTCSR=0;
	SMCR=(1<<SM1)|(1<<SE);
	sleep_cpu();
}

and nothing except for decoupling caps on power pins. I have 2 ATMega328p (from China) and both eat 19uA@5V. I have ATMega48V (also from China) which consumes "only" 6uA "running" the same code. Do you know why? I tried enable pull-ups on all pins, disable Comparator, and disable everything in PRR. But it made no difference (as expected). I also double checked that BOD is disabled  .

I have DIP chips in solderless breadboard and measure the current consumption by DMM if it could explain why I measured higher consumption. Or is it just caused by poor chips from China? I also tried to measure consumption with the chip removed and got 0 - so no leakage through caps or breadboard.

Do you see what I am doing wrong?

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

What is the CPU frequency for both devices?

 

JIm

 

EDIT:

From teh datasheet:

 

 

The mega328:

 

Those numbers seem to match pretty close to yours.  BUT when you look at teh graphs:

 

 

Mega48:

 

 

It would appear that your Watchdog Timer is not being disabled

 

 

If you want a career with a known path - become an undertaker. Dead people don't sue! - Kartman

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

Last Edited: Wed. Sep 13, 2017 - 07:55 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

8MHz: internal RC oscillator without prescaler.

 

EDIT:

jgmdesign wrote:

Those numbers seem to match pretty close to yours.

 

I measured 19uA at room temperature which is a lot more than 0.1uA (typical) and 2uA (maximum) over -40 to +85°C temp range. I know it is at 3V but when you look at typical characteristics there shouldn't be such large difference.

Last Edited: Wed. Sep 13, 2017 - 07:52 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Smajdalf wrote:
I have DIP chips in solderless breadboard and measure the current consumption by DMM if it could explain why I measured higher consumption.

Breadboard is always iffy in these types of situations.

 

--  We use decent Fluke meters, and still it is "interesting" when measuring low uA numbers.  For example, if you take your 18uA setup (or whatever), then switch the meter leads and test again--what reading do you get?  IME it wouldn't be unusual to see +/- 10 difference.

 

--  On your breadboard setup, do you have all Vcc and Gnd pairs, including AVcc, properly connected and decoupled?

 

--  What is the clock source for your AVR?

 

--  The title says "powerdown"...now you are going to make me go to the datasheet to see what SM1 is.  Why don't you use the facilities from the toolchain?

 

-- Speaking of toolchain, what optimization settings are used?  Is the watchdog in fact enabled with a fuse setting?  Is that the proper sequence to turn it off?  Is the 4-cycle limitation met?

 

-- Is the BOD brown-out detector enabled?

 

-- ???  I see a mention of PRR, but no code in your test program.  Similarly, I see no ACD. 

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.

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

theusch wrote:
-- We use decent Fluke meters, and still it is "interesting" when measuring low uA numbers.

If you have access to a few megaohm resistors and a battery, you should be able to do a sanity check on the meter readings.

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.

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

To address some of your points:

There is no change when changing leads of DMM (except for sign).

I tried to measure voltage drop over 100k resistor - about 2V. (I shorted it until the chip went to sleep and then removed jumper).

BOD is disabled (power consumption would be much higher with it according to Datasheet).

Watchdog fuse is not programmed and Watchdog is disabled - enabling it increases consumption by about 4 uA.

It should be power down sleep.

Clock is internal RC oscillator - not so important in power down sleep (consumption is high and then drop when the chip goes to sleep).

I don't know if it is properly decoupled. I have one 100nF ceramic cap on each side of the chip in the hole closest to the chip's legs "connecting" GND and (A)Vcc on the respective side.

I posted minimal "working" code - I also tried to add PRR and ACD and it did no difference. But since all clocks are stopped in power down sleep it should make no difference anyway.

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

I also tried to add PRR and ACD and it did no difference. But since all clocks are stopped in power down sleep it should make no difference anyway.

Incorrect.  Modules which remain powered continue to draw power even when all clocks are stopped.

 

 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

joeymorin wrote:

I also tried to add PRR and ACD and it did no difference. But since all clocks are stopped in power down sleep it should make no difference anyway.

Incorrect.  Modules which remain powered continue to draw power even when all clocks are stopped.

 

 


My Datasheet says in PRR feature description:
"Module shutdown can be used in Idle mode and Active mode to significantly reduce the overall power consumption. In all other sleep modes, the clock is already stopped."

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

It also says:

Resources used by the peripheral when stopping the clock will remain occupied

 

There are many things to consider when trying to minimise power consumption.  They are detailed in the section titled "Minimizing Power Consumption".  Have you addressed them all?

  • ADC
  • AC
  • BOD
  • VBG
  • WDT
  • GPIO pins
  • OCD

 

Have you confirmed that the device is in fact going to sleep?  How have you done this?  Have you confirmed that the sleep mode you thing you have set is actually being initiated?  How have you determined this?

 

I'd suggest programming CKOUT and confirming that there is no clock output from CLKO/PB0.

Or is it just caused by poor chips from China

Tell us more about these 'chips from China'.  How have you determined their country of origin?  And how would that make a difference?  Are they counterfeit?  If so, how have you determined that.  Counterfeit or QC reject chips are a reality of the industry, but if you've sourced your chips from a reputable source, you should be contacting them.

 

The m328 should show a current consumption of about 100 nA in power down mode, and your m48 should show the same, so the 6 uA you're seeing from m48 is about 60 times more than you should be seeing.  Something else is going on, either in your test code, in your circuit, or in your measurements.

 

The analog comparator draws about 70 uA at 5V.  It is enabled by default.

 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

Last Edited: Thu. Sep 14, 2017 - 05:39 AM