Pages: [1]   Go Down
Author Topic: ATtiny85, wake on WDT interrupt  (Read 680 times)
0 Members and 1 Guest are viewing this topic.
Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 93
Posts: 3965
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-wink


* table 7-1.png (31.16 KB, 678x324 - viewed 27 times.)

* section 7.1.3.png (20.62 KB, 854x163 - viewed 22 times.)
« Last Edit: January 09, 2013, 04:58:07 pm by Jack Christensen » Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 199
Posts: 12768
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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?
Logged

Brisbane, Australia
Online Online
Edison Member
*
Karma: 33
Posts: 1121
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Did you remember to include the WDT ISR handler?
Would you still need to include an empty function as an ISR handler ?
Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 199
Posts: 12768
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 199
Posts: 12768
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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

Code:
ISR( WDT_vect, ISR_NAKED )
{
  reti();
}
Logged

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 93
Posts: 3965
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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!!!
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 93
Posts: 3965
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-lol
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Pages: [1]   Go Up
Jump to: