How to read gpio pins at a high frequency (15kHz) using Python?

I need to read an input signal into the agx on a gpio pin that may be switching at 15kHz.

How do I accomplish this with python?
Reading this link people have been able to achieve faster write speeds using mmap, this link says you can access mmap with Python. Can anyone advise me on how to achieve this?
Even if the hardware is not capable of reading a signal at 15kHz I am still willing to try reading the GPIO pin faster as my input signal may be less than 15kHz, and reading it at increased speed may bring me closer to reading the actual signal.

hello iandanielsooknanan,

you may configure axi_cbb to get better results;
root@tegra-ubuntu:/sys/kernel/debug/bpmp/debug/clk/axi_cbb# cat rate
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

please see-also this forum topic, GPIO Bit-Bang Speed Increase - #23 by Bibek

1 Like

Thanks Jerry,
Would this improvement in speed be seen using the RPi.GPIO library through python?

hello iandanielsooknanan,

this configure the clocks, it should also improve the speed that using the RPi.GPIO library ideally.

Thanks Jerry,
I’ve two more questions.

  1. Do you know which values can be used for this clock speed or which document specifies the values and maximum value?
  2. Do you have a tutorial for direct register access? I am inexperienced in this area and would appreciate all the instruction/documentation I can get.

hello iandanielsooknanan,

you may check the clock tree, i.e. # cat /sys/kernel/debug/clk/clk_summary | grep axi_cbb
please check the pinmux file, such as tegra19x-mb1-pinmux-p2888-0000-p2822-0000.cfg for the address.
thanks

1 Like

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