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