Introduction
This article documents the process on how to use the serial data UARTs and serial debug UARTs on Connect Tech Inc. carrier boards for NVIDIA Jetson modules. This document provides the necessary information needed to establish a serial connection such as the UART Number, header, pin numbers and serial port names used. Steps on how to connect to the serial debug console as well as how to perform a loop back test on the serial UARTs are also provided.
Background
TTL:
TTL serial or transistor-transistor logic is a method of serial communication. Serial communication refers to data transfer transmitting over one wire, one bit at a time. This communication will involve two parties, a receiver and a transmitter. TTL always operates between voltage levels 0V and VCC, where VCC is often 3.3V or 5V. A logic high (1) is represented by VCC and a logic low (0) is 0V. This differs from RS232 where the logic high and low are inverted. TTL serial has low cost, high compatibility with microcontroller and ease of use. Compared to RS232 and RS485 it is much more susceptible to noise, has limited speed and the lower voltage levels limit longer data transmission distances.
RS232:
RS232 is a standard protocol used for serial communication used for connecting a device and its peripheral devices to allow the exchange of serial data between them. It is best for medium length communication and can go up to 15 Metres with a rate of around 1,492 kbps. RS232 is voltage level-based and thus can be susceptible to noise and may allow for data corruption in electrically noisy environments. RS232 consists of 9 physical pins most importantly the Transmitter (Tx), Receiver (Rx), Ground (GND). It also has Request to Send (RTS) and Clear to Send (CTS) serial ports used for hardware data flow control. In RS232 binary 0 works with voltages from +5V to +15V whereas binary 1 works with voltages up to -5V to -15V.
RS485:
RS485 is another standard protocol used for serial communication. It offers a much longer operational distance of up to 1200 Metres and can have a data transmission rate of up to 10Mbps. RS485 implements differential data transmission and thus is much more immune to electrical noise allowing RS485 to provide longer data transfer distance, lower voltage use and increased data speed. Generally, RS485 operates on a voltage range from -7V to +12V. An RS485 serial interface can connect up to 32 devices to a single transmitter.
Minicom on Linux
To test the UART ports, we use Minicom in this example to send and receive information using TX and RX of a specific UART. The Rudi-NX board was used in this example. UART1 for the Rudi-NX can be accessed using the pins 36 and 37 on the I/O adapter. RS485 can be found on the same adapter on pins 30,31,32 and 33. In this example, these ports will be used to transmit and receive a message. To start off, Minicom is required on the Linux system being used. To install Minicom use the following command.
sudo apt-get install minicom
After minicom is installed, the command below can be used to access specific serial ports. The serial port name for UART0 is called ttyTHS0. Refer to the manual for more information about the names of the different serial ports that can be found on Connect Techs’ carrier boards. In this case, UART0 is called ttyTHS0.
minicom -D /dev/ttyTHS0
The main menu for Minicom will look like this:
PuTTY on Windows
PuTTY is a free SSH and telnet client for Windows and Unix platforms. You can download it here: https://www.putty.org/
Make sure your Windows PC is connected to the board’s debug serial console that you would like serial data from (for example on Quark this would be done using a TTL FTDI Serial cable to UART2 pins.)
Open PuTTY program on your Windows PC.
In PuTTY click on the Serial tab in the bottom left under Connection
Open Device Manager on Windows and go to the Ports section
Under Ports, if your serial cable is plugged in you should see USB Serial Port (COMx). In this example it is COM4.
In Putty->Serial, in the “Serial line to connect to” box, enter the COMx device you got from the Device Manager.
Under “Configure the serial line” set the Speed (baud) to 115200, “Data bits” should be 8 and “Stop bits” should be 1.
Click on the “Flow control” drop down and set it to None.
Your configuration should look like below:
Once you are done setting up your configuration, click on Open and a window should open with a green cursor.
Press “Enter” key and your Serial connection to the board should be started and you can use your device as normal.
The Quark manual page 18 has a good section on setting up Serial connection which can be found here: https://connecttech.com/ftp/pdf/CTIM_NGX004_Manual.pdf
Serial Console vs General UART
General UART (Universal Asynchronous Reciever/Transmitter) refers to the devices ports that are used for serial communication between other devices. UART is a hardware communication protocol that uses asynchronous serial communication with configurable speed. Every UART interface has a receiver pin and a transmitter pin on both ends of the connection. As seen in the figure below, the Receive (Rx) pin in one device will be connected to the Transmit (Tx) pin on the other device.
The serial console is a connection over the serial console port that allows a person access to a device’s console. Usually, the devices console can be accessed via an SSH connection, however if the device is not connected to the internet, you aren’t sure of the devices IP, or access to the device is limited for whatever reason, a person may access the console by serial connection. One will always use the UART ports designated for “Debug” or “Console” in order to make this connection and not the general UART ports used for device-to-device serial communication. A list of the ports designated for serial console can be found in the section "Serial Port Names".
Loop Back Test
Connect the TX pin to the RX pin of the debug UART on the device.
After connecting the TX pin to the RX pin, ensure that Hardware flow control is turned off. This can be turned off through the configuration menu. To open the configuration menu, Hold Ctrl+A then release and press “O”. This should open the menu below:
After the menu above appears, select the Serial port setup option and ensure that the Hardware flow control is turned off. This could be changed by typing “F” in the menu below:
Make sure that the new setup is saved as default to ensure that communication is successful while testing other ports.
The figure below demonstrates that the port is receiving the characters being sent using the terminal:
The same procedure can be followed to send and receive information using the RS485 port. When setting up the configuration, make sure that hardware flow control is turned off.
Serial Port Names
Module | Part Number | Carrier Name | UART Number | Header/Pins (Tx/RX) | Serial Port Names |
Xavier-NX |
NGX004 | Quark | UART0 | P7: 4,6 | /dev/ttyTHS1 |
UART1 | P7: 10,12 | /dev/ttyTHS0 | |||
UART2 (Console) | P7: 29,31 | ||||
NGX007 | Boson | UART0 | P12: 27,30 | /dev/ttyTHS1 | |
UART1 | P12: 36,37 | /dev/ttyTHS0 | |||
UART2 (Console) | P12: 13,14 | ||||
NGX006 | Rudi-NX | UART1 | Exp. I/O: 36,37 | /dev/ttyTHS0 | |
UART2 | Exp. I/O: 13,14 | /dev/ttyTCU0 | |||
RS485 | Exp. I/O: 30,31,32,33 | /dev/ttyTHS1 | |||
Nano |
NGX012 | Hadron | UART0 | P4: 22,24 | /dev/ttyTHS1 |
UART1 | P4: 27,29 | /dev/ttyTHS0 | |||
UART2 (Console) | Exp. I/O: 13,14 | ||||
NGX004 | Quark | UART0 | P7: 4,6 | /dev/ttyTHS2 | |
UART1 | P7: 10,12 | /dev/ttyTHS0 | |||
UART2 (Console) | P7: 29,31 | ||||
NGX007 | Boson | UART0 | P12: 27,30 | /dev/ttyTHS2 | |
UART1 | P12: 36,37 | /dev/ttyTHS1 | |||
UART2 (Console) | P12: 13,14 | ||||
TX2 |
ASG001 | Astro | UART0 | J1: 1,2 | /dev/ttyTHS2 |
UART1 (Console) | J1: 7,8 | /dev/ttyS0 | |||
ASG002 | Elroy | UART0 | P11: 3,4 | /dev/ttyS0 | |
UART1 | P11: 9,10 | /dev/ttyTHS2 | |||
ASG003 | Orbitty | UART0 | P4: 3,4 | /dev/ttyS0 | |
UART1 | P4: 5,6 | /dev/ttyTHS2 | |||
ASG005 | Rudi | UART1 | I/O: 9, 10 | /dev/ttyTHS2 | |
UART0 (Console) | I/O: 11,12 | ||||
ASG006 | Spacely | UART0 | P12: 2,4 | /dev/ttyS0 | |
UART1 | P12: 12,14 | /dev/ttyTHS2 | |||
AGX Xavier |
AGX101 | Rogue | UART1 | P3: 1,3 | /dev/ttyTHS0 |
UART2 | P3: 2,4 | /dev/ttyTHS1 | |||
AGX103 | Rogue-X | UART1 | P3: 1,3 | /dev/ttyTHS0 | |
UART2 | P3: 2,4 | /dev/ttyTHS1 | |||
AGX104 | Rudi-AGX | UART1 | Exp. I/O:36,37 | /dev/ttyTHS0 | |
RS485 | Exp. I/O:30,31,32,33 | /dev/ttyTHS4 | |||
UART_Debug | Exp. I/O: 13,14 | /dev/ttyS0 | |||
AGX Orin |
AGX201 | Forge | UART1 | P17: 13,15 | /dev/ttyTHS0 |
UART2 | P17: 14,16 | /dev/ttyTHS4 | |||
AGX202 | Rogue-O | UART1 | P3: 1,3 | /dev/ttyTHS0 | |
UART2 | P3: 2,4 | /dev/ttyTHS1 | |||
Orin-NX/Nano |
NGX012 | Hadron | UART0 | P4: 22,24 | /dev/ttyTHS1 |
UART1 | P4: 27,29 | /dev/ttyTHS0 | |||
UART2 (Console) | P4: 37,38 | ||||
NGX007 | Boson | UART0 | P12: 27,30 | /dev/ttyTHS1 | |
UART1 | P12: 36,37 | /dev/ttyTHS0 | |||
UART2 (Console) | P12: 13,14 | ||||
NGX006 | Rudi-NX | UART1 | Exp. I/O: 36,37 | /dev/ttyTHS0 | |
UART2 | Exp. I/O: 13,14 | /dev/ttyTCU0 | |||
RS485 | Exp. I/O: 30,31,32,33 | /dev/ttyTHS1 |