Sounds like the classic floating input problem. Check the=20 initialization, pull up, pull down state of all pins. Joe W On 1/25/2013 11:45 AM, Perry Curling-Hope wrote: > I am using a PIC16F887 as a controller for a laboratory process. > > TMR1 is preloaded and allowed to timeout at 1sec a interval, the interrup= t > service routine then determines if the interrupt was caused by TMR1, and > decrements a register containing a time countdown value, prompting the > process to advance when the register reaches zero. > > The Watchdog period is slightly greater than 1 second, (to accomodate the > rest of the code execution loop) and the watchdog is cleared within the > interrupt service routine ( a watchdog light is toggled there as well) > On an occurrence of a reset, the timeout in STATUS register bit4 is > examined to determine if the reset was caused by the WDT, and the program > redirected to resume execution in the correct place, else the normal powe= r > up initialisation and startup is executed. > > All works great....except....after some indeterminate period, varying fro= m > a couple of minutes to over 3 hours, the watchdog light stops and the LCD > displaying the time countdown 'freezes', indicating that the micro has > ceased executing the loop. > One would expect that if the watchdog was not being serviced, a reset wou= ld > ensue regardless and the machine would resume execution...somewhere. > > Not so....it appears 'dead', as if the LFINTOSC has ceased, which is not > supposed to happen. > Even a 'hard' reset applied to the MCLR/Vpp pin (which is enabled and > effects an immidiate reset at all other times) does not restart the micro= '. > > Only a complete power down and restart through powering up again will cau= se > the microcomputer to resume operation > > Any ideas would be much appriciated. > --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .