What provides the clock signal for the CSI2 interface used for many cameras? Does the camera provide it or is it the processor the camera is interfacing to?
1 Answer
MIPI CSI-2 data clock comes from the camera as a separate pair (D-PHY) or encoded with the signal (C-PHY).
In D-PHY both clock edges are used to sample data from the data lanes. In C-PHY every trio change-of-state encodes a clock and a multi-bit symbol, this clock is recovered by the receiver.
Now, let’s talk about the camera timebase.
Normally, the camera reference clock, or timebase, originates from the camera itself from a local crystal oscillator. This reference isn’t output by the camera directly, but the delivered data rate and frame rate would be related to it.
The host can optionally provide a reference clock to the camera, separate from the MIPI data signals, as a timebase reference. 24MHz is common.
Another method is to provide a frame sync or trigger signal to the camera. The camera will send its frame each time it is triggered.
Either way, this host-driven reference is typically used for multi-camera setups to synchronize the frames (e.g., for stereo, multi-focal or surround cameras.)
-
\$\begingroup\$ I was wondering about this, I don't understand why the host doesn't drive the clock since it would make time syncing a lot easier. There are different ways people try to synchronize the IMX219 cameras on the jetson nano but unless there is some way to have them share a clock it's basically not possible for them to stay synced due to oscillator drift between them. \$\endgroup\$ Commented Feb 13, 2023 at 18:48
-
\$\begingroup\$ I believe the Nano can provide reference clocks and/or frame sync to its CSI-2 ports. There are pins allocated on the connectors for this purpose. R.pi camera connectors also have extra signals that can be used for clock or frame sync. \$\endgroup\$ Commented Feb 13, 2023 at 19:18
-
\$\begingroup\$ I confirmed that the Nano provides MCLK to its CSI-2 header. MCLK. Typically around 24MHz. Check with NVidia on how to enable it. In my opinion it's not as good of an option as providing a frame sync signal, because even with a shared timebase the frames could still be not aligned closely. And, at 24MHz, it's a noise source getting kicked to the camera. \$\endgroup\$ Commented Feb 13, 2023 at 21:11
-
\$\begingroup\$ Raspberry pi has an MCLK and generic GPIO, the latter which can be defined by the user. \$\endgroup\$ Commented Feb 13, 2023 at 21:17
-
\$\begingroup\$ It looks like the cameras use their own 24Mhz oscillator, maybe this means it's not possible to use the system clock. \$\endgroup\$ Commented Feb 13, 2023 at 22:08