Re: Watchdog in LPC2000

Started by Mike Harrison November 27, 2007
On Tue, 27 Nov 2007 16:39:38 +0545, you wrote:

>Hi all,
> I am trying to use the watchdog in LPC2103. The watchdog reset
>is being invoked regularly even when the time period is of 2 seconds. I have
>reset the watchdog in the super loop & there is a timer interrupt that gets
>called quite regularly. The code seems to run fine on simulation. If
>anybody could pass on their experience it would be a great help.

The main thing to know is there is an error in the documentation.
It says that any access in the WDT's I/O space between the 2 feed operations causes an immediate
reset. (which is reasonably sensible, or would be if it actually worked like that)
However what it actually does is cause a reset on an access in ANY I/O space (Except maybe FIO, I
think) inbetween the feed operations. This is totally dumb as it effectively means you effectively
MUST disable interrupts between the 2 feed operations. Although this is often not a big deal ( as
long as you remember to do it...), it does compromise worst-case interrupt latency.

Another thing to know is that if using a JTAG debugger, you need to disable the WDT or it will
misbehave badly during debugging. AFAIK there is no way on the 2103 for the program code to detect
whether or not it's in debug mode and selectively enable the WDT or not. So you have to remember to
re-enable it after debugging. Which you inevitably won't always...
On the 213x parts, this is possible, as there is a bit in PINSEL2 that tells you whether the JTAG
pins are configured as JTAG or I/O.

An Engineer's Guide to the LPC2100 Series