RealTerm – Serial Terminal for embedded debugging: Guide

We need monitoring software for capturing and debugging data streams in serial communication, they are called serial terminals. To be a little more precise, serial terminals are software tools used for development purposes, debugging and reverse engineering. They are useful for sending and receiving data sent by serial communication protocols, most notably RS-232 or UART. An example for serial terminal programs is RealTerm. It can be used for monitoring, controlling and viewing serial data. The name ‘terminal’ comes from earlier computer terminal which was used for entering and retrieving data. Present terminal software is emulating the same experience.

Commonly used serial terminal programs

One of the most familiar terminal programs is Hyperterminal which was earlier provided with Microsoft Windows. There are also some other tools available including,

  • RealTerm
  • Tera Term
  • YAT – Yet Another Terminal
  • CoolTerm
  • Q Serial Terminal

And the list is a never-ending one. At Etiq, we are using RealTerm for our serial debugging purposes. It is one of the feature rich terminal available so far.

RealTerm

RealTerm is feature-rich because they can display data in different formats including ASCII, ANSI, Hex, integer (8 bit and 16 bit), Binary, Nibble, and float. Once the user gets familiar with the RealTerm interface, you will be using this tool for all your debugging purposes. It has the options for capturing the received data to the file, even can save it as hex and have the option to add timestamps in different formats. They can send the data strings in different formats and different end of line characters can be added easily.
RealTerm is an open source software program, so it is free to use and distribute. You can download it from this Sourceforge link.

Debugging serial communications

UART is a one-to-one protocol, only two devices connect each other at a time. So for debugging a device which is communicating using UART protocol, we need to emulate the functionality of the other device in the serial terminal. This can be achieved by giving port responses incorrect timing.

Using RealTerm for RS-232 debugging

UI of RealTerm feels rather messy comparing with other terminal programs. There are so many options and different tabs in the window. But once you become familiarized with the software, it will be an unavoidable tool.

Setting up the connection

setting-up-connection-realterm-guide
Setting up the connection: RealTerm

For setting up the port connection, select the port tab. In this tab, first, select Baud rate by clicking on the drop-down menu. Next, select the port. In order to see the correct port number, you may need to double-click on this field. For direct serial connections, the port will be 0 or 1 usually and for serial to USB converter, it will be larger. If you have confusion over the selection of port, check Device Manager. The device will be listed under Ports (COM & LPT).

finding-serial-device-port-number-device-manager
Finding serial device port number: Windows device manager

Select corresponding parity, data bits, stop bits, hardware flow control, and software flow control sections. In normal cases, a default value will be enough. After selection, click on the open button. Then it will be changed to a pressed button state (see the above RealTerm’s window, open button is in pressed state). The port status on status bar’s (bottom) right section will be changed to the selected port details.
In the above setting, we have used a 9600 baud rate and the device is connected to COM5. You can see the port details in the bottom right corner.

View data

setting-data-formats-realterm-guide
Selecting different data formats: RealTerm

One of the main features of RealTerm is the option to display data in different formats. The data format can be selected in Display tab of RealTerm.
The “Display As” section lists different data formats. Select one appropriate to your debugging purpose. Select the “Half Duplex” check-box, if you need to see what you’ve entered to the terminal. Selecting the ‘newLine mode’ will display the terminal output as the different line. The option is also there to see the inverted output.

Capturing data into files

There will be a situation where you may need to store the terminal data. You can use the Capture feature from the RealTerm for that. You can store time stamp, select delimiter (separator between two data) and specify when to stop capturing.

capturing-serial-data-into-files-realterm-guide
Capturing serial data: RealTerm

Sending long data

If you have long data, repeated data or a data from the file, RealTerm can process these too. You can use “String to Port” drop-down menu (please see the below picture)and the “File to Port” in Send tab of RealTerm. Enter the data there, and send it. You can directly send the previously sent data by using the drop-down menu.

String to Port

In this option, you can send the string as characters or as ASCII. You can choose the end of line(EOL) characters like CR (Carriage Return), LF (Line Feed), CRC (CRC16, 17 bits Cyclic Redundancy Check) etc. End of line characters denotes the end of the line. There is also a check-box to select “\n” before or after the string.
There is also an option to select the number of times the string would be repeated. If you want to strip the spaces from the string, tick the “Strip Spaces” check-box.

File to Port

sending-long-and-file-data-realterm-guide
Sending files to port directly: RealTerm

RealTerm can also dump the file to serial port directly. You can also specify the number of times it should be repeated and the delay in between each. In the delays section, you can specify the delay between characters (first field) and lines (second field). In the above image, we have dumped a file and the content is echoed back to the port.

RealTerm is an excellent tool for capturing, entering and debugging serial communications. It can display the data in different formats, automate data capture and enter and it has so many useful features. It could be regarded as an inevitable tool in embedded engineer’s life.

In the above image, we have dumped a file and the content is echoed back to the port.