Friday, 25 September 2015

Display the characters between * and # using USART in PIC16F877A

#include<pic.h>
void main()
{

char c;
TRISC=0X80;
TXSTA=0X24;
RCSTA=0X90;
SPBRG=0X19;

while(RCIF==0);
c=RCREG;
RCIF=0;
if(c=='*')
while(1)
{
while(RCIF==0);
c=RCREG;
RCIF=0;
if(c=='#')
break;
TXREG=c;
while(TXIF==0);
TXIF=0;
}
}

No comments:

Post a Comment