We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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; }
I am still a bit confused. What about in my real application when should I called or initialized the WDT. For what I understand the WDT should always overflow. If it does not (underflowing) then it means a software error while executing occured. therefore, the WDT will cause an system reset. Right? Feed the puppy or it bites The way a watchdog is used is that at strategic places in your program you feed it (feed sequence: see dxatasheet). If to much time passes between feeds a reset happens. Erik
Erik can you give me hints on where could be those strategic places in a program? Also, what about keeping track of the times when the WDT underflows...how would I do that. Thank you, you have been a great help.
Goto http://www.embedded.com and do a search on watchdog to access this and other nice articles on the subject. http://www.embedded.com/design_library/esd/hi/OEG20030115S0042 -Walt
can you give me hints on where could be those strategic places in a program how can I? it varies from program to program. Erik
can you give me hints on where could be those strategic places in a program NOT in ISRs, that will defeat the purpose Erik
That is good to know. Now I think I know where to use it. but what about keeping track of every time when the WDT underflows...how would you do that.
That is good to know. Now I think I know where to use it. but what about keeping track of every time when the WDT underflows...how would you do that 1) you have the softstart status bit 2) why would you want to, it never should Erik
Erik I lost you here! 1) you have the softstart status bit? What is that 2) why would you want to, it never should...I just want to keep a record of the times the WDT served the micro. Also, how many times should I call "initialize the puppy"...I mean the feeding process should be endless or just once. Thank you
Erik I lost you here! 1) you have the softstart status bit? What is that Please read the manual 2) why would you want to, it never should...I just want to keep a record of the times the WDT served the micro. look at the warmstart bit. Also, how many times should I call "initialize the puppy"... I mean the feeding process should be endless or just once. should be fed often enough not to time out