Graham, I would add a 10uF and a .1 uF cap between Vdd and Vss at the 'F84'. Also, I would enable the weak pullups on Port B as well. That is unless you already have done these things. Also, make sure the watchdog timer is not tripping you up. I don't think the W/D timer is the problem from what you state is happening. You may want to check the 5 volt regulator to make sure it is functioning properly also. What kind of oscillator are you using? Are you using a crystal or canned Osc? Do you have the power up timer and the Osc startup timer activated? If not, the part may not be getting a good clock signal before it starts running. Just some things to check. Hope this helps. Also, I'd like to know what you did to fix it when you get it fixed. Regards, Jim -----Original Message----- From: Graham To: PICLIST@MITVMA.MIT.EDU Date: Saturday, May 01, 1999 11:31 AM Subject: 16F84 PROBLEM >I'm working on a little PIC project and out of sheer desperation I am >appealing to you for help! > >I've designed a very simple alarm system for my house using the >PIC16F84, that uses Change on Port B Interrupt to detect whether a door >or window has opened. It then actuates a relay for an alarm and flickers > >an LED to indicate on a diagram where in the house it was. > >Simple to design and program using MPLAB, but when I burn it in and test > >it, I find that it is VERY erratic. For instance when I apply power >(5.05v through a regulator) some LEDs flash spontaneously that are NEVER > >supposed to flash and it acts strange. Normally when I then >apply Master Reset it resets properly and works fine, but not always. >Sometimes when reset it acts the same as during a power up. >Even when I think it IS working fine it sometimes does strange things >inconsistently. > >I've even simulated a Power-On reset and it starts up properly in MPLAB. > >BTW I've combed through the source code and everything looks fine also >in simulation. > >It would be really great if you could give me some tips please. I use >12.45v to program it (unregulated) and 5.05v (regulated) for Vdd. I use >a 4MHz crystal and power up timer on, watch dog off. > >Could the PIC be damaged? Why is it erratic? > >Thank you! >Graham.