How fast can you toggle a GPIO pin?
-
While running the example blinking LED program, the fastest I am observing is 2.5ms + 2.5ms = 5ms using Python on Omega2+. I am accustomed to seeing nano-second execution times on ARM chips.
-
@Mr-Chips said in How fast can you toggle a GPIO pin?:
While running the example blinking LED program, the fastest I am observing is 2.5ms + 2.5ms = 5ms using Python on Omega2+. I am accustomed to seeing nano-second execution times on ARM chips.
Doing it via Python (which in turn probably does it via /sys/class/gpio) from userspace will probably give similar results on ARM as on MIPS. I doubt you can get execution times in the nanoseconds on any CPU this way. 2.5mS is admittedly very high, I would have expected maybe a few 10 to 100 microseconds.
However, when you access GPIO registers directly from a kernel module or via /dev/mem, you'll get sub-microsecond execution times on the Omega2 as well.
-
I measured a raw "toogle speed" of 7.69MHz:
https://github.com/GBert/openwrt-misc/tree/master/gpio-testFor your reference:
CPU | toggle speed ----------------|------------- RT3052@320MHz | 6.67 MHz AR9331@400MHz | 7.69 MHz AR9341@533MHz | 7.69 MHz MT7688@580MHz | 7.69 MHz
The toggle speed seems to be independent from the CPU speed.
-
@Gerhard-Bertelsmann Thanks for providing hard data!