As a beginner, it took me a while to figure out that all UNUSED i/o lines MUST be tied to the power supply (CMOS rule - all inputs must go somewhere). For weeks I was getting intermittent results because I didn't know this rule. Sounds like this may be your problem. Incidently, I found the answer in the book "Easy PIC'n" which gets my vote as best beginners book (and I've got them all :) Amazingly, none of the books highlight these symptoms or give any kind of bold text warning/tip - it must be a common cause of failure for beginners. John At 12:26 AM 8/13/98 -0400, you wrote: >Hi, > >I am having a problem with a protoype build of a PIC circuit. I have Port >B connected to 2 LED's (2 mA each), 3 relays (13 mA each) and 3 to an MAX >232 chip. The chip is a 16C72, windowed. > >I wrote a simple program in MicroEngineering Labs PIC Basic to see test the >operation of the PIC. It goes as follows: > >High 0 >Pause 1000 >Low 0 >Pause 1000 >High 1 >Pause 1000 >Low 1 >Pause 1000 > >the rest goes on to do the same with the other lines conected to the relays. > >RB0 and RB1 operate the status LED's. I energize the circuit and the LED >connected to RB0 Blinks on one second then off. Then the LED connected to >RB1 doesn't light. Or sometimes the RB0 LED lights goes off then RB1 >lights and goes off. Most of the time though the RB1 LED never lights. > >Why is the operation of this so intermittent? > >I set Watchdog timer OFF during compilation. The MCLR is connected to a >DS1233 like Myke Predko recommends. The crystal is 4 MhZ, with 22pF loads. > The current draw on Port B is less than 50mA max. The circuit is powered >through a 5V regulator with a 9V battery. The relays have protection >diodes on the coils to prevent surge currents from damaging the PIC. The >PIC has a bypass cap at the Vdd and Vss. > >This has me stumped. > >