UART Register issues; How to clear UART FIFO register

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

cross mob
Level 1
Level 1
Hi there,

I am trying to read a one wire device using a UART to 1-wire adapter with an XMC4800 as the microcontroller. While I can read much of the information coming back from the UART-to-1-Wire device, I am having a lot of trouble reading the specific aspects I want.
For instance there are many native 1 wire commands such as SKIP-ROM, MATCH-ROM etc. Individual chips then have their own specific commands for performing functions they are defined for.
Using the current method, I have to send both types of commands (native 1-Wire and the chip's specific commands) using the UART app with DAVE. The UART adapter chip will convert the UART signal to a 1-Wire signal and return any data to the XMC which the 1-wire chip has sent back.
I'm analysing these signals with an external signal reader and can see that all the bytes have the correct values. The issue lies with my implementation of the Dave UART app, in that often it will send back old bytes which I do not need nor want to read.
For example, it will send back the return bytes from some of the Native 1-wire commands, which I actually don't need to read at the point time. Meanwhile, it is as if these data bytes are stored so that later when I attempt to read back more important data, these bytes will be forced into the array I have created for the important information.
Is there a FIFO register which is being filled up with this information, eventhough I'm not asking for the information to be read programmatically? Is there a way to clear this register, so that when I want to start reading information I will immediatley get the most recent data bytes instead of ones that were sent ages ago?

UART Settings:
Full duplex mode
Transmit mode: interrupt
Receive mode: interrupt
Enable receive FIFO, size 64

Dave function I'm using to receive data:
read_data_response =(uint8_t)XMC_UART_CH_GetReceivedData(;

I'm sorry for the long-winded explanation. I hope it was clear enough to understand with enough information that clears explains the issue I'm having with the UART App. Any help with this matter would be much appreciated.
0 Replies