DSBOX-NX2 (Rev. 1.1) Industrial Input Output Interface Tutorial

DSBOX-NX2 (Rev. 1.1) Industrial Input Output Interface Tutorial

Jetson Xavier NX

18 May 2021
WHAT YOU WILL LEARN?

1- The pinout of I/O connector  

2- Setting and Reading Input Pin 

3- Setting Digital Output as High and Low 


ENVIRONMENT

Hardware: DSBOX-NX2 (Rev. 1.1)

OS: JetPack 4.5 (L4T-32.5)


The pinout of I/O connector


This blog post is suitable for ;

• NVIDIA Jetson Xavier NX SOM with DSBOARD-NX2 (Rev. 1.1) 

• DSBOX-NX2 (Rev. 1.1)


In this blog post, we will test the IIO (Industrial Input Output) interface of DSBOX-NX2.



First, let's look over the IO connector. On the connector, there are 3 isolated outputs, 2 isolated inputs, and 1 isolated ground. When using IIO, always double-check which ground pin you are using. You must use the isolated ground for IIO applications.

Setting and Reading Input Pin



Find sysfs equivalent of the connected input pin from the table. For this setup it is gpio-232. After proper hardware connection, we can continue with the software side.


Set gpio232 (DIGITAL_IN0) as input and read sensor value. To do this, you should use the commands below.


sudo echo 232 > /sys/class/gpio/export
sudo echo in > /sys/class/gpio/gpio232/direction
sudo cat /sys/class/gpio/gpio232/value

Setting Digital Output as High and Low


Find sysfs equivalent of the connected output pin from the table below. For this setup it is gpio-236. After proper hardware connection with industrial LED, we can continue with the software side.



Then set gpio236 (DIGITAL_OUT0) as output and control light state. To do this, you should use the commands below.


sudo echo 236 > /sys/class/gpio/export
sudo echo out > /sys/class/gpio/gpio236/direction



To short Output


sudo echo 1 > /sys/class/gpio/gpio236/value



To open Output


sudo echo 0 > /sys/class/gpio/gpio236/value

Thank you for reading our blog post. 



Türkçe