RAIBOX-ORNX Serial Communication Interfaces Tutorial | Forecr - Forecr.io

RAIBOX-ORNX Serial Communication Interfaces Tutorial

Jetson Orin NX

19 July 2023
WHAT YOU WILL LEARN?

1- The pinout of I/O connector

2- Installing GtkTerm

3- Testing the serial communication interfaces

ENVIRONMENT

Hardware: RAIBOX-ORNX



In this blog post, we will look at the pinout diagram of I/O connector on RAIBOX-ORNX. Then, we will install GTKTerm serial connection application. Finally, we will test the RS232, RS422 & RS485 connections.

The Pinout of I/O Connector

First, let's look over the 12 pin IO connector. On the connector, there are 8 serial communication, 2 ground pins.

Installing GTKTerm

To test all serial communication interfaces, open a new terminal and install the GtkTerm program for ease of use (make sure Ethernet cable is connected). You can install GtkTerm with this terminal command:


sudo apt install gtkterm

Testing the Serial Communication Interfaces

Run the GtkTerm program with arguments. On the host side, you can use TeraTerm or Putty for Windows; GtkTerm for Ubuntu OS.


RS232 Test


To test RS232 functionality, we use a DSBOX-TX2NX as a test equipment. (If you use a USB-Serial adapter, connect that adapter to the USB port of the host PC and install its driver software if necessary.) To the other side of the connector, connect your device’s RS232 pins with cross-connection (Rx to Tx, Tx to Rx). You can find the hardware pins below. 

After proper connection, you should do pin multiplexing on your device to use serial port as RS232. 


To do this, open new terminal then type these commands below for channel-0.


sudo sh -c "echo 471 > /sys/class/gpio/export"
sudo sh -c "echo 470 > /sys/class/gpio/export"
sudo sh -c "echo 485 > /sys/class/gpio/export"
sudo sh -c "echo 468 > /sys/class/gpio/export"
sudo sh -c "echo low > /sys/class/gpio/PY.01/direction"
sudo sh -c "echo low > /sys/class/gpio/PY.00/direction"
sudo sh -c "echo high > /sys/class/gpio/PZ.07/direction"
sudo sh -c "echo low > /sys/class/gpio/PX.06/direction"


Open new terminal then type these commands below for channel-1.


sudo sh -c "echo 474 > /sys/class/gpio/export"
sudo sh -c "echo 473 > /sys/class/gpio/export"
sudo sh -c "echo 472 > /sys/class/gpio/export"
sudo sh -c "echo 469 > /sys/class/gpio/export"
sudo sh -c "echo low > /sys/class/gpio/PY.04/direction"
sudo sh -c "echo low > /sys/class/gpio/PY.03/direction"
sudo sh -c "echo high > /sys/class/gpio/PY.02/direction"
sudo sh -c "echo low > /sys/class/gpio/PX.07/direction"


If you are using GtkTerm on Ubuntu, run this command below for channel-0. If you have done everything correctly, you could see your keyboard presses on the other machine's serial terminal.


sudo gtkterm -p /dev/ttyTHS1 -s 115200

If you are using GtkTerm on Ubuntu, run this command below for channel-1. If you have done everything correctly, you could see your keyboard presses on the other machine's serial terminal.


sudo gtkterm -p /dev/ttyTHS0 -s 115200



RS422 Test


To test RS422 functionality, we use a DSBOX-TX2NX as a test equipment. (If you use a USB-Serial adapter, connect that adapter to the USB port of the host PC and install its driver software if necessary.) To the other side of the connector, connect your device’s RS422 pins with cross-connection (Rx to Tx, Tx to Rx but positive to positive, negative to negative). You can find the hardware pins below. 

After proper connection, you should do pin multiplexing on your device to use serial port as RS422. 


To do this, open new terminal then type these commands below for channel-0.


sudo sh -c "echo 471 > /sys/class/gpio/export"
sudo sh -c "echo 470 > /sys/class/gpio/export"
sudo sh -c "echo 485 > /sys/class/gpio/export"
sudo sh -c "echo 468 > /sys/class/gpio/export"
sudo sh -c "echo high > /sys/class/gpio/PY.01/direction"
sudo sh -c "echo low > /sys/class/gpio/PY.00/direction"
sudo sh -c "echo high > /sys/class/gpio/PZ.07/direction"
sudo sh -c "echo low > /sys/class/gpio/PX.06/direction"


Open new terminal then type these commands below for channel-1.


sudo sh -c "echo 474 > /sys/class/gpio/export"
sudo sh -c "echo 473 > /sys/class/gpio/export"
sudo sh -c "echo 472 > /sys/class/gpio/export"
sudo sh -c "echo 469 > /sys/class/gpio/export"
sudo sh -c "echo high > /sys/class/gpio/PY.04/direction"
sudo sh -c "echo low > /sys/class/gpio/PY.03/direction"
sudo sh -c "echo high > /sys/class/gpio/PY.02/direction"
sudo sh -c "echo low > /sys/class/gpio/PX.07/direction"


If you are using GtkTerm on Ubuntu, run this command below for channel-0. If you have done everything correctly you could see your keyboard presses on the other machine's serial terminal.


sudo gtkterm -p /dev/ttyTHS1 -s 115200


If you are using GtkTerm on Ubuntu, run this command below for channel-1. If you have done everything correctly you could see your keyboard presses on the other machine's serial terminal.


sudo gtkterm -p /dev/ttyTHS0 -s 115200



RS485 Test


To test RS485 functionality, we use a DSBOX-TX2NX as a test equipment. (If you use a USB-Serial adapter, connect that adapter to the USB port of the host PC and install its driver software if necessary.) To the other side of the connector, connect your device’s RS485 pins. You can find the hardware pins below. 

After proper connection, you should do pin multiplexing on your device to use Serial Port as RS485.


To do this, open new terminal then type these commands below for channel-0.


sudo sh -c "echo 471 > /sys/class/gpio/export"
sudo sh -c "echo 470 > /sys/class/gpio/export"
sudo sh -c "echo 485 > /sys/class/gpio/export"
sudo sh -c "echo 468 > /sys/class/gpio/export"
sudo sh -c "echo high > /sys/class/gpio/PY.01/direction"
sudo sh -c "echo high > /sys/class/gpio/PY.00/direction"


Open new terminal then type these commands below for channel-1.


sudo sh -c "echo 474 > /sys/class/gpio/export"
sudo sh -c "echo 473 > /sys/class/gpio/export"
sudo sh -c "echo 472 > /sys/class/gpio/export"
sudo sh -c "echo 469 > /sys/class/gpio/export"
sudo sh -c "echo high > /sys/class/gpio/PY.04/direction"
sudo sh -c "echo high > /sys/class/gpio/PY.03/direction"


To write data for channel-0:


sudo sh -c "echo high > /sys/class/gpio/PZ.07/direction"
sudo sh -c "echo high > /sys/class/gpio/PX.06/direction"

To read data for channel-0:


sudo sh -c "echo low > /sys/class/gpio/PZ.07/direction"
sudo sh -c "echo low > /sys/class/gpio/PX.06/direction"


To write data for channel-1:


sudo sh -c "echo high > /sys/class/gpio/PY.02/direction"
sudo sh -c "echo high > /sys/class/gpio/PX.07/direction"

To read data for channel-1:


sudo sh -c "echo low > /sys/class/gpio/PY.02/direction"
sudo sh -c "echo low > /sys/class/gpio/PX.07/direction"


If you are using GtkTerm on Ubuntu, run this command below for channel-0. If you have done everything correctly you could see your keyboard presses on the other machine's serial terminal.


sudo gtkterm -p /dev/ttyTHS1 -s 115200 -w RS485


If you are using GtkTerm on Ubuntu, run this command below for channel-1. If you have done everything correctly you could see your keyboard presses on the other machine's serial terminal.


sudo gtkterm -p /dev/ttyTHS0 -s 115200 -w RS485



Thank you for reading our blog post.