...for me it was a long way to understand the WDT-technic.
My 16F876 has a period of maybe 2,5 seconds for the WDT. My controller works in a 0,5-second-loop (derived from Timer1/CCPx), so I put the CLEARWDT at the start of the loop. That was wrong !!!!!
My problem was the I2C-port. So I worked out a sheme to use the I2C-hardware at least 2 times a second. And when then I2C-hardware is working, the interrupt-routine clears the WDT.
So, if the I2C-hardware has a problem, 2,5 seconds later the PIC starts over.
You have to place the CLEARWDT at these points, which are reacting to repeated events. If something is wrong, these events aren't working and the WDT is starting the PIC.
Within the INIT-Part (start) of the programm, you can watch the PCON-bits in order to see the cause of the reset (TO!).
If you are using the default PBP-settings, the CLEARWDT is inserted after each PBP-command and the whole concept isn't work.
Just find out some small pieces of code, which have to be activated repeated and you can build a working WDT.
PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2
Bookmarks