Hi all,
I am using the following code for UART communication between the PC and the 18f microcontroller (on 20MHz). Can someone please tell me why not all characters are being echoed correctly when tested using PuTTY??
I am using the following code for UART communication between the PC and the 18f microcontroller (on 20MHz). Can someone please tell me why not all characters are being echoed correctly when tested using PuTTY??
Rich (BB code):
void main(void)
{
unsigned char dat;
TXSTA = 0X24;
RCSTA = 0X90;
SPBRG = 0X81;
while(1)
{
while(PIR1bits.RCIF == 0);
dat = RCREG;
TXREG = dat;
while(PIR1bits.TXIF == 0);
}
}