# How to debug UART?

The firmware of my module supports UART printf() which I think could be good for debugging, but how could the messages be read? I'm currently using just a USB-to-Serial cable. I've tried using PuTTy, but all I see is gibberish, e.g.,

▒)▒ɜ▒] ▒▒▒▒9~▒!▒▒!▒▒▒▒▒▒J=▒▒H▒] ▒,▒▒H9▒ ▒▒H▒▒Ȇ

Is PuTTy actually right for the job?

• Putty should be fine. Check the serial settings, partularly data/baud rate. The USB driver will use these settings to configure the UART inside the USB module. – DoxyLover May 2 '15 at 18:15
• For low-level debug etc. I find Terminalbpp by "Br@y" a much better tool than Putty, it can show you the raw binary it receives as hex values rather than just mangled ASCII - sites.google.com/site/terminalbpp – John U Nov 6 '15 at 17:12

Have you checked your baud,start,stop settings? Try with different values (e.g. 9600,n,8,1)

• All good now. It needs 115200. – Kar May 2 '15 at 18:45

If you have some money to invest I recommended a logic analyser. I suggest: www.saleae.com.

In this capture software you can set up communication (USART, SPI, I2C ..) and see the decoded data in various ways.

• While a logic analyzer could be useful for certain things, you don't need any money to invest to read the data output through a properly working UART interface of known baud rate & parity settings. Any decent free/open-source/bundled-with-your-favourite-OS terminal software will do the jobs for this case. – Laszlo Valko Nov 7 '15 at 4:19
• I partly agree, but when you need a properly DEBUG, something that debugs the hardware..the fisical signal is important like a osciloscope or logic analyser. – Gabriel Rezende Germanovix Nov 7 '15 at 4:27

The output you posted looks like it contains non-printable characters. In this case, you may try out HTerm. The page is german, but the program is english.

It doesn't only show lots of RS232 settings, it also show data simultaneously in ASCII, hex, decimal and binary. It also allows to send given data every x seconds.

(Of course, this doesn't help if you need to debug the signal transmission itself.)