Have you checked your PCB connections? Do you use a pull-up or direct connect to Vcc? Good solder joints? When you left an open unconnected pin t= o float, it can activate and deactivate randomly. Also, sometimes is good practice to have a kind of debounce system( can be done with a simple delay after output change) --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .