13. SERIAL PORTS
This page describes the serial port software configuration details and how to change the protocol modes.
The serial ports on the Nano & Xavier NX are available at different device IDs. The device IDs are provided as below:
SER 1 --> DB9M-1 --> ttyTHS2
SER 2 --> DB9M-2 --> ttyTHS1
Protocol selection can be done by setting jumper configuration as per section 9.3. The protocol can also be set from software by running the following command.
sudo prtsel_util rs485; // enable rs485 protocol for SER2
sudo prtsel_util rs232; // enable rs232 protocol for SER2
When the protocol is set to RS485 for SER2 port:
From the transmitter node, it is essential to enable the RTS during transmit & disable it thereafter. Since, the auto RTS feature is not supported on Nvidia serial port drivers, the RTS signals would need to be enabled manually just before transmit & disabled right after the transmission. The following commands are used for these purposes:
On Nano:
sudo rs485_util ttyTHS2 1; // enable RTS for SER 1
// to transmit
sudo rs485_util ttyTHS2 0; // disable RTS for SER 1
// to receive
sudo rs485_util ttyTHS1 1; // enable RTS for SER 1
// to transmit
sudo rs485_util ttyTHS1 0; // disable RTS for SER 1
// to receive
On Xavier NX:
sudo rs485_util ttyTHS0 1; // enable RTS for SER 2
// to transmit
sudo rs485_util ttyTHS0 0; // disable RTS for SER 2
// to receive
sudo rs485_util ttyTHS1 1; // enable RTS for SER 1
// to transmit
sudo rs485_util ttyTHS1 0; // disable RTS for SER 1
// to receive
If both the jumper & the software tries to set the protocol mode of the serial port SER 2, then the software control takes precedence.
Last updated
Was this helpful?