All, I have just started using a 12F617 instead of the larger pin count 18F =20 parts. I am using HiTech in Lite mode. The code is here: http://pastebin.com/nrQDC224 with the compiled =20 version here: http://pastebin.com/kibNLyZx In main(), I get to line 170 (0x7F9 in the compiled version) and the =20 status LED is lit. I can see this in MPLAB simulator and on the =20 target board (if I use a while(1) afterward so it stalls). However, a =20 few cycles later we get back to line 38 (0x765 in ASM) and for some =20 reason the entire GPIO port is reset to 0x00. This happens both in =20 the simulator and in the real hardware. I have tried a number of different code variations for the same thing, =20 which all compile to the same. However, in all cases the GPIO port =20 gets set to 0x00. Is there anything I am doing wrong in the code that means the GPIO =20 port is reset? David --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .