Okay, so I have used the disassembly window before, but never enough =20 to notice that library functions would be broken down there also. =20 Neat. I've been playing with it and whittling down the code to as =20 little as possible and I have a new revelation. The delay functions are not the issue. I have two versions of code, =20 only one of which works, and the difference is a local vs. global =20 variable. If I use the variable locally inside of the main function, =20 it stops working. I have disassemblies of both, and will break it =20 down later. Perhaps someone here can easily catch something I'm doing =20 wrong. This is the code... unsigned char i; void main(void) { unsigned char i; // <--- Comment this out and the code works OSCCON =3D 0b00010000; // 1 Mhz internal OSCCON2 =3D 0b00000000; OSCTUNE =3D 0b00000000; TRISA =3D 0b11011111; TRISB =3D 0; TRISC =3D 0; ANSELA =3D 0b00000011; ANSELB =3D 0; ANSELC =3D 0; LATA =3D 0b00000000; LATB =3D 0; while (1) { LATC =3D 0b01010101; // '0's will turn LED's on. for (i=3D0; i<250; i++) Nop(); LATC =3D 0b10101010; // '0's will turn LED's on. for (i=3D0; i<250; i++) Nop(); } } // main() Cheers, -Neil Quoting smplx : > > > On Fri, 29 Nov 2013, Neil wrote: > > Track down the delay functions in question and check to see if they are > implemented as macros, intrinsic or real sub-routines. If macros, try to > work through them by hand. If they are not straight forwards write your > own versions that are. If they are intrinsic try to find a compiler switc= h > or keyword to turn this off (might actually need you to remove the keywor= d > intrinsic from a header file. > > Regards > Sergio Masci > -- > 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 .