This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Debugging UART

Other Parts Discussed in Thread: TM4C123GH6PM

Hi,

I've been programming a TM4C123GH6PM using CCSv6 and I was able to check if UART0 worked using putty, but looking at the registers during debugging (UART_DR_DATA to be concrete, which shows data transmitted or received) its value is 0 always. Nevertheless, I could see at putty that it works properly. The question is, how can I know if it is working or not just using the debug? Maybe I am wrong but if I want to use a different UART I will not be able to see through putty for example if it is working properly or not.

Thanks,

Javier

  • Hello Javier,

    The UARTDR is a FIFO entry register. Writting the value to the register will push the data into the FIFO (if FIFO is enabled) or cause a transmission. Reading the register will yield the value from the RX line (if FIFO is not enabled) or from the RXFIFO head pointer if the FIFO is enabled.

    If Console work it works...

    Regards
    Amit
  • Amit, I think the user wanted a solution to debug a UART besides UART0. But I agree, if in the console it works, it works! I find it best to actually do the first tests always with the console so, to Javier:

    The best option IMO opinion is to get a FTDI or other Serial-USB converter and test the others UARTs that way - this is useful if you need more than 1 UART working at the same time and need to test them.
    For just 1 UART: one thing I did was set the PA0 and PA1 to floating inputs (the UART0 RX and TX). Then I connected the UART of my choice to the "TXD" and "RXD" pins. Those are actually PA0 and PA1 which are connected to the debugger serial to USB interface.

    Better than that is a logic analyzer or a scope. I like personally those USB logic analyzers that you can tell them to decode protocols like UART! But I think the console will work for practically all first tests (you could possibly have it receive in hexadecimal) and a Serial-USB interface doesn't cost 100$ or more :p

    I hope it helps.
  • It helped indeed. I was thinking about the FTDI or serial converter but thought it was possible just with the debugger.

    Thanks,
    Javier