Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Thread

does watchdog work ?

does watchdog work ?

2004-09-15 by douglasbolton

I can't get the watchdog timer to work.

I set up with the following

// set watchdog to be 1 second
WDTC = 15000000;
// enable the watchdog interrupt
WDMOD = 1;				

WDFEED = 0xAA;
WDFEED = 0x55;

I then feed every loop of code. Even if I continually feed after set 
up the WDTOF and WDINT flags get set.

Re: does watchdog work ?

2004-09-15 by cd_racer2

Initialization:

   /* Setting watchdog work mode */
   WDMOD |= WDMOD_WDEN;
   WDMOD |= WDMOD_WDRESET;
     /* Dropping watchdog timeout flag */
   WDMOD &= ~WDMOD_WDTOF;
     /* Setting watchdog timeout */
   WDTC = WatchdogTimeout;

   WDFEED = 0xAA;
   WDFEED = 0x55;

-----------------------------------------------
Reset each cycle:

   WDTC &= ~WDMOD_WDTOF;
     /* Feeding 0xAA, 0x55 to restart watchdog */
   WDFEED = WDFEED_WDFEED(0xAA);
   WDFEED = WDFEED_WDFEED(0x55);

   This code is from our Watchdog driver. We've successfully test it.

Re: does watchdog work ?

2004-09-15 by markcrow

A side note to all those working on the LPC22xx chips and using 
external memory:  When the watchdog times out it will try to access 
vector memory at relative 0x00000000 using the memory attached to CS0 
(instead of address 0 of the internal flash memory).


--- In lpc2000@yahoogroups.com, "cd_racer2" <cd_racer@m...> wrote:
> Initialization:
> 
>    /* Setting watchdog work mode */
>    WDMOD |= WDMOD_WDEN;
>    WDMOD |= WDMOD_WDRESET;
>      /* Dropping watchdog timeout flag */
>    WDMOD &= ~WDMOD_WDTOF;
>      /* Setting watchdog timeout */
>    WDTC = WatchdogTimeout;
> 
>    WDFEED = 0xAA;
>    WDFEED = 0x55;
> 
> -----------------------------------------------
> Reset each cycle:
> 
>    WDTC &= ~WDMOD_WDTOF;
>      /* Feeding 0xAA, 0x55 to restart watchdog */
>    WDFEED = WDFEED_WDFEED(0xAA);
>    WDFEED = WDFEED_WDFEED(0x55);
> 
>    This code is from our Watchdog driver. We've successfully test 
it.

Re: does watchdog work ?

2004-09-15 by willyd106

FWIW:
The following routine worked for me.  I used P0.4 &5 to be able to 
see an i/o pin assert and de-assert using the Keil MCB2100(no 
expansion bus):
void init_WDT (void){
	WDTC = 0xFF;
	WDMOD= 0x03;
	WDFEED=0xAA;
	WDFEED=0x55;
	}
void init_iopins4and5 (void){
	PINSEL0=0x0;
	IODIR0=0x00000030;
	IOCLR0 = 0x00000030;
	}

long count;
long spare;

int main (void) {
  count=0x0;
  spare=0x0;
  /* Establish Port 0 bit 4 and 5 as outputs and 
  de-assert both */

  init_iopins4and5();
  if (WDMOD==0x04)
		IOSET0=0x00000020; //P0.05 set
		else 
		spare++;/*startup the watchdog timer 
  - watchdog interrupt enable = 1
  - watchdog reset enable = 1
  SO when WDEN and Watchdog timeout happens, a hardware reset should 
occur
 */
  init_WDT();

	if (WDMOD==0x03)
		IOSET0 =0x00000010; //set P0.04
		else 
		spare++;
 	
  while (1);



Regards,
Will
}--- In lpc2000@yahoogroups.com, "markcrow" <mcrow@p...> wrote:
> A side note to all those working on the LPC22xx chips and using 
> external memory:  When the watchdog times out it will try to access 
> vector memory at relative 0x00000000 using the memory attached to 
CS0 
Show quoted textHide quoted text
> (instead of address 0 of the internal flash memory).
> 
> 
> --- In lpc2000@yahoogroups.com, "cd_racer2" <cd_racer@m...> wrote:
> > Initialization:
> > 
> >    /* Setting watchdog work mode */
> >    WDMOD |= WDMOD_WDEN;
> >    WDMOD |= WDMOD_WDRESET;
> >      /* Dropping watchdog timeout flag */
> >    WDMOD &= ~WDMOD_WDTOF;
> >      /* Setting watchdog timeout */
> >    WDTC = WatchdogTimeout;
> > 
> >    WDFEED = 0xAA;
> >    WDFEED = 0x55;
> > 
> > -----------------------------------------------
> > Reset each cycle:
> > 
> >    WDTC &= ~WDMOD_WDTOF;
> >      /* Feeding 0xAA, 0x55 to restart watchdog */
> >    WDFEED = WDFEED_WDFEED(0xAA);
> >    WDFEED = WDFEED_WDFEED(0x55);
> > 
> >    This code is from our Watchdog driver. We've successfully test 
> it.

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.