Introduction
This article documents the process on how to set up an external hardware trigger with the Connect Tech Inc. JCB005 camera adapter board and Allied Vision MIPI cameras using the on board external GPIO connector of the JCB005. A signal generator was connected to the external GPIO and used a +3.3V square wave to set the triggering rate of an Allied Vision 1800c MIPI camera. For this document a Connect Tech Inc. Rogue (AGX101) carrier board was used along with a NVIDIA® Jetson AGX Xavier™ System on Chip (SoC) although the same could be done with the AGX Orin series modules/carrier boards.
Required Materials
Part | Description |
AGX101 | Rogue Carrier for NVIDIA® Jetson AGX Xavier™ |
AGX Xavier | NVIDIA® Jetson AGX Xavier™ SoC |
JCB005 | Connect Tech Inc. Allied Vision MIPI Camera Board |
Alvium 1800 C | Allied Vision Alvium MIPI CSI-2 camera |
Allied Vision MIPI CSI-2 cable | 22pin MIPI CSI-2 Ribbon cable compatible with Alvium 1800 C |
Agilent 33220A | Agilent 20MHz arbitrary waveform generator |
System Setup
Hardware Setup
To stream the Alvium 1800 C cameras on an AGX101 with hardware triggering a number of things need to be set up on the hardware side. Firstly, the AGX101 and AGX Xavier™ module must be flashed with an appropriate BSP supporting Allied Vision Cameras. This can be downloaded from the Connect Tech Inc. website at https://connecttech.com/resource-center/l4t-board-support-packages/ under the NVIDIA Jetson AGX Xavier (For Allied Vision Cameras) section. The system must be flashed with a compatible BSP and the process for doing this can be found in a KDB article on the Connect Tech Inc. website at https://connecttech.com/resource-center/kdb373/. When flashing the system using the cti-flash.sh script select the JCB005 6-cam configuration in the CLI menu. To access the External GPIO (P3) of the JCB005 the cable CBG489 can be used but in the case of this document a flywire was connected to Pin 1 of the External GPIO (P3) in order to connect to the GPIO2A used for external hardware triggering of the Alvium camera. This GPIO is used for external triggering of the P2A (CAM A) port on the JCB005.
Figure 1: External GPIO (P3) Pin 1
Ensure a jumper is installed on the J1 jumper header to enable external hardware triggering of the JCB005. Using Allied Vision MIPI CSI-2 cable, connect the Alvium 1800 C camera to the JCB005 P2A port on the JCB005. Finally the Agilent 33220A waveform generator will need to be properly configured and connected to the Jetson system to be used as an external trigger. Connect the positive terminal of the waveform generator to the broken out GPIO2A and the negative terminal of the waveform generator to a GND on the Jetson system. Finally turn on the waveform generator and set the waveform type to square wave, the HiLevel of the waveform to +3.3V and the LoLevel of the waveform to 0V. Select the desired frequency of the waveform in order to set the desired triggering rate of the camera, in this example a frequency of 30Hz was used to achieve a video stream of around 30 frames per second.
Software Setup
Once the hardware has been properly configured as outlined in section 6.1 turn on the Jetson system and if not already done, go through the Ubuntu first time set up in order to have a fully bootable Jetson system. When the system has been fully set up and booted, run the command ‘ls /dev/ | grep video’ in order to ensure the Alvium 1800 C camera is properly detected by the system. It should show up under the /dev/ directory as ‘video0’.
Before configuring the cameras you may need to install v4l-utils to properly set the camera’s properties. Run the commands ‘apt -y update’ and ‘apt -y install v4l-utils’. With v4l-utils installed, set the exposure rate of the camera by running the following commands:
v4l2-ctl -d /dev/video0 -c exposure_auto=1
v4l2-ctl -d /dev/video0 -c exposure_absolute=600
v4l2-ctl -d /dev/video0 -c gamma=40
These properties can be configured to the needs of the application. Next the trigger mode, trigger activation and trigger source will have to be set. This can be done by running the following commands:
v4l2-ctl -d /dev/video0 -c trigger_mode=1
v4l2-ctl -d /dev/video0 -c trigger_activation=0
v4l2-ctl -d /dev/video0 -c trigger_source=0
All the camera controls and properties of the connected camera can be viewed by running the command ‘v4l2-ctl -d /dev/video0 --all’. Finally to stream the camera a simple gstreamer pipeline can be used:
gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! ximagesink
When launched, the camera will stream using the connected waveform generator as a trigger source and will not stream lest the waveform generator is on and running. The waveform generator’s frequency can be adjusted while streaming and the framerate of the stream will adjust dynamically according to the frequency of the external trigger from the waveform generator.