In message PICLIST@MITVMA.MIT.EDU writes: > Hi dudes > > I've got a basic question that I still don't understand. > > What is the wachdog timer used for ? > I know it is used to reset the PIC,but why ? > Corne, Others have described its main use, but I have used it in the past time time out serial communication so you are not stuck in an endless loop. For example, if another processor is clocking serial data to a PIC in a manner similar to I2C, you might have code that looks a bit like: movlw .8 movwf bitctr q btfss porta, 0 ; wait for a high then read the data in goto $-1 read the databit into a register btfsc porta, 0 ; wait for a low before continuing goto $-1 decfsz bitctr goto q If, for whatever reason, the other processor sends less than 8 bits, the code would be stuck in an endless loop never leaving this section of code. However, if the watchdog is enabled, it will reset the after 18ms (more with the pre-scaler) and as the PIC allows you to differentiate between a POR reset and a watchdog reset, you can take appropriate action. I hope this helps. Regards, Mike Watson