Power saving and interrupt #1151
Replies: 8 comments 1 reply
-
This is no complete code, so who knows the problem is in the part you did not show. |
Beta Was this translation helpful? Give feedback.
-
this is the complete code
|
Beta Was this translation helpful? Give feedback.
-
Some thoughts. Disabling all pins first and then attaching an interrupt to one of them and you observe that PA5 can still wakeup the MCU? Could PIN_PA5 be floating (nu pullup active) and therefore trigger the interrupt randomly, increasing power consumption? I never used attachinterrupt() on these parts, but I notice that no interrupt flag is cleared in the onPinWakeup() ISR. does "attachinterrupt" take care of that? If not the ISR would keep firing. |
Beta Was this translation helpful? Give feedback.
-
with or without INPUT_PULLUP, consumption is the same, this is not a full complete code, i just need to solve sleep consumption, not wakeup problems :-). |
Beta Was this translation helpful? Give feedback.
-
Wild guess, but you might be hit by an Errata. Many newer chips got their Errata updated with following Problem:
even though the assembler files seems to be alright, the power consumption seems to correspond to the IDLE sleep.
with
just to make sure? |
Beta Was this translation helpful? Give feedback.
-
Same result. the problem is attachInterrupt(), not sleep mode setting. |
Beta Was this translation helpful? Give feedback.
-
just try to replace attachInterrupt() by only
|
Beta Was this translation helpful? Give feedback.
-
I have found the problem; just a big hole in documentation (or exemple) ....
|
Beta Was this translation helpful? Give feedback.
-
I changed my cards to go from ATtiny85 to ATtiny3216 thinking that in sleep mode I would have an identical consumption, except this is not the case when using the interrupt wake-up (4µA vs 450µA).
I have a very simple code:
deactivate all the inputs
set the interrupt wake-up
go to sleep
I would like to point out that the Tiny has nothing connected, so there is no external consumption.
With this code i have 450µA, if i comment attachInterrupt line, i have under 1 µA
Have you an idea to solve my problem, or is it a Tiny3216 bug
Beta Was this translation helpful? Give feedback.
All reactions