In a Vivado design targetting Zynq7020 I have both UART ports enabled. The purpose of my design is to forward into UART0 any character received from UART1 and vice-versa. Both UART ports are conencted to COM ports in my PC each one with a terminal open so that I can type chars. I am using the Zynq 7020 UARTs in interrupt mode and I have it almost working.
The problem that I am seeing is that the characters forwarded to the forwarding port are always one character behind. For example:
If I first type the char "A" on the COM port connected to UART1; nothing appears in UART0.
If then I type the char "B" on the COM port connected to UART1; the char "A" appears in UART0.
If then I type the char "C" on the COM port connected to UART1; the char "B" appears in UART0.
The same happens if I type chars in the COM port connected to UART0: the chars appearing in UART1 are one char behind.
Why could the cause for that?
I am attaching my code; which I leveraged from the "xuartps_intr_example.c".
Can you shwo your interrupt sensitivity. Is this level, or edge. It might be on level. Also, the interrupt will occur when the fifo is full, half full, ect. So, how is this configured as this would have an impact too