Thanks, Alex. As you suspected, the problem turned out to be in the comment lines immediately preceding the delay_1_msec function declaration. The errors disappeared once I removed those comment lines. Now I understand why it's so important to archive the source code as you accomplish various things while working on a program. Even comment lines can be misinterpreted by a compiler. How can comment lines be misinterpreted by a compiler? Comment lines are SUPPOSED to be ignored by the compiler. What went wrong here? More importantly, how do you tell if a compiler is misinterpreting your source code? My code looked fine in MPLAB, Geany, and Leafpad. I don't know how I'm supposed to tell if I'm relying on editing tools that don't show me what the compiler sees. On Sun, Feb 28, 2010 at 11:22 PM, Alex Harford wrote: > I know, but there is something funny going on. =A0I looked at it with > 'xxd' and you have a CR/^M/0x0D with no LF/0x0A, and I will bet that's > confusing the compiler. > > I'm willing to bet if you took these lines out: > > // This method of providing delays isn't efficient with respect to > clock cycles. =A0It takes 9 usec to decrement a variable. =A0However, it > does work.^M// Purists advocate inserting Assembly language into the > code. =A0My attempts to implement this were not successful. > // Executing delay_1_msec 1000 times takes about 1 sec.^M//void > delay_1_msec (void) > > and retyped > > void delay_1_msec (void) > > with the remaining part of the function uncommented, it would work. > -- = Jason Hsu http://www.jasonhsu.com/swrwatt.html http://www.jasonhsu.com/swrwatt-c.txt http://www.jasonhsu.com/swrwatt-asm.txt -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist