EmbeddedRelated.com
Forums

Watchdog and external Interrupt problem

Started by itsjustimpossible February 27, 2005

Hi
I am nearing the end of our first project with the LPC2294 and need
to implement the watchdog.

I am pretty sure I have it setup correctly, and with it in its debug
mode I can cause a jump to the watchDog IRQ routine when I put the
uP into an endless loop.

As part of its functionality external interrupts are disabled until
the equipment is set to GO, and this where the problems start. As
soon as I enable the external interrupt the watchdog timer jumps to
its ISR. (The external interrupts are set to FIQ and at 8uS
intervals)

Even with the watchdog timer set to a very very long timeout (i.e.
ten seconds) as soon as external interrupts are enabled we jump to
the WatchDog ISR.

With the watchdog set to Off everything else works as expected.
With the watchdog set to On but no external interrupts everything
works as expected.

When I kick the watchdog I am disabling all the interrupts using the
VIC. Do I have to jump to system mode and disable the global IRQ and
FIQ flags? This would probably be too slow...

Has anyone else seen anything like this?
At the moment its driving me nuts.

many thanks
Simon




Re: Watchdog and external Interrupt problem

An Engineer's Guide to the LPC2100 Series

At 03:22 PM 2/27/05 +0000, itsjustimpossible wrote:
>When I kick the watchdog I am disabling all the interrupts using the
>VIC. Do I have to jump to system mode and disable the global IRQ and
>FIQ flags? This would probably be too slow...

What mode are you normally in? You can't disable interrupts in user mode,
but there is really no reason to ever be in user mode.

Robert
" 'Freedom' has no meaning of itself. There are always restrictions,
be they legal, genetic, or physical. If you don't believe me, try to
chew a radio signal. "

Kelvin Throop, III


Yes I got fed up too. Get an external watchdog
chip...you want to be able to 'scope' a real reset
signal from something independent of the the LPC chip
when the CPU screws up.

If anything it will let you sleep at night, when
you've got thousands of products out there in the
field. Jane
--- itsjustimpossible <> wrote:

---------------------------------

Hi
I am nearing the end of our first project with the
LPC2294 and need
to implement the watchdog.

I am pretty sure I have it setup correctly, and with
it in its debug
mode I can cause a jump to the watchDog IRQ routine
when I put the
uP into an endless loop.

As part of its functionality external interrupts are
disabled until
the equipment is set to GO, and this where the
problems start. As
soon as I enable the external interrupt the watchdog
timer jumps to
its ISR. (The external interrupts are set to FIQ and
at 8uS
intervals)

Even with the watchdog timer set to a very very long
timeout (i.e.
ten seconds) as soon as external interrupts are
enabled we jump to
the WatchDog ISR.

With the watchdog set to Off everything else works as
expected.
With the watchdog set to On but no external interrupts
everything
works as expected.

When I kick the watchdog I am disabling all the
interrupts using the
VIC. Do I have to jump to system mode and disable the
global IRQ and
FIQ flags? This would probably be too slow...

Has anyone else seen anything like this?
At the moment its driving me nuts.

many thanks
Simon

---------------------------------
Yahoo! Groups Links

To Send instant messages to your online friends http://uk.messenger.yahoo.com



It sounds like you have a watchdog flag already lodged, ie even though
not enabled the watchdog still runs, and, as soon as it becomes enabled
, with ints enabled the old pending flag is executed. Try clearing any
pending flags before enabling the watchdog.

Al

jane highland wrote:

> Yes I got fed up too. Get an external watchdog
> chip...you want to be able to 'scope' a real reset
> signal from something independent of the the LPC chip
> when the CPU screws up.
>
> If anything it will let you sleep at night, when
> you've got thousands of products out there in the
> field. > Jane
> --- itsjustimpossible <> wrote:
>
> ---------------------------------
>
> Hi
> I am nearing the end of our first project with the
> LPC2294 and need
> to implement the watchdog.
>
> I am pretty sure I have it setup correctly, and with
> it in its debug
> mode I can cause a jump to the watchDog IRQ routine
> when I put the
> uP into an endless loop.
>
> As part of its functionality external interrupts are
> disabled until
> the equipment is set to GO, and this where the
> problems start. As
> soon as I enable the external interrupt the watchdog
> timer jumps to
> its ISR. (The external interrupts are set to FIQ and
> at 8uS
> intervals)
>
> Even with the watchdog timer set to a very very long
> timeout (i.e.
> ten seconds) as soon as external interrupts are
> enabled we jump to
> the WatchDog ISR.
>
> With the watchdog set to Off everything else works as
> expected.
> With the watchdog set to On but no external interrupts
> everything
> works as expected.
>
> When I kick the watchdog I am disabling all the
> interrupts using the
> VIC. Do I have to jump to system mode and disable the
> global IRQ and
> FIQ flags? This would probably be too slow...
>
> Has anyone else seen anything like this?
> At the moment its driving me nuts.
>
> many thanks
> Simon >
>
> ---------------------------------
> >. >
>





Thanks to all those who replied. Sorry for the delay in replying,
finally got back to working on this again.

Just a quick question, yes I am in User mode all the time which
means doing a software interrupt to change mode to disable/enable
interrupts. This is all a bit too slow.

We are not using an RTOS, so are there any drawbacks with staying in
Supervisor mode as you suggest?

many thanks
Simon

--- In , Robert Adsett <subscriptions@a...>
wrote:
> At 03:22 PM 2/27/05 +0000, itsjustimpossible wrote:
> >When I kick the watchdog I am disabling all the interrupts using
the
> >VIC. Do I have to jump to system mode and disable the global IRQ
and
> >FIQ flags? This would probably be too slow...
>
> What mode are you normally in? You can't disable interrupts in
user mode,
> but there is really no reason to ever be in user mode.
>
> Robert >
> " 'Freedom' has no meaning of itself. There are always
restrictions,
> be they legal, genetic, or physical. If you don't believe me, try
to
> chew a radio signal. "
>
> Kelvin Throop, III




Re: Watchdog and external Interrupt problem
At 07:43 PM 3/15/05 +0000, itsjustimpossible wrote:
>Thanks to all those who replied. Sorry for the delay in replying,
>finally got back to working on this again.
>
>Just a quick question, yes I am in User mode all the time which
>means doing a software interrupt to change mode to disable/enable
>interrupts. This is all a bit too slow.
>
>We are not using an RTOS, so are there any drawbacks with staying in
>Supervisor mode as you suggest?

Actually I'd suggest system mode. The only difference between User and
System mode is (AFAIK) that in system mode you can control the interrupt
and mode bits. RTOS or not, on this small a micro I see no benefit to user
mode.

Robert

" 'Freedom' has no meaning of itself. There are always restrictions, be
they legal, genetic, or physical. If you don't believe me, try to chew a
radio signal. " -- Kelvin Throop, III
http://www.aeolusdevelopment.com/



Thanks, I will keep to system mode from now on.

A bit embaressing, but I seem to be having all kinds of trouble
getting the watchdog to do anything sensible.

I don't suppose anyone knows of some example code to give me an idea
of where I am going wrong?

I have scrapped all the watchdog handler bits I have done so far and
am starting again. I really wish I had gone with an external one,
but its all too late now. The boards are done...

many thanks
Simon

--- In , Robert Adsett <subscriptions@a...>
> Actually I'd suggest system mode. The only difference between
User and
> System mode is (AFAIK) that in system mode you can control the
interrupt
> and mode bits. RTOS or not, on this small a micro I see no
benefit to user
> mode.
>
> Robert