Thanks Andre, but I was not even looking at the code, I was trying to get rid of the warning. John Ferrell 6241 Phillippi Rd Julian NC 27283 Phone: (336)685-9606 johnferrell@earthlink.net Dixie Competition Products NSRCA 479 AMA 4190 W8CCW "My Competition is Not My Enemy" ----- Original Message ----- From: "andre abelian" To: Sent: Monday, October 13, 2003 7:48 PM Subject: Re: [PIC]: C18 prototype help > 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 > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu