EmbeddedRelated.com
Forums

Using Watchdog with LPC2148

Started by Sutton Mehaffey March 3, 2013
I am using the WDT with our security system. Since you can not turn off
the WDT once started until it expires, I have two instances where that
it is an issue. #2 more so than #1.

1. When I turn the unit off (keyswitch), I go to Power Down mode where
a software reset (caused by a Key ON) is the only source of a wakeup. I
noticed that the WDT is not disabled, but does not cause a wakeup.
Which seems to be in suspended mode. Is that how it works?
Theoretically, I could get a WDT reset right when I turn back on the
keyswitch (before I initialize the WDT again), but a double take in that
small window might not be a big issue.

2. In certain instances, I go to Low Power Mode, in which EXT3 is the
only source of a wakeup, However, the WDT still runs, which causes a
reset. This is a little problem, because the reset starts over the
code, but I need it to resume where the power down takes place, which is
deep within my code. Which means, I would like to shut off the WDT just
before the Low Power Mode. But, obviously, I can't.

Does anyone have any input about these issues, in particular the 2nd one?

--
Sutton Mehaffey
Lookout Portable Security
4040 Royal Dr. #100
Kennesaw, GA 30144
800-207-6269, 770-514-7999, 770-514-1285 FAX
s...@lookoutportablesecurity.com

An Engineer's Guide to the LPC2100 Series

Sutton,

For #2, why don't you set up a timer interrupt to run at a slightly faster
rate than the watchdog timer to cause a wake up to tickle the watchdog
periodically? If you wrap your low power down command in a loop that
waits for a proper exit (perhaps EXT3 flag set), and tickles the WDT
then it should work as you planned.

Mike
-----Original Message-----
From: l... [mailto:l...]On Behalf
Of Sutton Mehaffey
Sent: Sunday, March 03, 2013 11:21 AM
To: l...
Subject: [lpc2000] Using Watchdog with LPC2148
I am using the WDT with our security system. Since you can not turn off
the WDT once started until it expires, I have two instances where that
it is an issue. #2 more so than #1.

1. When I turn the unit off (keyswitch), I go to Power Down mode where
a software reset (caused by a Key ON) is the only source of a wakeup. I
noticed that the WDT is not disabled, but does not cause a wakeup.
Which seems to be in suspended mode. Is that how it works?
Theoretically, I could get a WDT reset right when I turn back on the
keyswitch (before I initialize the WDT again), but a double take in that
small window might not be a big issue.

2. In certain instances, I go to Low Power Mode, in which EXT3 is the
only source of a wakeup, However, the WDT still runs, which causes a
reset. This is a little problem, because the reset starts over the
code, but I need it to resume where the power down takes place, which is
deep within my code. Which means, I would like to shut off the WDT just
before the Low Power Mode. But, obviously, I can't.

Does anyone have any input about these issues, in particular the 2nd one?

--
Sutton Mehaffey
Lookout Portable Security
4040 Royal Dr. #100
Kennesaw, GA 30144
800-207-6269, 770-514-7999, 770-514-1285 FAX
s...@lookoutportablesecurity.com

I have a 15 sec WDT running and in both cases (Power Down, and Idle
Mode), I'm seeing the WDT suspended (not disabled). I'm not getting
any WDT resets at all in both these Power Down modes. I can't find
anything in the user's manual that describes what happens to the WDT in
power down and idle modes. If it suspends operation or just prevents a
reset in either mode, then I'm completely happy with that. That's not
what I would expect, but I can't find any documentation on that.

Does anyone know if this is the way the WDT works in Power Down modes?

Sutton Mehaffey
Lookout Portable Security
4040 Royal Dr. #100
Kennesaw, GA 30144
800-207-6269, 770-514-7999, 770-514-1285 FAX
s...@lookoutportablesecurity.com

On 3/3/2013 3:48 PM, Michael Anton wrote:
>
> Sutton,
>
> For #2, why don't you set up a timer interrupt to run at a slightly faster
> rate than the watchdog timer to cause a wake up to tickle the watchdog
> periodically? If you wrap your low power down command in a loop that
> waits for a proper exit (perhaps EXT3 flag set), and tickles the WDT
> then it should work as you planned.
>
> Mike
>
> -----Original Message-----
> From: l...
> [mailto:l... ]On
> Behalf
> Of Sutton Mehaffey
> Sent: Sunday, March 03, 2013 11:21 AM
> To: l...
> Subject: [lpc2000] Using Watchdog with LPC2148
>
> I am using the WDT with our security system. Since you can not turn off
> the WDT once started until it expires, I have two instances where that
> it is an issue. #2 more so than #1.
>
> 1. When I turn the unit off (keyswitch), I go to Power Down mode where
> a software reset (caused by a Key ON) is the only source of a wakeup. I
> noticed that the WDT is not disabled, but does not cause a wakeup.
> Which seems to be in suspended mode. Is that how it works?
> Theoretically, I could get a WDT reset right when I turn back on the
> keyswitch (before I initialize the WDT again), but a double take in that
> small window might not be a big issue.
>
> 2. In certain instances, I go to Low Power Mode, in which EXT3 is the
> only source of a wakeup, However, the WDT still runs, which causes a
> reset. This is a little problem, because the reset starts over the
> code, but I need it to resume where the power down takes place, which is
> deep within my code. Which means, I would like to shut off the WDT just
> before the Low Power Mode. But, obviously, I can't.
>
> Does anyone have any input about these issues, in particular the 2nd one?
>
> --
> Sutton Mehaffey
> Lookout Portable Security
> 4040 Royal Dr. #100
> Kennesaw, GA 30144
> 800-207-6269, 770-514-7999, 770-514-1285 FAX
> s...@lookoutportablesecurity.com
>



On the LPC2148, the watchdog gets clocked from PCLK.PCLK is derived from the main oscillator. The main oscillator is turned off in power down mode. With idle mode, the core clock is gated, but the PCLK still runs.

Jeff

--- In l..., Sutton Mehaffey wrote:
>
> I have a 15 sec WDT running and in both cases (Power Down, and Idle
> Mode), I'm seeing the WDT suspended (not disabled). I'm not getting
> any WDT resets at all in both these Power Down modes. I can't find
> anything in the user's manual that describes what happens to the WDT in
> power down and idle modes. If it suspends operation or just prevents a
> reset in either mode, then I'm completely happy with that. That's not
> what I would expect, but I can't find any documentation on that.
>
> Does anyone know if this is the way the WDT works in Power Down modes?
>
> Sutton Mehaffey
> Lookout Portable Security
> 4040 Royal Dr. #100
> Kennesaw, GA 30144
> 800-207-6269, 770-514-7999, 770-514-1285 FAX
> sutton@...
>
> On 3/3/2013 3:48 PM, Michael Anton wrote:
> >
> > Sutton,
> >
> > For #2, why don't you set up a timer interrupt to run at a slightly faster
> > rate than the watchdog timer to cause a wake up to tickle the watchdog
> > periodically? If you wrap your low power down command in a loop that
> > waits for a proper exit (perhaps EXT3 flag set), and tickles the WDT
> > then it should work as you planned.
> >
> > Mike
> >
> > -----Original Message-----
> > From: l...
> > [mailto:l... ]On
> > Behalf
> > Of Sutton Mehaffey
> > Sent: Sunday, March 03, 2013 11:21 AM
> > To: l...
> > Subject: [lpc2000] Using Watchdog with LPC2148
> >
> > I am using the WDT with our security system. Since you can not turn off
> > the WDT once started until it expires, I have two instances where that
> > it is an issue. #2 more so than #1.
> >
> > 1. When I turn the unit off (keyswitch), I go to Power Down mode where
> > a software reset (caused by a Key ON) is the only source of a wakeup. I
> > noticed that the WDT is not disabled, but does not cause a wakeup.
> > Which seems to be in suspended mode. Is that how it works?
> > Theoretically, I could get a WDT reset right when I turn back on the
> > keyswitch (before I initialize the WDT again), but a double take in that
> > small window might not be a big issue.
> >
> > 2. In certain instances, I go to Low Power Mode, in which EXT3 is the
> > only source of a wakeup, However, the WDT still runs, which causes a
> > reset. This is a little problem, because the reset starts over the
> > code, but I need it to resume where the power down takes place, which is
> > deep within my code. Which means, I would like to shut off the WDT just
> > before the Low Power Mode. But, obviously, I can't.
> >
> > Does anyone have any input about these issues, in particular the 2nd one?
> >
> > --
> > Sutton Mehaffey
> > Lookout Portable Security
> > 4040 Royal Dr. #100
> > Kennesaw, GA 30144
> > 800-207-6269, 770-514-7999, 770-514-1285 FAX
> > sutton@...
> >
> >
> >
>