Pages: [1]   Go Down
Author Topic: Bootloader should clear the watchdog enable bit  (Read 549 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 0
Posts: 203
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The bootloader should clear the watchdog enable bit, if the fuse hasn't forced it on. This allows sketches to force a reset in software by turning on the watchdog timer and then ignoring it. Very handy if you can't stick your hand where the reset button is.

As long as watchdog code is being touched in the bootloader, it should probably also do a WDR instruction while it loops waiting for characters to keep the timer from going off if it was forced on by the fuses.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

any news/comments etc on this topic?

i would like to use the watchdog to reset the arduinobt by software (send a command per bt/uart to enable the watchdog/softresetting bevor calling avrdude to program).

(and maybe later to wake it up from sleep modes...)

but i think, that i would brick it, if i use this method with the default arduino bt bootloader.  :/
Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 267
dinosaur cork
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

All this could lead to some useful commands in the Arduino language too, since we're trying to build an easy-to-use language for beginners.

Proposed:

ResetBoard()
SetWDT(pin,  time, (HIGH/LOW/CHANGE))     // lets user setup the WDT to reset the board if it doesn't see activity on a pin within a certain time frame.
ClearWDT()
« Last Edit: December 23, 2007, 04:39:19 pm by paulb » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

*bump*
Logged

0
Offline Offline
God Member
*****
Karma: 1
Posts: 513
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hmm... unless that code is running on another machine I'm afraid:
"ResetBoard()
SetWDT(pin,  time, (HIGH/LOW/CHANGE))     // lets user setup the WDT to reset the board if it doesn't see activity on a pin within a certain time frame.
ClearWDT()  
Back to top  "


will become
ResetBoard()
.
.
.
ResetBoard()
.
.
.
ResetBoard()
.
.
.
ResetBoard()
.
.
.
Logged

Pages: [1]   Go Up
Jump to: