Sequencer Configuration
The heart of the HSB Native Latency Tool lies in its precise sequencer configuration, which synchronizes LED triggers with camera frame events at the hardware level. Different camera sensor types require different timing strategies due to their distinct capture mechanisms.
The HSB Native Latency Tool provides complete example implementations for each sensor type, demonstrating the specific timing adjustments and GPIO control sequences required for accurate latency measurement.
The HSB Native Latency Tool includes two example applications in the examples/ directory:
e2e_imx274_latency.py- Rolling shutter camera implementation (IMX274)e2e_vb1940_latency.py- Global shutter camera implementation (VB1940)
Each implementation showcases the hardware sequencer programming, event handling, and timing synchronization specific to that sensor type, providing a complete reference for implementing latency measurement with your own camera sensors.
Rolling Shutter Sequencer Setup
The HSB Native Latency Tool uses hardware sequencers to precisely control GPIO events synchronized to camera frame timing. The following code demonstrates how to configure the sequencer for rolling shutter cameras.
Event Sequencer Implementation
The code snippets below are from the rolling shutter application e2e_imx274_latency.py.
Key Configuration Parameters
GPIO_DELAYED_IO_OUTPUT_REG(0x70000014) - Enables DELAYED_IO output on the GPIO pinGPIO_MODULE_CLEAR_REG(0x7000080C) - Clears all previous sequencer statesGPIO_MODULE_ENABLE_REG(0x700008F0) - Enables the sequencer moduleGPIO_DELAY_REG(0x70000804) - Sets the LED trigger delay (0 for rolling shutter; set tosensor_readout_timefor global shutter)GPIO_DELAYED_SET_REG(0x70000814) - Enables delayed set functionality
Event Acknowledgment for Continuous Measurement
To enable continuous latency measurements, events must be acknowledged after each measurement cycle. The following MultiEventAcknowledgmentOperator class is implemented in both applications e2e_imx274_latency.py and e2e_vb1940_latency.py:
Sequencer Operation Flow
- Frame Start Detection - HSB FPGA detects camera frame start signal
- Immediate LED Trigger - GPIO pin 0 set high with 0ms delay (rolling shutter)
- Event Processing - LED_TRIGGER and PD_ACTIVE events are processed
- Frame Counting - MultiEventAcknowledgmentOperator tracks frame count
- Event Acknowledgment - After N frames, events are acknowledged for next cycle
- Cycle Repeat - Process repeats for continuous measurement
Global Shutter Modifications
For global shutter cameras (like VB1940), the sequencer configuration in e2e_vb1940_latency.py modifies the delay parameter to account for sensor readout time:
Where sensor_readout_time is the specific readout time for your sensor mode.
Run Latency Tool app
Once your HSB system is operational, run the app using: