Interrupt based timer to change GPIO state

Hi community

I’ve got a project at the moment where I am using a machine vision camera with a hardware enabled trigger. I have a GPIO pin connected to the trigger pad of the camera and I need to send precisely timed pulses to the camera to take photos at predictable times.

I assumed an interrupt timer would be the best way to tackle this problem but I am unsure where to start. If anyone has another suggestion, I would like to hear it. There are several knowledge gaps I would appreciate some guidance on.

  • Which interrupts are available for this task, how do I access them and set them up?
  • Presumably I will be writing kernel level code to handle the execution of this task, are there any resources I can use to get started?

hello s.hall,

please helps me to understand your use-case clearly.
I would like to know what’s the specific timing (which time position) you’re considered about.
you may also refer to below diagram for rolling shutter timing.
for example,


 ^                  <---frame-interval-->
 |    <exposure-time>                   |
 |    _______________     ______________|
 |    \              \    \             |\
Row    \              \    \            | \
 |      \   Frame 0    \    \   Frame 1 |  \
 |       \              \    \          |   \
 |________\______________\____\_________|____\_________> time
      ^                   ^  ^          |     ^
      |                   |  |          |     |
   [Shutter]         [Read] [Shutter]   |  [Read]
                                        |
                    <-Sensor Readout->  <-Sensor Readout->
                    ^                ^
                    |                |
                    |              VI read frame-end
                  VI read frame-start 

Hi Jerry

Thanks for responding.
In my case, the hardware trigger activates the (global) shutter on my camera. I need to be able to control this shutter rate to provide images from 5 to 60 FPS, depending on how I want to trade the quality of images for speed. The maximum exposure time is approximately 5ms.

hello s.hall,

we can support global shutter cameras in normal condition.
however, since we don’t have this kind of camera as reference board, the software implementation did not include global shutter configurations.

Hi Jerry

Can you please elaborate why this is an issue? What do you mean when you talk about “normal condition”.
The camera manufacturer supplies drivers for data access. All I need is to be able to change the state of a GPIO pin at a regular frequency.
The camera is an Allied Vision MIPI CSI cameras. They read and transfer the data to the Jetson after I generate a “trigger” event (whether it be a software based system call or a signal level change to a trigger pad on the camera).
Are you telling me it is not possible?

Thanks

hello s.hall,

no.
I meant we had solutions with global shutter by partners, but we don’t test this internally.

do you already know which GPIO pin you’re going to used?
you may check To check the GPIO number as see-also.
please refer to discussion thread, Topic 144550, for several ways to access GPIOs. such as, kernel APIs, python scripts, C++ samples.

Hi Jerry

Thanks for that thread link, I’ll look into it.

According to the schematic I can use either the SOM pins GPIO 6 or CAM0_PWDN. I’d prefer to be able to use both so I can switch if I need to.
image
image
If it helps, VSYNC_CAM_B is on P1B and VSYNC_CAM_A is on P1G

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