Correct Way of using USART on PIC 16

Status
Not open for further replies.

wind_blast942

Newbie level 3
Joined
May 19, 2011
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,301
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!
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…