Reputation: 1
I am trying to recieve 1 character using the USART feature on PIC 16.
Both the transmitter and receiver are both PIC 16s.
Can i check if the way to call the receive function is correct conceptually
char tmp;
CREN = 0;
CREN = 1;
while(!RCIF);
if(OERR==1)
{
tmp = RCREG;
tmp = RCREG;
CREN=0;
DelayMs(5);
CREN=1;
}
else
{
tmp = RCREG;
}
CREN = 0;
Many thanks in advance!
Upvotes: 0
Views: 1781
Reputation: 10937
You must first initiate the UART.
Upvotes: 1