Hey my UART is not working. The engineer looks at his microcontroller board or even worse FPGA board.
How many times I have heard it.
UART we have a problem..
This is generic way to troubleshoot RS232C UART problem.
It is called loopback: you take tweazers, and short pins 2-3 creating a TXD to RXD loopback.
And this is how to test UART problem with FPGA - you create a HARD LOOPBACK without using the tweazers: you just say I want electrical signal from UART input to be forwarded to the UART output.
Whenever you have UART issue, be it with real RS232C cable or with FPGA, the first thing to try is echo.
If you get ECHO back then you know that
- the terminal you use to send out data to the cable you think it shoud does do it
- the terminal you use can can actually send and receive data
- that the hardware that is connected to the cable you think the terminal sends data is actually working
Echo loopback with Microcontroller is a bit harder task, it depends on the microcontroller, toolchain, language, peripherals, O/S and libraries being used. If the UART pins can be configured as GPIO, then the "hard loopback" can be implemented as tight loop with GPIO read and writes.