Trigger UART Rx if one byte has been received

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

cross mob
Not applicable
Hello,

I work with Dave 4 and try to detect that the UART receive one byte. I switched the RX-FIFO off. I got the byte read only when a second byte has been received.
It's always a delay of one received byte.

My code is:

if (XMC_USIC_CH_GetReceiveBufferStatus(XMC_UART1_CH1) > 0)
{
UART_Receive(&UART_0, (uint8_t *) & read_data, 1);

How to code that if one byte arrived that I could read it immediatly? Maybe based on an interrupt? I need to avoid to poll again and again.

Kind regards
Kurt
1 Reply
Not applicable
Solved.

I had to code

if (XMC_USIC_CH_GetReceiveBufferStatus(XMC_UART1_CH1) > 0)
{
read_data=(uint8_t)XMC_UART_CH_GetReceivedData(XMC_UART1_CH1);

It's working now.
0 Likes