Also watch out for the JTAG pins (TMS, TCK, TDI and TDO). These are normally enabled by default but disabled when debugging thrugh the ICSP interface (PGEx/PGDx). The debug executive also uses a small amount of ram. Another thing is that the debugger pulls up the MCLR pin. If you don't have a pullup resistor on this pin on your board and it is used as MCLR (and not a GPIO) your circuit will not work or work sporadically. This is also a common fault when the program works with the debugger but not by its own. /Ruben > On 15/10/2014 15:34, Tam=E1s Fekete wrote: >=20 > > I don't know what could be the difference between the microcontroller > > beeing in debug mode and beeing in normal running mode. >=20 > There are some. The one that I faced myself is the register ADPCFG > (AD1PCFGL in your case). When debugging the debug executive sets all the > analog pins to digital because some PGC/PGD pairs are shared with analog > inputs. When your program is running without the debugger, there is no > debug executive to set them for you. >=20 > Isaac >=20 >=20 >=20 --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .