为什么需要这个mipi csi-2 bridge 芯片,由于我们用的sensor 芯片是美光的MT9m021,这颗芯片并不支持MIPI
下面是网上摘录的说明可能解释这个问题:
Because of
the high volume and cost optimized design of these image sensors, many embedded application designers are
interested in using these CSI2 image sensors. The challenge is that traditional ISPs (Image Signal Processors) do
not have a CSI2 interface. Many have a traditional CMOS bus for camera interfaces. ISPs with a parallel CMOS
interface bus must use an external bridge to convert from CSI2 to parallel CMOS
TC358746AXBG/748XBG 桥接器是功能是把将来自设备的MIPI数据(诸如相机)到应用处理器转换成并行数据输出。
有两个接口: CSI-2 TX/RX Interface 和 Parallel Port Interface
可以配置成两种模式:
一种是:
Camera sensor的数据 -> bridge -> application, source 是: CSI-2 RX, target 端是 parallel output
块图如下:
这种模式对应的初始话代码如下:(针对芯片TC358746AXBG/748XBG,不同的做细微修改,具体根据datasheet说明)
对照寄存器解释一下这个初始化代码:
0x0002, 0x0001 //reset 1
0x0002, 0x0000 // reset 0 , 拉高再拉低,复位然后回到工作状态
0x0016, 0x40A0 // PLL Control Register 0, 设置分频比,反正是时钟的配置,具体的意义不明白,但是必须要配置的。
0x0018, 0x0013 // PLL Control Register 0, PLL reset + PLL enable + Clock enable
0x0020, 0x0000 // 时钟设置 (ppi_clk = PLL_CLK DIV 8) + (MclkRef = PLL_CLK DIV 8) +(sys_clk = PLL_CLK DIV 8)
0x000c, 0x0201 // MCLK 设置, Total MClk divider = (mclk_high + 1) + (mclk_low + 1) = (2*MclkRef Count +1 )+ (2*MclkRef Count +1 )
0x0006, 0x0062 // FiFo Control Register, 设置一个leve值,当前的是6+2, when reaches to this level,FiFo controller asserts FiFoRdy for Parallel portto // startoutput data
0x0008, 0x0020 // data format, 设置为RAW12
0x0060, 0x8009 // MIPI PHY Time Delay: Delay = (9+1) x PPIRXCLK, TC TERM selection 需要设置成1,也就是这个15bit 为1,即8
0x0004, 0x0044 // Parallel Port Enable + i2c地址每个字节传输完后递增
第二种模式