To use Monitor Frame Capture Control Start and Stop operations:
- Set Stop and Start values in config register
(CSI_RX_IF_VBUS2APB_STREAM0_FCC_CFG - CSI_RX_IF_VBUS2APB_STREAM3_FCC_CFG).
Set to ‘0’ for free-running.
- [31:16] FRAME_COUNT_STOP -> define desired
value
- [15:0] FRAME_COUNT_START -> define desired
value
- Set the Virtual Channel to the one that is enabled and the enable in register
CSI_RX_IF_VBUS2APB_STREAM0_FCC_CTRL - CSI_RX_IF_VBUS2APB_STREAM3_FCC_CTRL.
- [4:1] FCC_VC -> define VC used
- [0] FCC_EN -> set to ‘1’
This will allow visual checking, by setting the Start/Stop as the following examples, this is the behaviour to be observed:
- Stop = 1 / Start = 1: Output (i.e. display) will show a Frame of the Input (i.e. camera)
- Stop = F / Start = 1: Output will show live image from the input during 14 frames and then will freeze in the last one.
Optionally software can read back the frame count
value from register (CSI_RX_IF_VBUS2APB_STREAM0_FCC_CTRL -
CSI_RX_IF_VBUS2APB_STREAM3_FCC_CTRL).
In order to do that, software will first need to enable the monitor control register.
- Define the same Virtual Channel as above and enable the monitor control
register (CSI_RX_IF_VBUS2APB_STREAM0_MONITOR_CTRL -
CSI_RX_IF_VBUS2APB_STREAM3_MONITOR_CTRL).
- [15] FRAME_MON_EN -> set to ‘1’
- [14:11] FRAME_MON_VC -> define VC used
- Read frame_counter containing the current frame number being processed from
CSI_RX_IF_VBUS2APB_STREAM0_FCC_CTRL - CSI_RX_IF_VBUS2APB_STREAM3_FCC_CTRL
(only when frame numbers are coming from the protocol, not when internal
counter)
- [31:16] FRAME_COUNTER -> read frame number
value
The easiest way to check that the frame number
matches the Start and/or Stop values defined, is to use the interrupts in
CSI_RX_IF_VBUS2APB_MONITOR_IRQS register. To be able to do that you will need to
allow those interrupts through the mask register
CSI_RX_IF_VBUS2APB_MONITOR_IRQS_MASK_CFG.
- By default, the CSI_RX_IF_VBUS2APB_MONITOR_IRQS_MASK_CFG
register is set to all ‘0’s, meaning all interrupts are disabled.
- [4] STREAM0_FCC_STOP_IRQM -> set to ‘1’
- [3] STREAM0_FCC_START_IRQM -> set to ‘1’
- Create an interrupt handler to read from
CSI_RX_IF_VBUS2APB_MONITOR_IRQS.
- [4] STREAM0_FCC_STOP_IRQ -> read, if ‘1’, Stop
interrupt triggered
- [3] STREAM0_FCC_START_IRQ -> read, if ‘1’, Start
interrupt triggered
To ensure correct functionality, it is highly recommended that the input device (i.e. camera) should be configured after the CSI_RX_IF has been configured and enabled if software is using Frame Counter Control features.
Software must make sure all the Virtual Channel fields in the registers explained above are set to the correct VC being used by the stream.