I need to connect several ultrasonic sensors and a GPS sensor to the Jetson TX2, but there is only 1 UART TXD/RXD pair of pins on the 40-pin expansion header (J21). What can I do?
As said in your another topic, https://devtalk.nvidia.com/default/topic/1073032/jetson-tx2/connecting-jetson-tx2-to-ultrasonic-sensor/post/5436317/#5436317, it depends on the IO of the sensor. For TX2, there are multi standard ports for option, such as I2C, SPI, UART, USB, CAN and etc.
Okay, just to make sure I’m understanding everything correctly so far:
I want to connect the ultrasonic sensor’s Vcc to the Jetson TX2’s 5.0V supply (pin 2 or 4) and the ultrasonic sensor’s Gnd to the Jetson TX2’s ground (pin 9/14/20/25/30/34/39).
As for the ultrasonic sensor’s Trig and Echo, these need to go through a level shift converter (or appropriate resistors) to drop from 5V to 3.3V before going into the J21 header. Then, the simplest and most direct way to transmit/receive data is to connect the Trig and Echo to UART TXD (pin 8) and UART RXD (pin 10).
BUT, I can configure other pins (I2C, SPI, CAN) on the J21 and J26 headers to transmit/receive data just like UART TXD/RXD in order to have multiple devices transmitting/receiving simultaneously (i.e. “tuning the driver to read/output pulse thru the GPIO pins” as you mentioned in my other post).
Assuming I’m on the right track here, what exactly do you mean by tuning the driver?
I will suggest to use GPIO pins for Trig and Echo thru level shift as seems they are not UART or I2C. Tuning driver means you will handle the data input/output from Trig and Echo pins in sw level. I think vendor already gave the example program.