Deep sleep functionalities in ATTINY 1607 - explanation for wake up cycle using button interrupt - example 😅 #456
-
Hello all. The task at hand:
Basically I want to have repetition of :
I'm using / kind of have to use So the ways I have first tried, declaring them as method 1:
method 1 issues:The awakening of the uC happens only first time button press and then it doesn't work. Basically next time it skips the method 2:
method 2 issues:This works but I'm not sure why only CHANGE interrupt is usable for waking up the uC and also not sure if there are other better ways of doing so! 😶 Avoiding
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Only pins 2 and 6 in each port are "fully asynchronous" (as PB2 or PB6 - those would be arduino pins 9 or 5, or PIN_PB2 and PIN_PB6. and able to wake the part from sleep modes where the main clock is turned off. They are marked with a symbol on the pinout charts, and this is described at some length in the page on interrupts and covered "fully" in 16.3.3, (though the identities of the fully async pins is over in note 2 of table 5.1, the most important table in the entire datasheet - like every other part released since the 2016 revolution, including all of the parts supported by megaTinyCore The usual way that change would be used is exactly the same as it was on classic AVRs, you read the pin immediately after it wakes you, and do your debouncing then. and don't do anything until they let go of the button (the same thing happens if the interrupt is LOW level triggered, by default.) If you play with most consumer electronics, you will find that they work the same way - buttons take effect when you finally let go of them, and if you hold a button down with a rock or something, the battery gets drained significantly faster than if no button was pressed (and this would be the case even if it weren't for the internal pullups, What it looks like you want instead of delay is a "sleep for X time" type function, which is on the list of features for the sleep library that I haven't gotten to write yet. I realize that there is a huge amount of demand for this, but I've only been on vacation for 2 days, I haven't gotten to it yet and megatinycore is not next in line for major work (sorry guys - ATTinyCore has been waiting longer) for a big update. On your closing notes 1, 2: On point 3: |
Beta Was this translation helpful? Give feedback.
-
And sorry that got cut off, I was saying a discord had been discussaed, but I didn't think it was a priority what with usnow having this. |
Beta Was this translation helpful? Give feedback.
And sorry that got cut off, I was saying a discord had been discussaed, but I didn't think it was a priority what with usnow having this.