The original delay loop is for a 4MHz oscillator. For creating timing loops, I use a neat little program called picloops (just google for it). The erratic operation sounds like a mclr issue. -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf Of Rikard Bosnjakovic Sent: Thursday, March 15, 2007 9:32 AM To: Microcontroller discussion list - Public. Subject: [PIC] First shot errors So, finally I was able to use a programmer and a chip (16F628a to be exact). Feeling the rush of excite, I immediately hacked together a "running light"-test in MPLAB, just for the sake of trying the microcontroller out. It worked the first time, I was amazed! But, since this opposed to using MPLAB is reality, the happiness was not for long; because there were some errors. The lights (LEDs) were running, sure, but the supposed delay of 5 seconds between each light is wrong; the lights are in a sort of rush hour and then stops. I don't know if this occurs codewise or breadboard-wise, but probably the latter, because if i touch the board or some pins, the lights start again. Sometimes they run, sometimes only one is lit, etc. Some oscillation perhaps? Nothing except the PIC and 4 LEDs are connected on the board. I also thought it might had to do with the lack of crystal (I used the internal oscillator), but alas; adding a 14MHz-crystal and proper caps did not solve the problem. The lights surely runs even faster, but the problem still occurs. I'm attaching my code that I used for testing, feel free to take a peek and berate me to better knowledge. -- - Rikard. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist