Hi, I need to know how to use the WDT in the P89LPC932. I have selected its internal oscillator as the clock source. However, I do not know if it would consume more power than selecting the PCLK as its clock source. Also, how can I find out if the WDT is working fine. Do I need an infinite loop on this function? When do I call it? I have select WDTE = 1; and WDSE = 0; in the UCFG1 register. Sorry for so many questions, but I am still a beginner on this. Thank you void Watch_Dog (void) { EA = 0; WDCON = 0x05; //start WDT, and select WD oscillator WDL = 0xFF; WFEED1 = 0x0A5; //feed sequence WFEED2 = 0x05A; EA = 1; }
for debugging purposes, I recommend that you make a macro e.g. KICK_THE_PUPPY so that you can enable the watchdog for non-debug and disable it for debug in one place (the first 'kick' enables the wd forever). A simple way to test the WD functioning during development is just to start kicking it and it must then time out. Erik
Erik, do you know where can I find samples of this function. On how to use the WDT. I am working on the "KICK_THE_PUPPY". Thank you
do you know where can I find samples of this function. Not a function, make a macro of the two writes (see datasheet). Erik
View all questions in Keil forum