hi all.. can i know why is there syntax error at the main end.
please take a look at my code and help me in rectifying the problem..
thanks!
please take a look at my code and help me in rectifying the problem..
thanks!
Code:
#include <p18C452.h>
#include <usart.h>
void main(){
char rx1='k';
// configure USART
OpenUSART( USART_TX_INT_OFF &
USART_RX_INT_OFF &
USART_ASYNCH_MODE &
USART_EIGHT_BIT &
USART_CONT_RX &
USART_BRGH_HIGH,25 );
while (1)
{
if (DataRdyUSART())
{
if(RCSTAbits.OERR)
{
RCSTAbits.CREN=0;
Nop();
RCSTAbits.CREN=1;
printf("\n\r OERR");
}
if(RCSTAbits.FERR){
printf("\n\r FERR");
while(!DataRdyUSART()){
printf("\n\r FERRin");
rx1=RCREG;
}
}
rx1=RCREG;
printf("\n\rkey detected:");
while(!BusyUSART());
WriteUSART(rx1); //writing a byte to the USART
}
} //main end <<<<<<<<<the syntax error