Author Topic: LPC 932 Watchdog  (Read 12629 times)

Thmas

  • Guest
Re: LPC 932 Watchdog
« Reply #15 on: June 09, 2004, 08:40:55 am »
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

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2172
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: LPC 932 Watchdog
« Reply #16 on: June 09, 2004, 10:06:01 am »
Go to:

www.codearchitect.org/philips

select your device and select "Watchdog".

Embedded Systems Academy, Inc.
support at esacademy dot com

Thmas

  • Guest
Re: LPC 932 Watchdog
« Reply #17 on: June 10, 2004, 06:40:48 am »
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

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2172
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: LPC 932 Watchdog
« Reply #18 on: June 10, 2004, 08:52:31 am »
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

  • Guest
Re: LPC 932 Watchdog
« Reply #19 on: June 11, 2004, 11:04:51 am »
Hi, Andy

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

Best regards,
Thmas