Hello,
We are using the TL16CP754C for communication. Common speed settings are 115200,8,N,1.
From time to time we saw some (1,2) bytes in RX FIFO on start receiving. I think UART FIFO didn't clear well. Please, help how to clear all FIFOs.
Our FIFO purge function use FCR to clear FIFO:
OUTREG8(&pUartRegs->FCR, FCR_Copy | UART_FCR_RX_FIFO_CLEAR | UART_FCR_TX_FIFO_CLEAR);
but next actions are not easy, and I confused:
Datasheet say "FCR is read only register", therefore after FCR write I need:
- waiting for several milliseconds (1 msec used now)
or
- use readonly IIR register bits 7-6: copy of FCR(0) FCR(0) bits and waiting for 0 it both. (yes, documentation is "excellent")
First way work from time to time (as I noted before).
Second way completly doesn't work, becouse IIR is always 0xC1, and I never saw it's 6 and/or 7 bit will clear after FCR FIFO clear command.
What is wrong in my code? How to real clear TL16CP754C FIFO with 100% guarantee?
BW,
Alexey Kuzmin