Go Down

Topic: ATtiny85, wake on WDT interrupt (Read 795 times) previous topic - next topic

Jack Christensen

Jan 09, 2013, 10:47 pm Last Edit: Jan 09, 2013, 10:58 pm by Jack Christensen Reason: 1
Based on Table 7-1 in the datasheet (attached below) I've been trying to get the WDT timer, configured for interrupt-only, to wake the MCU from power-down mode. It's not waking and I've been pulling out what hair I have left, and then I read Section 7.1.3 (also attached) and it says a WDT Reset will wake the MCU, but doesn't mention a WDT interrupt.

I've pretty much decided that Table 7-1 is misleading, but was wondering if anyone wanted to go for two out of three and offer experience or opinions ;)
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Coding Badly


I know for a fact it works on the ATtiny13 and ATtiny84.  I suspect I've also tested it with the ATtiny85; I can't imagine it not working.

Version 2 of the Tiny Core even supports using the Watchdog for millis with power-down sleeping.

If you need a code snippet or are interested in a preview of version 2 just let me know.

Did you remember to include the WDT ISR handler?

strykeroz


Did you remember to include the WDT ISR handler?
Would you still need to include an empty function as an ISR handler ?
"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

Coding Badly


Yes.  Otherwise _bad_interrupt is called which (sort of) resets the processor.

Coding Badly


This saves 18 bytes over the non-naked version...

Code: [Select]
ISR( WDT_vect, ISR_NAKED )
{
  reti();
}

Jack Christensen



I know for a fact it works on the ATtiny13 and ATtiny84.  I suspect I've also tested it with the ATtiny85; I can't imagine it not working.

Version 2 of the Tiny Core even supports using the Watchdog for millis with power-down sleeping.

If you need a code snippet or are interested in a preview of version 2 just let me know.

Did you remember to include the WDT ISR handler?


Yep, got the ISR in there, although it's empty. Appreciate the reply, sounds like I'd better have another look! Will holler if I need some example code, thanks. Cool feature for v2!!!
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Jack Christensen


I know for a fact it works on the ATtiny13 and ATtiny84.  I suspect I've also tested it with the ATtiny85; I can't imagine it not working.


Got it working just fine, thanks again. My spaghetti code got me :smiley-red:  Just so you know, you may not have a monopoly on your moniker XD
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Go Up