Main Menu

LPC 932 Watchdog

Started by Markus Buerstner, March 09, 2004, 06:21:12 AM

Previous topic - Next topic

Thmas

May i ask a question?
Where can i get the Watchdog Sample code?
I looking for Watchdos for long time.
Any one can help me.

greeting
Thmas

Andy Ayre

Go to:

www.codearchitect.org/philips

select your device and select "Watchdog".

Embedded Systems Academy, Inc.
support at esacademy dot com

Thmas

Hi Andy,

Thank you for your reply.

I still have a question.
I tried many times to Enable Watchdog
(Use the Sample code at "www.codearchitect.org/philips"), but it is not successuful to use Watchdog.
May i ask you how to use the Watchdog more detial?

example: Enable Watchdog sequence ect..

The following Code whether Enable Watchdog?
Ps i have Enabled the UCFG1 -->WDTE = 1
main()
(
watchdog_init();
watchdog_start();
while(1)
{
   Flag = 1;             //Just turn on the LED
   watchdog_feed();
}
   
)


void watchdog_init(void)
{
  bit eacopy;
  WDL = 0xFF;
  eacopy = EA;
  EA = 0;
  WDCON = 0xE4;
  WFEED1 = 0xA5;
  WFEED2 = 0x5A;
  EA = eacopy;

}
void watchdog_feed(void)
{
  bit eacopy;
  eacopy = EA;
  EA = 0;
  WFEED1 = 0xA5;
  WFEED2 = 0x5A;
  EA = eacopy;
}

void watchdog_start(void)
{
  bit eacopy;
  eacopy = EA;
  EA = 0;
  WDCON |= 0x04;
  WFEED1 = 0xA5;
  WFEED2 = 0x5A;
  EA = eacopy;
}
void watchdog_stop(void)
{
  bit eacopy;
  eacopy = EA;
  EA = 0;
  WDCON &= ~0x04;
  WFEED1 = 0xA5;
  WFEED2 = 0x5A;
  EA = eacopy;
}


I am appreciate to you.

Greeting
Thmas

Andy Ayre

Thmas,

This isn't the correct place for a discussion on Code Architect, so please Email me your reply to the following. My Email address is below.

1. How did you configure the watchdog? Which clock souce and what time out period before reset?
2. If using CCLK (which it looks like you are) how fast is your clock source and what did you enter into the Code Architect form?
3. How are you determining that the device is resetting?

Embedded Systems Academy, Inc.
support at esacademy dot com

Thmas

Hi, Andy

Thank you for your support.
I will sent Email to your account.
I am very appreciate to you.

Best regards,
Thmas