Xavier NX GPIO Accurate

Hi everyone, I want to create a IO signal that will be HIGH for 1 ms and LOW for 99 ms but when I tried GPIO pins in Xavier NX it doesn’t work well. Signal width for 1 ms and frequency is not accurate, error is more than I expect due to real time system. I use this code:

#!/bin/bash

echo 402 > /sys/class/gpio/export
echo “out” > /sys/class/gpio/gpio402/direction
trig_sig_1=/sys/class/gpio/gpio402/value;

clear

while :
do
echo “On”
echo 0 > $trig_sig_1
sleep 0.001

echo "Off"
echo 1 > $trig_sig_1
sleep 0.099

done

hello maravich,

please try configure below clocks to get better GPIO performance.
for example,

root@tegra-ubuntu:/sys/kernel/debug/bpmp/debug/clk/axi_cbb# cat rate
115200000
root@tegra-ubuntu:/sys/kernel/debug/bpmp/debug/clk/axi_cbb# echo 409600000 > rate  #.. or whatever is the max rate
root@tegra-ubuntu:/sys/kernel/debug/bpmp/debug/clk/axi_cbb# echo 1 > mrq_rate_locked

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