Reply by embyy27 July 9, 20042004-07-09
--- In , "bobbruce000" <bobbruce000@y...>
wrote:
>>
> > See "USAGE NOTES ON WATCHDOG RESET AND EXTERNAL START" on page 214
> > of the 2124 User Manual (Dated May 03, 2004). Does this solve your
> > problem.
>
> No. This note only applies to LPC2212/2214. I am using a LPC2124.


On the LPC2124, you still need to be sure you have proper levels on
P0.14, P1.20, and P1.26. I assume they are sampled on a watchdog
reset, just like on an external reset. (If anyone can definitely
confirm this, that would be appreciated.) > Btw, I only saw this problem on one board, and no one else was able
> to reproduce the problem. So it might have just been a bad chip or
> a bad board. I never tested for the problem on any other board. I
> can do some more testing if you are interested, since I now have
> some new boards.

I have come to the conclusion that the internal watchdog cannot be
relied upon; if watchdog protection is needed - one must use an
external watchdog. Therefore, as far as I am concerned, any further
testing would be of purely academic interest.

As others have noted, in addition to the processor always starting up
with reset disabled, there is no protection for over-writing the WDTC
register. Writing 0xFFFFFFFF to this register would give a watchdog
time greater than 19 minutes for a typical 14.7456 MHz pclk -
vitually worthless.

I don't understand why Philips bothered to protect the WDEN and
WDRESET bits without protecting the WDTC register!


An Engineer's Guide to the LPC2100 Series

Reply by jpmarm2004 July 2, 20042004-07-02
--- In , "bobbruce000" <bobbruce000@y...> wrote:
>
> The external reset works, but the watchdog also works if I set
> it to "Interrupt Only" (set WDMOD to 1 instead of 3). That is
> good enough for catching software loops or timing problems, and
> the external monitoring will catch anything else. So the problem
> is solved as far as I am concerned, and I never spent any more
> time investigating the underlying watchdog reset problem.
>
> I never tested for the problem on any other board. I
> can do some more testing if you are interested, since I now have
> some new boards.
>
> -bob
Since it is an interesting problem, we will aprreciate it, if you
could work on this problem and suggest why reset does not work.
Is it possible that you have a valid IRQ routine, but not not a valid
Reset (soft reset)routine at address 0x0000 0000, while an external
reset could be taking the system through a different path?
Could you post your reset code for our benefit?
-- Mathew


Reply by bobbruce000 July 2, 20042004-07-02
--- In , "embyy27" <em3yy@e...> wrote:
> Did you ever get your watchdog reset problem resolved?

Yes and no. I never figured out what was causing the reset failure,
but I was able to work around it: The board is part of a larger
system, including an ARM9 XScale board running Linux. The Linux
board requests a status report from the LPC2124 board every 10ms
(via RS232), and yanks the reset line if it doesn't get a response.

> Did you try activating the Reset pin without removing power?

Yes. An external reset works fine.

> If your theory about the watchdog reset is correct, then activating
> the Reset pin should recover. If activating the Reset pin does not
> recover, then the problem is not the watchdog reset. Rather, the
> chip is getting into some sort of hardware latch-up which requires
> power cycling to recover - if that is true, adding an external
> watchdog (to trigger a reset) will not help you, unless you have the
> external watchdog toggle the power.

The external reset works, but the watchdog also works if I set
it to "Interrupt Only" (set WDMOD to 1 instead of 3). That is
good enough for catching software loops or timing problems, and
the external monitoring will catch anything else. So the problem
is solved as far as I am concerned, and I never spent any more
time investigating the underlying watchdog reset problem.

> See "USAGE NOTES ON WATCHDOG RESET AND EXTERNAL START" on page 214
> of the 2124 User Manual (Dated May 03, 2004). Does this solve your
> problem.

No. This note only applies to LPC2212/2214. I am using a LPC2124.

Btw, I only saw this problem on one board, and no one else was able
to reproduce the problem. So it might have just been a bad chip or
a bad board. I never tested for the problem on any other board. I
can do some more testing if you are interested, since I now have
some new boards.

-bob



Reply by embyy27 July 1, 20042004-07-01
See "USAGE NOTES ON WATCHDOG RESET AND EXTERNAL START" on page 214 of
the 2124 User Manual (Dated May 03, 2004). Does this solve your
problem?

--- In , "bobbruce000" <bobbruce000@y...>
wrote:
> --- In , "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 , "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?




Reply by embyy27 July 1, 20042004-07-01
Did you ever get your watchdog reset problem resolved?
--- In , "bobbruce000" <bobbruce000@y...>
wrote:
> 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.
>



Reply by philips_apps May 14, 20042004-05-14
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 , "bobbruce000" <bobbruce000@y...>
wrote:
> --- In , "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 , "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?




Reply by bobbruce000 May 13, 20042004-05-13
--- In , "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 , "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?





Reply by philips_apps May 13, 20042004-05-13
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?

Regards,

Philips Apps Team

--- In , "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?





Reply by bobbruce000 May 12, 20042004-05-12
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?