Hi
We just tested the same code(with some minor modification for
blinking the LED on the evaluation board) on LPC2124 and it worked
fine. There was a Watchdog reset and the code ran again. The chip
could recover after watchdog reset.The system clock used is 14.745MHz.
We are unable to reproduce the same problem you are seeing at your
end.
Here is the code:
#include"LPC21xx.h"
int main(void)
{
int i,k;
IO0DIR = 0x40;
IO0CLR = 0x40;
/* Ground the pins for a few seconds*/
for (i = 20000000; --i >= 0;)
{
continue;
}
WDTC = 20000000;
WDMOD = 0x03;
WDFEED = 0xaa;
WDFEED = 0x55;
// Toggle until the watchdog reset triggers
for (;;)
{
for(i=0;i<15000;i++)
{
IO0SET=0x40;
}
for(k=0;k<15000;k++)
{
IO0CLR=0x40;
}
}
}
Philips_apps
--- In lpc2000@yahoogroups.com, "bobbruce000" <bobbruce000@y...>
wrote:
> --- In lpc2000@yahoogroups.com, "philips_apps" <philips_apps@y...>
wrote:
> > What LPC2000 part are you using? Is it a 48-pin (LPC2104/5/6) or
> > 64/144-pin (LPC2114/2124/2212/2214 & LPC2119/2129/2194/2292/2294)
> > device?
>
> It is a 64 pin device. LPC2124 to be precise. I also have a
> LPC2106 circuit, and the watchdog seems to work okay on that.
>
> I stripped the code down to a minimal example. The assembly
> stub has only two instructions (initialize sp, and jump to
> main()). Interrupts are not enabled. On the LPC2106 the
> output pin goes low for a few seconds, toggles for a few
> seconds, and then repeats as the chip is reset by the watchdog.
> On the LPC2124, the cycle only happens once. Then the chip
> freezes up and requires an external reset.
>
> ----------------------------------------------------------
> int
> main(void) {
> int i;
>
> IO0DIR = 0x00000040;
> IO0CLR = 0x00000040;
> // Ground the pins for a few seconds
> for (i = 20000000; --i >= 0;) {
> continue;
> }
> WDTC = 20000000;
> WDMOD = 0x03;
> WDFEED = 0xaa;
> WDFEED = 0x55;
> // Toggle until the watchdog reset triggers
> for (;;) {
> IO0CLR = 0x00000040;
> IO0SET = 0x00000040;
> }
> }
> ----------------------------------------------------------
>
> > --- In lpc2000@yahoogroups.com, "bobbruce000" <bobbruce000@y...>
> > wrote:
> > > I am having problems recovering after a watchdog reset.
> > > I enable the watchdog, then to test it, I put the cpu
> > > into a loop, toggling a pin connected to a logic probe.
> > > If I set the reset to, say, 3 seconds, then right
> > > on time the toggling stops. So the watchdog reset
> > > is triggered.
> > >
> > > But the processor never comes back to life. I have to
> > > ground the reset pin to get it to come back. How does
> > > a watchdog reset differ from a hardware reset? Are there
> > > some components (PLL?, UART?, TIMER?) that don't get
> > > reset?Message
Re: Watchdog reset not clean?
2004-05-15 by philips_apps
Attachments
- No local attachments were found for this message.