Alan, I tried your code. After I fixed the syntax errors I still get this=20 error on the two for loops in the wait_ms and wait_seconds routines. hFunctions.h:363: error: (199) logical type required I just can't figure this out. Thanks, rich! The way to get it right is to do it right the first time. Otherwise the pro= gram becomes a mess and it gets too hard to determine just why it works, ra= ther like a Basic program that has goto's that take the program flow all ov= er the place. I would prefer to see the code set out like this: - extern void wait_us(unsigned int delay) { for(; delay; delay--) { NOP(); //This is about 500 nS at 1 MHz } } extern void wait_ms(unsigned int milliseconds) { Int ms; For(ms=3Dmilliseconds*1000, wait_us(1),ms--); //This gives us= 1 millisecond } extern void wait_seconds(unsigned int seconds) { Int secs; for(secs =3D seconds*1000,wait_ms(1),secs--); //This is one seco= nd } And then you need to look at the assembly instructions for the wait_us() fu= nction, because the for loop itself is going to take several microseconds w= ithout the nop(). --=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 .