SCAILX-2GS234 Sync and Trigger Configuration
python function vdlg_ap1302 sync_trigger can be used to configure most sync/trigger configuration options. This is supplemental information for raw I2C commands which can accomplish the same result as documented in the 2GS234 data-sheet.
Setting up the sync (PWM) output signal on connector P200
Set the duty cycle to 0.1 to 0.5
Write 0x3FFF to register 0X60 for a duty cycle of 0.25Set the Sync frequency.
Register 0x64 value is (1000_000/fps) * 256
25fps = 0x9C4000
30fps = 0x823500
50fps = 0x4E2000
60fps = 0x411AABEnable the Sync signal
Write 0x0F to register 0x68
Note: Be aware that the maximum exposure time may need to be adjusted. If the exposure time exceeds the set sync frequency, then the exposure time will overrule the framerate set by the sync signal.
Python example
gsi2c.i2c = I2C("/dev/links/csi0_i2c") # set csi0_i2c
gsi2c.write32(0x64, round(256 * 1000_000 / 60)) # set fps to 60Hz
gsi2c.write16(0x60, 0x3FFF) # set duty cycle to 0.25
gsi2c.write8(0x68, 0x07) # enable sync (pwm)
Configuring the Trigger input signal.
# Write 0x302 to register 0x58
This will:
Output a frame when sync signal is detected.
Sync at the start of a frame.
Reset the uptime every frame.
Reset the frame counter at every frame
Python example
gsi2c.i2c = I2C("/dev/links/csi0_i2c") # set csi0_i2c
gsi2c.write16(0x58, 0x302) # wait for trigger on csi0
gsi2c.i2c = I2C("/dev/links/csi1_i2c") # set csi1_i2c
gsi2c.write16(0x58, 0x302) # wait for trigger on csi1