John, Your led RA4 will always stay off or you will see a glitch because right after turning Led on the beginning of the code your are turning it off. This is what I would do. void BlinkAlive(void) { if (!(--ALIVECNT)) // Decrement loop counter and return { ALIVECNT = 250; // Reinitialize BLNKCNT PORTAbits.RA4 ^= 1; // Xor toggle led on/off } } the compiler should generate BTG PORTA,4 ; bit toggle in asm I use hi-tech but it should be the same for c18 Andre Abelian -----Original Message----- void BlinkAlive() { PORTAbits.RA4 = 1; // Turn off LED if (!(--ALIVECNT)) // Decrement loop counter and return if not zero { ALIVECNT = 250; // Reinitialize BLNKCNT PORTAbits.RA4 = 0; // Turn on LED for ten milliseconds } } -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu