为什么需要这个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地址每个字节传输完后递增

第二种模式是顺序是反过来的,把并行数据转换成mipi输出, souce 是: parallel input,  target端是: CSI-2 TX

块图如下:

这种模式对应的初始化代码如下:

具体寄存器的意思查询dataSheet,解释如下:

0x0004,0x0004.   //   Parallel Data Format mode0 + PCLK Inverted(??我也不懂)

0x0002,0x0001.   //  reset 1

0x0002,0x0000.   //      reset 0

0x0016,0x505d.   //    设置输入和feedback的分频比

0x0018,0x0213.   //  50% of maximum loop bandwidth+ PLL Clock enable + Normal operation + PLL enable

0x0006,0x0030.   //  FiFo Level = 3

0x0008,0x0020.   // Peripheral Data Format RAW12

0x0022,0x0780.   // Word count: define total number of byte for each line

0x0140,0x00000000.   // Clock Lane DPHY Control Register ,Bypass lane enable from PPILayer enable

0x0144,0x00000000.   // Data Lane 0 DPHY Control Register,Bypass lane enable from PPILayer enable

0x0148,0x00000001.   //Data Lane 1 DPHY Control Register, Force lane disable

0x014c,0x00000001.   //Data Lane 2 DPHY Control Register, Force lane disable

0x0150,0x00000001.   //Data Lane 3 DPHY Control Register, Force lane disable

0x0210,0x00002C00.   //

Line Initialization Wait Counter
This counter is used for line initialization.
Set this register before setting [STARTCNTRL].START = 1.
MIPI specification requires that the slave device needs to observe LP-11 for
100 us and ignore the received data before the period at initialization time.
The count value depends on HFCLK and the value needs to be set to achieve
more than 100 us. The counter starts after the START bit of the STARTCNTRL
register is set.
The Master device needs to output LP-11 for 100 us in order for the slave
device to observe LP-11 for the period.
For example, in order to set 100 us when the period of HFCLK is 12 ns, the
counter value should be more than 8333.3 = 0x208D (100 us / 12 ns). Default is
0x208E.

0x0214,0x00000005.   //

SYSLPTX Timing Generation Counter
The counter generates a timing signal for the period of LPTX.
This counter is counted using the HSByteClk (the Main Bus clock), and the
value of (setting + 1) *HSByteClk Period becomes the period LPTX. Be sure to
set the counter to a value greater than 50 ns.

0x0218,0x00001E06.   //

TCLK_ZERO Counter
This counter is used for Clock Lane control in the Master mode.
In order to satisfy the timing parameter TCLK-PRE + TCLK-ZERO for Clock Lane, this
counter is used.
This counter is counted by HSBYTECLk.
Set this register in order to set the minimum time (TCLK-PRE + TCLK-ZERO) to a
value greater than 300 ns.
The actual value is ((1 to 2) + (TCLK_ZEROCNT + 1)) x HSByteClkCycle + (PHY output
delay).
The PHY output delay is about (0 to 1) x HSByteClkCycle in the ByteClk conversion
performed during RTL simulation, and is about (2 to 3) x MIPIBitClk cycle in the
BitClk conversion.

TCLK_PREPARE Counter
This counter is used for Clock Lane control in the Master mode.
In order to satisfy the timing parameter TCLK-PREPARE for Clock Lane, this counter
is used.
This counter is counted by HSBYTECLK.
Set TCLK-PREPARE period that is greater than 38 ns but less than 95 ns.
Calculating formula (TCLK_PREPARECNT + 1) x HSByteClkCycle

0x021C,0x00000004.   //

TCLK_TRAIL Counter
This counter is used for Clock Lane control in Master mode.
In order to satisfy the timing parameter about TCLK-TRAIL and TEOT for
Clock Lane, this counter is used.
This counter is counted by HSBYTECLK.
Set this register in order to set TCLK-TRAIL to a value greater than 60 ns and
TEOT to a value less than 105 ns + 12 x UI
The actual value is (TCLK_TRAILCNT + (1 to 2)) xHSByteClkCycle + (2+(1 to
2)) * HSBYTECLKCycle - (PHY output delay).
The PHY output delay is about (0 to 1) xHSByteClkCycle in the ByteClk
conversion performed during RTL simulation, and is about (2 to 3)
xMIPIBitClk cycle in the BitClk conversion.

0x0220,0x00000406.   //

THS_ZERO Counter
This counter is used for Data Lane control in Master mode.
In order to satisfy the timing parameter about THS-PREPARE + THS-ZERO for Data
Lane, this counter is used.
This counter is counted by HSBYTECLK.
Set this register to set the (THS-PREPARE + THS-ZERO) period, which should be
greater than (145 ns + 10 x UI) results.
The actual value is ((1 to 2) + 1 + (TCLK_ZEROCNT + 1) + (3 to 4)) x ByteClk cycle +
HSByteClk x (2+(1 to 2)) +(PHY delay).
The PHY output delay is about (1 to 2) x HSByteClkCycle in the ByteClk conversion
performed during RTL simulation, and is about (8+(5 to 6)) x MIPIBitClk cycle in
BitClk conversion.

THS_PREPARE Counter
This counter is used for Data Lane control in Master mode.
In order to satisfy the timing parameter about THS-PREPARE for Data Lane, this
counter is used.
This counter is counted by HSBYTECLK.
Set this register in order to set the THS-PREPARE period, which should be greater
than (40 ns + 4xUI) and less than (8 5 ns + 6xUI) results.
Calculating Formula: (THS_PREPARECNT + 1) x HSByteClkCycle

0x0224,0x00004988.   //

TWAKEUP Counter
This counter is used to exit ULPS state. Ultra-Low Power State is exited by
TWAKEUPCNT
[15:0]
means of a Mark-1 state with a length TWAKEUP followed by a Stop state.
This counter is counted by the unit of LPTXTIMECNT.

0x0228,0x0000000C.   //

TCLK_POST Counter
This counter is used for Clock Lane control in Master mode.
This counter is counted by the HSByteClk.
Set a value greater than (60 ns + 52 x UI) results.
The actual value is ((1 to 2) + (TCLK_POSTCNT + 1)) x HSByteClk cycle + (1) x
HSBYTECLK cycle.

0x022C,0x00000006.   //

THS_TRAIL Counter
This counter is used for Data Lane control in Master mode.
This counter is counted by HSBYTECLK.
Set a value greater 8 x UI or (60 ns + 4 x UI) and less than TEOT which is
105 ns + 12 x UI results.
The actual value is (1 + THS_TRAILCNT) xByteClk cycle + ((1 to 2) + 2)
xHSBYTECLK cycle - (PHY output delay).
The PHY output delay is about (1 to 2) xHSByteClkCycle in ByteClk
conversion performed during RTL simulation and is about (8+(5 to 6))
xMIPIBitClk cycle in BitClk conversion.

0x0234,0x00000003.   //

Voltage regulator enable for HSTX Data Lane 0.+ Voltage regulator enable for HSTX Clock Lane.

0x0238,0x00000001.   // Continuous clock mode. Maintains the Clock Lane output regardless of the Data Lane operation

0x0204,0x00000001.   //

START control bit of PPI-TX function.
By writing 1 to this bit, PPI starts function.
0: Stop function. (default). Writing 0 is invalid and the bit can be set to zero by
system reset only.
1: Start function.
The following registers are set to appropriate value before starting any
transmission by START bit in STARTCTRL register. Once START bit is set to high,
the change of the register bits does not affect to function. In order to change
the values, initialization by RESET_N is necessary.

0x0518,0x00000001.   // CSI START

0x0500,0xA30080A1.   //The Lane indicated by LANE_ENA transitions to the LP stop state + Enable lane1,lane3

0x0004,0x0044.   //  Parallel Port Enable + I2C address index increments on every data byte transfer

S1:

TC358746AXBG/TC358748XBG has option
to generate XShutdown/CXRST/MCLK signals for camera device through GPIO[2:0] signals

S2:

TC358746AXBG/TC358748XBG supports 8-bit data bus (PD[7:0])or 24-bit data bus (PD[23:0]). 从原理图上可以看到有24个pin口,可以根据需要格式选择使用哪些pin口,最大支持RGB888,也就是24个pin口全都接上使用。

S3: support format

RAW8/10/12/14,

RGB888/666/565,

YUV422 8-bit on 8/16-bit bus and YUV422 10-bit

S4:

The Parallel Input controller received the video data from external. It then packed these into
32-bit data format then transfers the packed data into the Line buffer. The 32-bit data format is
showed in Table 4-3(这个是指原理图中的表4-3)
Parallel Input controller is operated with PCLK only. All asynchronous logic is handled inside
Video buffer Controller

S5:

PPI : PHY-Protocol Interface 物理协议接口层

S6:  Datasheet 关于寄存器0x0500有两种解释,不知道是怎么回事?

一种是:CSI Configuration Register (CSI_CONFW: 0x0500)

另一种是: CSI LP Command (CSI_LPCMD: 0x0500)

Note: This command share the same register as CSI_CONFW. It is in LP command mode when [31:24] = 0x30

S6: 一个tc358746 可以连接多少个camera? 可以同时连接4个吗?

Parallel to CSI-2 converter

此文档参考资料来自:

TC358746AXBG_748XBG_rev05.pdf

MIPI_D-PHY_Specification_v01-00-00.pdf

TC358746AXBG/748XBG 桥接器说明的更多相关文章

  1. 在RHEL5.4 设置KVM(虚拟机)通过桥接器上网

    以root身份登录系统,创建桥接器配置文件 #cd /etc/sysconfig/network-scripts/ #cp ifcfg-eth0 ifcfg-br0 #vi ifcfg-br0 桥接器 ...

  2. React Native桥接器初探

    本文假设你已经有一定的React Native基础,并且想要了解React Native的JS和原生代码之间是如何交互的. React Native的工作线程 shadow queue:布局在这个线程 ...

  3. JDBC-ODBC桥接器连接Access数据库

    今天,遇到一个问题,虽然不是什么大难题,但对于初学者来说也缠绕了我好久!(好气哦) 问题: 运行jsp项目连接不上数据库: java.sql.SQLException: [Microsoft][ODB ...

  4. jcl-over-slf4j log桥接工具简介

    ava 界里有许多实现日志功能的工具,最早得到广泛使用的是 log4j,许多应用程序的日志部分都交给了 log4j,不过作为组件开发者,他们希望自己的组件不要紧紧依赖某一个工具,毕竟在同一个时候还有很 ...

  5. JDBC-ODBC桥接方法连接Excel数据库的方法

    通过JDBC-ODBC桥接器访问Excel电子表格 1.设置数据源 Excel数据源选择的驱动程序是Microsoft Excel Driver 2.选择表 与访问其他数据库不同的是,我们必须在电子表 ...

  6. docker从零开始网络(二)桥接网络

    使用桥接网络 在网络方面,桥接网络是链路层设备,它在网络段之间转发流量.桥接网络可以是硬件设备或在主机内核中运行的软件设备. 就Docker而言,桥接网络使用软件桥接器,该软件桥接器允许连接到同一桥接 ...

  7. Java I/O(三)各种Reader和Writer读写器、RandomAccessFile随机访问文件、序列化

    2019 01/01 八.Reader和Writer读写器 前面讲的输入输出流的基本单位都是字节,因此可以称为“字节流”,读写器是以字符为基本单位,可以称为“字符流”.它们的使用方法非常相似,因此我考 ...

  8. kvm:双网卡做bond+桥接

    一,KVM基础 kvm是一种技术,云计算是一种模式,虚拟化是利用相应的技术方法在一台物理机器上将其按照不同的需求划分成多个相同或者不同的虚拟操作系统,并且各个虚拟系统可以同时运行,互不干扰,其中任何一 ...

  9. SLF4J日志桥接的应用

    最近在给公司的测试部门开发一套自动化测试框架,为了是框架产生的测试报告更易于分析,我考虑将每一个用例与运行过程中产生的日志相关联,为了实现这样的效果,首先就需要统一项目的日志输出,那么具体怎么做呢? ...

随机推荐

  1. Win7系统中MS SQLServer 2005 无法连接

    今天重装了一下Win7系统,数据库自然也重新装了一下.谁知道竟然无法连接,使用通用的解决问题方法一一测试: 1.启动数据库主要服务(因为我安装时取消了自动启动),也无法连接: 2.查看,windows ...

  2. (九)Struts2 防重复提交

    所有的学习我们必须先搭建好Struts2的环境(1.导入对应的jar包,2.web.xml,3.struts.xml) 第一节:重复提交示例演示 struts.xml <?xml version ...

  3. Tomcat源码学习记录--web服务器初步认识

    Tomcat作为开源的轻量级WEB服务器,虽然不是很适合某些大型项目,但是它开源,读其源代码可以很好的提高我们的编程功底和设计思维.Tomcat中用到了很多比较好的设计模式,其中代码风格也很值得我们去 ...

  4. (正则表达式应用) 替换自闭合标签(self-closing tag)的method

    var str = "<sup><div class=\"he's\"/></sup><span id=\"cs\&q ...

  5. 【实习记】2014-08-23网络安全XSS与CSRF总结

        XSS:脚本中的不速之客XSS:跨站脚本(Cross-site scripting)CSRF:冒充用户之手CSRF:跨站请求伪造(Cross-site request forgery) 谷歌搜 ...

  6. js获取时间天数

    date2必须大于date1 function getDays(date1,date2){ /*获取之间的天数*/ /*date1,date2都是date格式*/ var getd=(date2.ge ...

  7. PHP 面向对对象基础(接口,类)

    介绍PHP面向对象的基础知识 1. 接口的定义interface ,类定义class,类支持abstract和final修饰符,abstract修饰为抽象类,抽象类 不支持直接实例化,final修饰的 ...

  8. JavaScript学习心得(二)

    一选择DOCTYPE DOCTYPE是一种标准通用标记语言的文档类型声明,目的是告诉标准通用标记语言解析器使用什么样的文档类型定义(DTD)来解析文档. 网页从DOCTYPE开始,即<!DOCT ...

  9. 【C语言】测试系统各数据类型大小代码

    测试各系统不同数据类型大小代码 一.相关基础知识 不同环境下各数据类型大小可能不相等,(某些环境下,类型带下可以选择)故测了就知道! 二.具体内容 三.分析总结 四.实例测试 #include< ...

  10. VisualSVN Server 从此告别SVN记事本配置

    http://www.visualsvn.com/downloads/ 注意下载的是Server版本,他还会提供一个visual Studio的插件:   安装完毕后,可以在管理界面进行角色添加,创建 ...