/*ISR*/
void interrupt uart_rx(void)
{
while(!RCIF)
continue;
ClearUartRxIntFlag;
UART_TX(RCREG);
}
/*ISR*/
void interrupt uart_rx(void)
{
while(!RCIF)
continue;
ClearUartRxIntFlag;
UART_TX(RCREG);
}
main()
{
unsigned char c, r;
------
tx(c); \\Function to transmit a character.
DelayMs(100); \\A simple Delay Function.
r=rx(); \\Function to receive a character.
lcd(r); \\Lcd Display of the received char.
}
void tx(unsigned char ch) \\Body of the function to perform Tx operation
{
TXEN=1;
TXREG=ch;
tx_wait();
}
unsigned char rx() \\Body of the function to perform Rx operation
{
unsigned char ch;
CREN=1;
rx_wait();
letter2=RCREG;
return ch;
}
void tx_wait()
{
while(!TXIF)
continue;
TXIF=0;
}
void rx_wait()
{
int i;
while(OERR){
for(i=0;i<2000;i++)
{i=i+1;}
CREN=0;
OERR=0;
}
CREN=1;
while(!RCIF)
continue;
RCIF=0;
}
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?