GPIO as counter input (speed)

Hi nvidia,

In my system I need a 16bit hardware counter input capable of counting pulses with a speed varying from 1Hz to 75Hz.

I know that the TX1 doesn’t have any hardware timers that can do this.

My plan was to use a normal GPIO on the Jetson with interrupt configured for rising edge detection and then increment a software variable every time the interrupt fires.

But I’m wondering if the GPIO interrupt controller is capable of running at these “speeds” without missing a count?

(I know this may be a stupid question given the GHz speed the TX1 runs at but I’m just double checking to make sure)

Any advice is appriciated

Thanks
Lasse

I won’t guarantee it, but at speeds that slow I doubt it would even be a challenge.

hello LasseRoedtnes,

am I understand correctly that you would like Jetson platform playing a counter?
could you please have more description of your use-case, thanks

Hi Jerry

In my application I have a mechanical shutter (for a film camera) and I want to count how many times the shutter has been excited as this is important for me to determine how much film is left in a cartridge so that I can predict when to mechanically stop some mechanisms before it runs out.

Therefore I need to be sure that the Jetson will register the GPIO interrupt and fire the event at speeds up to 75Hz meaning that it has 13mS at most to serve my GPIO intterupt before another one comes in.

In the foreground the Jetson is not sitting idle but doing:
CSI Video (1080p60) preview onto HDMI while simultaneously encoding the same stream to internal eMMC.
I2S audio recording (48KHz) to internal eMMC while streaming the same audio to Bluetooth.

As a side note we are running with jetson_clocks.sh on max performance setting.

Thanks
Lasse

hello LasseRoedtnes,

please access to [Jetson TX1 Module Data Sheet] from Jetson Download Center and check [GPIO Controller] chapter.

The Jetson TX1 has multiple dedicated GPIOs. Each GPIO can be individually configurable as Output/Input/Interrupt sources with level/edge controls.

you could also refer to below kernel sources to have implementation, thanks

sources/kernel/kernel-4.4/drivers/media/rc/gpio-ir-recv.c

Hi Everyone,

In case someone ever has the same question …

I tested the speed of Jetson and GPIO interrupts works fine up to 1.5KHz, anything above is hit’or’miss

Best regards
Lasse