EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Re: Watchdog in LPC2000

Started by Nagaraju November 30, 2007
Thanks Mr.Nishant and Mr.Derbaier,
I understood your reply, but when I have feeded the watch dog in
master while loop by disabling the all interrupts which i am using in the
following manner my system get initialized and once after the initialization
of INIT_WatchDog(), Display is not changing which depends on the timer
interrupt, communication is working which is interrupt based.I have checked
it on hyper terminal.Please tell me, the way in which i have disabled my
interrupts is right or wrong.plz tell me any otherway to feed the watch dog
in master while loop.
#define Enable_Interrupt() \
{\
U0IER=0x01; /*Enable uart0 Rx interrupt*/\
if(T0TC>=1) {T0TCR=2; T0TCR=1;}\
T0MCR=3; /*Timer0 Match Interrupts*/\
T1CCR=0xA05;/*Timer1 CCP interrupt*/\
}

#define Disable_Interrupt() \
{\
U0IER=0x00; /*Enable uart0 Rx interrupt*/\
T0MCR=0x00; /*Timer0 Match Interrupts*/\
T1CCR=0x000;/*Timer1 CCP interrupt*/\
}
//Disable_Interrupt();
//Enable_Interrupt();

#define Feed_Watchdog() \
{ \
Disable_Interrupt() ;\
WDFEED= 0xAA; \
WDFEED= 0x55; \
Enable_Interrupt() \
}

-----Original Message-----
From: l... [mailto:l...]On Behalf Of
Nishant Agrawal
Sent: Friday, November 30, 2007 5:09 PM
To: l...
Subject: RE: [lpc2000] Watchdog in LPC2000
Hi Nagaraju,

I am not convinced at feeding the watchdog in interrupts. I
might have a wrong concept & correct me if I am wrong. Watchdogs are not
to
correct software faults but hardware faults such as spikes. What happens
when a spike changes the value of program counter out of the range of the
code. The program counter might increase till it overflows or the program
might enter data abort or fetch abort. In that case the watch dog would be
useless, coz I think the ISR would still be serviced and your watchdog
will
be feed so the program won't restart when it needed to restart. The
watchdog
would become useless.

I don't think disabling the interrupt should increase the
latency. We could do it by changing the CPSR value. It would only take a
couple of extra instructions and ARM is fast, shouldn't be a problem. I
haven't tried this thing myself but it should work. I do believe that
feeding the watch dog in the ISR will not solve the problem.

Do send me your thoughts and do think about it.

Bye

With Regards

Nishant Agrawal

_____

From: l... [mailto:l...] On Behalf
Of
Nagaraju
Sent: Friday, November 30, 2007 1:03 PM
To: l...
Subject: RE: [lpc2000] Watchdog in LPC2000

Hi nishant, my Watch dog timer problem is solved.Actually i was feeding
the
watchdog timer in the master while loop, duo to the occurance of
interrupts
system was got to reset.I hve kept the watch dog timeout of 2sec.By
disabling interrupts while feeding my system is malfunctioning.So i am
feeding the watch dog timer in timer0 interrupt isr toutine which occures
for every 1 msec which is having highest priority.In this way i have
avoided
the occurane of any interrupt while feeding. Now its working fine.what
about
ur problem, does it solved, if not just follow the above proceducre if
possible.
thanks..
-----Original Message-----
From: lpc2000@yahoogroups .com
[mailto:lpc2000@yahoogroups .com]On
Behalf Of
Nishant Agrawal
Sent: Wednesday, November 28, 2007 10:15 AM
To: lpc2000@yahoogroups .com
Subject: RE: [lpc2000] Watchdog in LPC2000

Hi Nagaraju,

I am using LPC 2103 at a clock frequency of 22.1184 Mhz. Someone
posted an information that the user manual has wrong information. I do not
know about LPC 2138 but in LPC 2103 in between the Watchdog feed of 0xAA &
0x55 if any of the I/O peripherals are accessed then the system gets a
watch
dog reset. So I think you have the same problem. You might if possible in
your system disable the interrupts when you feed the watch dog. As the
manual stated, the watchdog gets reset if its registers are accessed while
feeds but actually it gets reset when the I/O devices are accessed during
the feed. So you need to disable the interrupts while the feed so that the
I/O are not accessed. So tell me too if you are able to overcome this
problem by any other means

With Regards

Nishant

_____

From: lpc2000@yahoogroups .com
[mailto:lpc2000@yahoogroups .com] On
Behalf
Of
Nagaraju
Sent: Wednesday, November 28, 2007 10:17 AM
To: lpc2000@yahoogroups .com
Subject: RE: [lpc2000] Watchdog in LPC2000

hi Nishant, what happens if u don't initialize watch dog? I am also facing
the same problem.I am using the lpc2138. I have kept 2sec period for watch
dog timer.The system getting reset quiet often. I am thinking that as am
using two timer interrupts and one uart interrupt, it core is busy in
servicing the isr's. At which colck rate you are running ur MCU. I am
going
to increase my clock to 50Mhz as right now iam directly using the
14.745600Mhz quartz crystal freq. u just try it out.
-----Original Message-----
From: lpc2000@yahoogroups .com
[mailto:lpc2000@yahoogroups .com]On
Behalf Of
Nishant Agrawal
Sent: Tuesday, November 27, 2007 4:25 PM
To: lpc2000@yahoogroups .com
Subject: [lpc2000] Watchdog in LPC2000

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.

Thanks

With Regards,

Bye

An Engineer's Guide to the LPC2100 Series


The 2024 Embedded Online Conference