Interrupts every 1ms?

Hello. On our robot we want to replace our Arduino by using our AGX for all our motor controller processing.
This means we need to count motor encoder pulses using the AGX.

We accomplished this on the Arduino using a timer interrupt and by counting the amount of pulses we get in 1ms.

Every 1ms an interrupt service routine is called and the amount of pulses recieved in that time is used to calculate the speed.

For our first attempt on the AGX we used python and checked the time to see if 1ms elapsed but the results we inaccurate.

Is there a way to get 1ms interrupts on the AGX?
Can a pwm signal from the AGX be fed into a GPIO pin and be used that way?

hello iandanielsooknanan,

please see-also Topic 202418, the lowest PWM frequency we’ve test is 10Hz.
please try driver implementation to toggle GPIO interrupts,
you may check below steps to enable rising interrupt and check events.

$ sudo -i
# echo 353 > /sys/class/gpio/export
# echo in > /sys/class/gpio/gpio353/direction
# echo rising > /sys/class/gpio/gpio353/edge
# cat /proc/interrupts | grep gpiolib

here’s also the step to configure axi_cbb to increase clock rate to get better results.
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
1 Like

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