Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: Watch dog funnies again

2004-09-17 by Mark Butcher

Hi Owen

Chance your watchdog routine as follows:

void watchdogfeed(void){
 __disable_interrupt();
 WDFEED=0xAA;
 WDFEED=0x55;
 __enable_interrupt();
}

This will almost certainly cure your problem. The reason is that the
feed sequence should not be interrupted - if you read the data sheet
carefully it is explained that an interrupted feed sequence will be
interpreted as an error and the processor resets.

If you call the watchdog without protection more frequently the chance
of an interrupt arriving between the two instructions increases and
would explain your observations.

If this works you can buy me a beer one day.

Cheers

Mark Butcher

www.mjbc.ch




--- In lpc2000@yahoogroups.com, Owen Mooney <ojm@s...> wrote:
> Well - I am still having watch dog problems on the 2106 !!
> 
> I implimented the code as below. If I didn't call watchdogfeed I would
> get a regular reset every 20 seconds (though I calculated it at about
> 1/4 seconds with 14Mhz Xtal)
> 
> I modified the code to call watchdogfeed ever 20 micro seconds or so (in
> my main loop) and the processor started resetting erratically every 10
> seconds or so!
> 
> Calling watchdogfeed every second has stopped this and the processor
> APPEARS to be operating properly. BUT !!! if calling watchdogfeed has a
> 1 in 1000000 chance of resetting the processor, have I just reduced my
> random resets to once per 10 days or so !
> 
> Does anyone have any knowlege of this?
> 
> Owen Mooney
> 
> 
> void watchdogfeed(void){
> WDFEED=0xAA;
> WDFEED=0x55;
> }
> 
> int main(void) {
> 
> ...
> 
> WDTC = 0x1000000;
> WDMOD= 0x03;
> WDFEED=0xAA;
> WDFEED=0x55;
> 
> ...
> 
> }

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.