How to make Jetson Orin gpio output pwm signal with stable frame rate

When multiple cameras are connected to Jetson Orin NX, they need to be synchronized through trigger signals.

1. Trigger Pin

The trigger pin uses GPIO05.

2.Test Script

Use the following script to output the trigger signal

#!/bin/bash

# Power - PCC.02
chmod 777 /sys/class/gpio/export
chmod 777 /sys/class/gpio/unexport

echo "[sync]"
if [ -e /sys/class/gpio/PCC.02 ]; then
        echo "PCC.02 has exported."
else
        echo 330 > /sys/class/gpio/export
fi

echo out > /sys/class/gpio/PCC.02/direction

# 30fps
while [ true ]; do
        echo 1 > /sys/class/gpio/PCC.02/value
        sleep 0.00333
        echo 0 > /sys/class/gpio/PCC.02/value
        sleep 0.03
done

3.Test Results
The frame rate is not the expected 30fps and is unstable.

hello norman_xu,

may I also know what’s your sensor types, there’s Argus sample application, syncSensor if you’re using bayer raw camera sensors.

hello norman_xu,

BTW, may I also know how many camera you’re used.
are you using PCC.02 as an external trigger for sending capture request to those cameras?

Hi Jerry,

Yes, we are using 6 bayer raw camera. the trigger pin is GPIO05( PCC.02) .

hello norman_xu,

since it’s 1/30-fps as a frame time, you may trying using usleep (from kernel driver side) for better precision.

Hi Jerry,

1.We change the trigger pin to GPIO07, and refer to the following steps to output stable trigger signal.

$ sudo /opt/nvidia/jetson-io/jetson-io.py
(Configure Jetson 40pin Header -> Configure header pins manually -> [*] pwm1  (15),  [*] pwm5  (33), [*] pwm7  (32), -> Back -> Save pin changes -> Save and reboot to reconfigure pins)
$ sudo apt update
$ sudo apt install git python3-pip pip
$ git clone https://github.com/NVIDIA/jetson-gpio.git
$ cd jetson-gpio
$ sudo python3 setup.py install
$ cd samples
$ sudo python simple_pwm.py

2.Question

How to use the devmem command to replace the following operations?
(Configure Jetson 40pin Header → Configure header pins manually → [] pwm1 (15), [] pwm5 (33), [*] pwm7 (32), → Back → Save pin changes → Save and reboot to reconfigure pins)

hello norman_xu,

it’s pin configuration, please refer to developer guide for Changing the Pinmux.

1 Like

Hi Jerry,

The problem has been solved, thanks.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.