TC358746AXBG/748XBG 桥接器说明
为什么需要这个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 桥接器说明的更多相关文章
- 在RHEL5.4 设置KVM(虚拟机)通过桥接器上网
以root身份登录系统,创建桥接器配置文件 #cd /etc/sysconfig/network-scripts/ #cp ifcfg-eth0 ifcfg-br0 #vi ifcfg-br0 桥接器 ...
- React Native桥接器初探
本文假设你已经有一定的React Native基础,并且想要了解React Native的JS和原生代码之间是如何交互的. React Native的工作线程 shadow queue:布局在这个线程 ...
- JDBC-ODBC桥接器连接Access数据库
今天,遇到一个问题,虽然不是什么大难题,但对于初学者来说也缠绕了我好久!(好气哦) 问题: 运行jsp项目连接不上数据库: java.sql.SQLException: [Microsoft][ODB ...
- jcl-over-slf4j log桥接工具简介
ava 界里有许多实现日志功能的工具,最早得到广泛使用的是 log4j,许多应用程序的日志部分都交给了 log4j,不过作为组件开发者,他们希望自己的组件不要紧紧依赖某一个工具,毕竟在同一个时候还有很 ...
- JDBC-ODBC桥接方法连接Excel数据库的方法
通过JDBC-ODBC桥接器访问Excel电子表格 1.设置数据源 Excel数据源选择的驱动程序是Microsoft Excel Driver 2.选择表 与访问其他数据库不同的是,我们必须在电子表 ...
- docker从零开始网络(二)桥接网络
使用桥接网络 在网络方面,桥接网络是链路层设备,它在网络段之间转发流量.桥接网络可以是硬件设备或在主机内核中运行的软件设备. 就Docker而言,桥接网络使用软件桥接器,该软件桥接器允许连接到同一桥接 ...
- Java I/O(三)各种Reader和Writer读写器、RandomAccessFile随机访问文件、序列化
2019 01/01 八.Reader和Writer读写器 前面讲的输入输出流的基本单位都是字节,因此可以称为“字节流”,读写器是以字符为基本单位,可以称为“字符流”.它们的使用方法非常相似,因此我考 ...
- kvm:双网卡做bond+桥接
一,KVM基础 kvm是一种技术,云计算是一种模式,虚拟化是利用相应的技术方法在一台物理机器上将其按照不同的需求划分成多个相同或者不同的虚拟操作系统,并且各个虚拟系统可以同时运行,互不干扰,其中任何一 ...
- SLF4J日志桥接的应用
最近在给公司的测试部门开发一套自动化测试框架,为了是框架产生的测试报告更易于分析,我考虑将每一个用例与运行过程中产生的日志相关联,为了实现这样的效果,首先就需要统一项目的日志输出,那么具体怎么做呢? ...
随机推荐
- Mysql DB2等数据库分页的实现
一.Mysql的分页 (一).MySQL分页的实现,使用关键字:Limit 语法:select * from tableName Limit A,B; 注释:tableName:表名 A:查询的 ...
- (六)Struts2 国际化
所有的学习我们必须先搭建好Struts2的环境(1.导入对应的jar包,2.web.xml,3.struts.xml) 第一节:国际化简介 国际化(Internationlization),通俗地讲, ...
- CSS 列表
CSS列表属性作用如下: 设置不同的列表项标记为有序列表 设置不同的列表项标记为无序列表 设置列表项标记为图像 列表 在HTML中,有两种类型的列表: 无序列表 - 列表项标记用特殊图形(如小黑点.小 ...
- JavaScript 删除数组重复元素
unique :function (array){ var n = {}, r = [], len = array.length, val, type; for (var i = 0; i < ...
- Gulp-入门教程 搭配环境
之前一直听朋友谈起gulp,但没有使用过,最近有机会接触到,现在给大家分享下,不对的地方还请指正.我一直以为互相分享是学习的一种好方式.下面进入正题: 首先来了解下gulp,最起码要知道:我们为什么要 ...
- WPF 保存文件
private void button2_Click(object sender, RoutedEventArgs e) { var saveFileDialog1 = new SaveFileDia ...
- .net 对配置文件内容的操作
配置文件分为两种 :一种是winform应用程序的配置文件, 一种是web的配置文件. 两种配置文件最大的区别是web的配置文件更新之后会时时更新, 应用程序的配置文件不会实时更新. 更新应用程序的配 ...
- 使用 fn 标签 解决字数过多时用省略号代替 .............................
list列表单条记录某字段大于10就后面添加省略号(如:内容只是显示开始的10个字,后面的用省略号代替) 在list列表中单条记录某字段大于10就后面添加省略号, 首先引入 jstl标签: <% ...
- Hybrid App开发者一定不要错过的框架和工具
最近开始给网站的移动版本做技术选型,发现了很多好玩的东西,写出来给大家分享下. ionicFramework 我是hybrid app的忠实粉丝和大力倡导者,从 新浪移动云开始就不断的寻找能帮助Web ...
- 工具批处理Demo
前言:用C语言写一些小型工具时,使用传递参数的方式会比较方便.如GIF文件转换为头文件工具,如果我们需要将某一个文件夹里所有的gif文件都转换为头文件,这时我们用批处理给这个工具传递参数,会方便很多. ...