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.