Missing binary data in UART receive interrupt

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
tayoc_301426
Level 1
Level 1

A binary data reception interrupt program is being created using CY8CKIT - 059.

The communication conditions are 19,200 bps DataBit = 8 Parity = non stop = 1 Rx buffersizu = 100 and actual reception is about 30 characters.

The interrupt module was connected to the rx_interrupu terminal of the UART.

I created the code as follows, but sometimes the data dropout occurs.

I would appreciate it if you could give me advice on what is the cause and how I can solve it.

Below is the receive interrupt part

if ( UART_ReadRxStatus() == UART_RX_STS_FIFO_NOTEMPTY ){

bufsize = UART_GetRxBufferSize();

        for(i=0;i<bufsize;i++)

        {

        data_cnt++;

                rev_data[data_cnt]=UART_GetByte();

        } 

            if (data_cnt==22 )whm_rev_end=1;

}

0 Likes
1 Solution

I would suggest to use instead of

if ( UART_ReadRxStatus() == UART_RX_STS_FIFO_NOTEMPTY ){

rather

while ( UART_ReadRxStatus() & UART_RX_STS_FIFO_NOTEMPTY ){

Bob

View solution in original post

0 Likes
5 Replies