swapna u
Member level 1

Hi all,
I have been working on the uart module of pic16f877a micro controller. I have gone through the registers used and I am aware of the configuration to use 8 bit communication.I am using interrupts for Tx and Rx.But I am facing problem in transmitting and receiving the data bytes as the RCREG buffer is not gettin updated, Please help me with the logic for transmission and reception.The initial conditions for uart configuration is done.I am tryin to transmit the recieved data through the code snippet below. Please help me with it.
/*ISR*/
void interrupt uart_rx(void)
{
if(RCIE && RCIF)
{
ClearUartRxIntFlag;
UART_TX(RCREG);
}
}
/*Tx function definition */
void UART_TX(unsigned int TX_BYTE)
{
TXREG = TX_BYTE;
while(!TRMT);
}
Thank you
I have been working on the uart module of pic16f877a micro controller. I have gone through the registers used and I am aware of the configuration to use 8 bit communication.I am using interrupts for Tx and Rx.But I am facing problem in transmitting and receiving the data bytes as the RCREG buffer is not gettin updated, Please help me with the logic for transmission and reception.The initial conditions for uart configuration is done.I am tryin to transmit the recieved data through the code snippet below. Please help me with it.
/*ISR*/
void interrupt uart_rx(void)
{
if(RCIE && RCIF)
{
ClearUartRxIntFlag;
UART_TX(RCREG);
}
}
/*Tx function definition */
void UART_TX(unsigned int TX_BYTE)
{
TXREG = TX_BYTE;
while(!TRMT);
}
Thank you