I've checked the bootloader code, as well as read the config bytes out and checked them that way. I'll try disabling interrupts explicitly. Wdt is indeed disabled and the period set to the maximum. Thanks, I'll post if I figure it out. On Thursday, December 21, 2017, Brent Brown wrote: > On 21 Dec 2017 at 1:14, andrew kelley wrote: > > > Still it bothers > > me as to why the code runs fine on a 18f4550, but not a 18f2550. Not th= e > > target code mind you, but the simplest test code that reproduces the > > issue. > > > > > > char degCtr; > > void main(void) > > { > > char tmp; > > TRISB=3D0; > > degCtr=3D0; > > while(1) > > { > > tmp=3D255; > > while(tmp) tmp--; > > tmp=3D255; > > while(tmp) tmp--; > > degCtr++; > > LATB=3DdegCtr; > > } > > } > > > > I have in the past had problems with compiler supplied header files > altering the > behaviour of the config macros, between chips and between compiler > versions, > although in my case it was Hi-Tech/MicrochipXC8. With that in mind, and i= f > not tried > already, I'd double check with and without WDT enabled, even change the W= DT > period to see if it's related. > > Not shown in your code above is disabling of interrupts. Perhaps the > bootloader is > leaving something in an unexpected state. > > -- > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=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 .