How many MIPI CSI-2 lanes does your camera need?

When connecting an image sensor to an MCU or SoC, a practical question is how many MIPI CSI-2 lanes are needed and how much margin to allow above the nominal rate. Too few lanes can limit throughput; additional lanes require more pins and differential routing. We calculate these requirements at the start of an imaging project using the sensor and receiver specifications.

The basic math: pixels per second, then Gbps

The starting point is the raw pixel flow the sensor has to push out. You multiply three numbers:

pixel/s=width⋅height⋅fps\text{pixel/s}=\text{width}\cdot\text{height}\cdot\text{fps} bit/s=pixel/s⋅bits-per-pixel\text{bit/s}=\text{pixel/s}\cdot\text{bits-per-pixel}

The bits-per-pixel depend on the sensor’s output format, and the first possible error lies here. A RAW (Bayer) sensor typically emits 10 or 12 bits per pixel — one pixel, one sample. A YUV 4:2:2 output, instead, carries on average 16 bits per pixel (two bytes per pixel, with subsampled chroma): the payload isn’t “pixels × color bits” as one might think, but follows the format’s convention. Confusing RAW and YUV in the bits-per-pixel count leads to under- or over-estimating the bandwidth by as much as 60-70%, and from there to choosing the wrong lane count.

Once you have the payload bits/s, you divide by the lane rate — the per-lane speed of the physical layer (D-PHY) — to get the number of lanes needed.

The traps: blanking, lane rate, real payload

The first trap is confusing average rate with rate during transmission. If the sensor sends data only within the active window, the link must sustain more than the frame-average rate. Buffering, clocking and transmission mode can change this relationship: check timing and packet overhead in the datasheet rather than using a universal percentage.

The second trap is the lane-rate limit. The lane rate cannot be chosen freely: it is constrained by both the sensor’s D-PHY and the CSI-2 receiver on the MCU/SoC side, each with a maximum (often 1.5, 2.0, 2.5 Gbps/lane depending on the generation). It’s not enough that the math says “2 lanes at 3 Gbps”: if the receiver tops out at 2.5 Gbps/lane, those 3 Gbps aren’t reachable and you need more lanes at a lower speed. Lane count and lane rate have to be chosen together, within the limits of the slower of the two parts.

The third is to remember that the D-PHY also carries protocol overhead (packet header/footer, synchronization) on top of the pixel payload: keep the margin. Dimension with a margin above the computed peak throughput.

To avoid redoing this chain of multiplications and divisions by hand for every new sensor — and to explore on the fly the “what if I go from 2 to 4 lanes” or “what if I drop to 30 fps” scenarios — we put a MIPI CSI-2 bandwidth calculator online; the full reasoning, with the format map and typical limits, is in the dedicated wiki.

A real bring-up case

The scenario we hit most often: a RAW12 sensor at a certain resolution, target at a certain frame rate, to hook up to the CSI-2 receiver of an imaging MCU. The first calculation says “we fit in 2 lanes”. Then you look at the sensor’s blanking and realize the peak bandwidth is higher than the average; then you check the receiver’s maximum lane rate and discover that at that speed 2 lanes aren’t enough at the peaks. The correct conclusion is often 4 lanes at a more relaxed lane rate, which gives margin on the blanking and stays within the limits of both PHYs. Having done this math before layout means having the 4 lanes already routed as length-matched differential pairs, instead of discovering at first power-on that two lines are missing on the connector.

Margin, beyond the nominal arithmetic

Before layout, check the sensor and receiver datasheets to confirm that the chosen configuration supports the required throughput, with a margin appropriate to its timing and transmission mode.


Discuss your camera requirements with us: sensor format, timing and processor interface.

Have a technical project to discuss?

Hardware, firmware, software, acoustics: tell us what you need.