Attiny 404 is consuming 9mA during sleep mode

Hi,

I'm using ATtiny404 microcontroller and programming the controller via Arduino nano using UPDI pin and jtag2updi programmer.
I'm trying to put the ATtiny404 in to sleep mode by using the below functions.

set_sleep_mode(SLEEP_MODE_PWR_DOWN);
sleep_cpu();
sleep_enable();

After putting in sleep mode still getting power consumption of 9mA ,Now i want to reduce the power consumption when its in sleep mode.i'm using a button interrupt for sleep wake up.

You are going to have to provide much more information so that anyone on the forum can help you. Read the forum guide, in the sticky post at the top of most forum sections, for ideas about what you need to provide.

1 Like

Indeed!

How do you make the measurement?

Is this an Arduino sketch, or some "bare metal" code?

What else is connected to the AVR when you make the measurement - are you sure it's the AVR that's pulling (all) the current?

Post your schematic, and show the measurement point.

Be sure to disconnect your programmer when measuring...

Do you have the debugging fuse enabled?

Is that the correct order?

https://www.nongnu.org/avr-libc/user-manual/group__avr__sleep.html

See also the ATtiny404 datasheet - section on SLPCTRL - Sleep Controller

Don't forget to disable all peripherals not needed during sleep...

1 Like

You have to supply the entire code (or a minimal example which demonstrates the problem) .
Common problems resulting in very high current consumption in sleep mode are:

  1. not correctly putting the device into sleep mode.
  2. it prematurely waking before the measurement of current consumption was made.
  3. failing to understand that entering sleep mode does not change the status of the pins, that is an output pin may continue to power something.

So you don't know if it is the attiny that is consuming the 9mA, you know only that the whole circuit is consuming 9mA.

Try measuring the current flowing into Vdd pin of the attiny with multimeter.

1 Like

Please give details - is that "Sensor 1"?

Your "schematic" is too low resolution - hard to read the text.

No. Light dependent resistor is sensor 2, placed in white LED section.

Right - and how were we supposed to guess that from that "schematic" ?

It doesn't show how the LDR gets connected - presumably is pulls the SENSOR2 line up to VBAT ?

Still no details of the LDR.

Sorry for this.

Actually the LDR Sensor and LED's are placed 2nd PCB and all circuitry is present in the schematic which is been shared previously. All LED's and LDR is connected to the J1 connector which is FPC connector and in the 2nd board there are only LED's and LDR are connected through one more FPC connector and both the connectors are connected via 6pin FPC cable.

Attiny is consuming 3mA at the VDD pin as the 3.3V supply is given directly to the VDD pin of the Attiny.

After disconnecting the power from the board to the Attiny only board is consuming 9mA.

I'm confused. The attiny consumes more current when it is disconnected from the rest of the circuit than when it is connected?

1 Like

I am going to place my chips on

  1. OP is failing to ensure that all pins are in a defined state before going to sleep. Some people say the classics are just as bad. I think they're full of it. Floating pins trash power efficiency.
  2. OP's programming procedure is not correctly exiting UPDI mode, disconnect from power after upload. short the (now not connected) Vdd and supply pins to discharge all the caps on the board to make sure you get a POR when you next connect power. Then connect power, and measure current.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.