Here i have made an UART0_IRQHandler routine. When i try to send some 50 bytes data through UART using PC tool here its receiving bytes, but it only receives 1st 6 bytes which i send. After that nothing is happening. I am not getting any interrupt after that.
Here i even referred nRF51_Series_Reference_Manuel there they have written that,
The UART receiver chain implements a FIFO capable of storing six incoming RXD bytes before data is overwritten. Bytes are extracted from this FIFO by reading the RXD register. When a byte is extracted from the FIFO a new byte pending in the FIFO will be moved to the RXD register. The UART will generate an RXDRDY event every time a new byte is moved to the RXD register.
Here in my case bytes form FIFO are not getting written to RXD register after 1st cycle ??
Can anybody help me out with this??? Here below is the Interrupt routine which i made.
void UART0_IRQHandler(void) {
// Handle reception
if (NRF_UART0->EVENTS_RXDRDY != 0)
{
// Clear UART RX event flag
NRF_UART0->EVENTS_RXDRDY = 0;
if(st_rcvmsg_ok==false) // Protect Against RxBuffer OverWrite
{
st_rcvtimeout = TIME_BTWN_TWO_CHAR; // Time out between two char
rx_buf[st_rcvcntr] = (uint8_t)NRF_UART0->RXD; // Write received byte
st_rcvcntr++;
if(st_rcvcntr==2)
{
rx_msg_len=(rx_buf[1]+(rx_buf[0]*256));
}
if(st_rcvcntr>=3)
{
if(st_rcvcntr == (rx_msg_len + 2))
{
if(initialization_complete_flg) //flag set after uart initilization.
{
st_rcvmsg_ok = true; // Just set flag and call routine from while(1)
st_rcvcntr=0;
st_rcvtimeout = 0;
}
}
}
}
}
// Handle errors.
if (NRF_UART0->EVENTS_ERROR != 0)
{
// Clear UART ERROR event flag.
NRF_UART0->EVENTS_ERROR = 0;
}
}