MIPI及DSI协议介绍郑明桑sam0030@MIPI是什么v M obile I ndustry P rocessor I nterface 移动通信行业处理器接口v MIPI包括:DCS 显示命令接口DBI 显示总线接口DPI 显示像素接口DSI 显示串行接口CSI 显示摄像接口MIPI优点v高速率最多四个通道,每个通道最大传输1 Gbpsv低功耗LowPower 1.2 V HighSpeed 200mVv低成本:PIN脚更少,PCB占用空间更少v抗干扰(EMI,ESD)高速传输信号200mV,差分信号与其他差分信号对比v TMDS:最小化差分信号传输v LVDS:低压差分信号D-PHY层定义D-PHY介绍v通道(lane)v1个单向clock通道v1到4个data通道v传输模式v Low Power模式:用于控制,最大10Mbps此时Data0的D+,D-是两个独立的信号线v High Speed模式:数据传输,80Mbps—1Gbpsv数据格式LSB first,MSB lastv传输方向只有Data0且在LP模式下,才能反向传输,其他都是单向的Lane State&Line Levelv Lane State:v LP Mode:LP-00, LP-01, LP-10, LP-11(DpDn)v HS Mode:HS-0,HS-1(差分信号)Lane Modulev LP-CD: LowPower ContentionDetector(LP争用探测器) v LP-RX/TX HS-RX/TXOperating Modev Operating Mode:v每个模式都必须从Stop State(LP-11)开始v Escape mode request (LP-11→LP-10→LP-00→LP-01→LP-00),Exit(LP-10→LP-11)v High-Speed mode request (LP-11→LP-01→LP-00),Exit(EOT →LP-11)v Control Mode (Turnaround BTA)request (LP-11→LP-10→LP-00→LP-10→LP-00),Exit(LP-00→LP-10→LP-11)v Mode切换图Escape Modev Escape模式是在LP状态下的特殊模式,只有进入该模式,下面这些功能才能实现:LPDT:Low Power Data TransmissionULPS:Ultra-Low Power StateTrigger(比如Remote trigger, Ack trigger and TE trigger)v一旦进入Escape模式,后面必须跟8-bit的entry命令才能实现对应ActionEscape Modev以LPDT为例,发送LCD sleep out 0x11命令,注意LSB firstEscape Modev ULPS:这种状态下,line处于Space状态,退出这种状态需要Mark-1状态唤醒High-Speed Modev HS模式所有通道同时开始,但每个通道可能不同时结束,clock必须也在hs模式,并且是双边沿触发,也就是data 速率是clock的两倍v完整的hs序列如下图,退出EOT+LP11High-Speed Mode v下面是HS下发送0x29 display on时序图BTA Modev It is different between DSI and other interface, other IF use Read signal to let slave send read response.But DSI integrate all control signal in DSI Data/Clock lane.v So DSI need a procedure enables information transfer in the opposite direction of the current direction.v用于读取外色参数(如ID)或确认发送包外设是否接收正确BTA Modev Acknowledge is a Trigger Message (00100001) sent when all preceding transmissions since the last peripheral to hostcommunication is received by the peripheral with no errors.DSI接口v DSI(Display Serial Interface)v DSI 收发接口,如下图:DSI传输模式v Command Mode类似MPU接口,需要IC 内如GRAM。
通过ACK和error 向Host报告(Data Lane0)v Video Mode类似RGB接口,没用GRAM,需要不停往panel刷数据。
(相对于command模式,ESD差一点,曾经有项目出现过)v传输模式HS和LP两种,对于returning data(比如cmd mode),必须使用Data Lane0并且在LP Mode短数据包结构v两种数据包类型:短数据包和长数据包v虚拟数据通道两个bit最多表示4个Virtual Channelv Multiple independent data streams for up to four peripherals are supported by this specification. The data stream for each peripheral is a Virtual Channelv一些高分辨率屏内部可能含有两个或更多独立的Driver IC,这个时候需要用到多VC(实际中,还没碰到需要多个VC的display)Virtual Channelv手头有项目用到800x1280 LCD,内部是有两个Driver IC,但跟屏厂工程师确认过,两个IC 并不是完全独立的,中间有同步信号连接,也就是只需要1个VC;v工作方式:扫描方向,Master/Slave等设置好之后,IC根据内部控制信号和同步信号将前400 pixel数据送往屏半边,后400 pixel数据送往另半边,下图是屏厂提供:长数据包结构v SoT:开始传输EoT:结束传输LPS:LP模式正向(Forward Direction)数据包类型正向数据包类型v DCS 读写命令,可带参数,可用于LCD下初始化参数命令;v Generic读写命令,是协议规范外的命令,通常是一些IC定制的(比如IPhone4 LCD),只要确保主机和外设同意这些数据的格式和解释即可。
通常和DCS通用:比如0x05和0x13通用,0x15和0x23通用;v0x22/0x32:切换开关视频显示(外设)模块。
有些IC休眠时需要关闭;v0x37:设置最大返回包大小,比如在读ID前发送;v0x01&0x11&0x21&0x31:用于Sync Event模式下精确表示同步事件的开始和结束。
为了尽可能精确体现一个同步事件,开始标识位必须放第一位,结束标识位放最后一位;v0x0E& 0x1E & 0x2E & 0x3E&0x39:各种RGB类型数据流传送控制,其中0x39用于command mode,接下来详细介绍。
反向数据包类型v外设向Host反馈有四个基本类型v数据封装包类型Error Reportv累计多个transaction error,直到host BTA时反馈v一个error report含2个bytev BIT0-BIT7 D-PHY errorsv BIT8,BIT9 ECC errorsv其他BIT DSI errorsv RGB565和RGB888分别占用2和3个byte,这个无异议v重点分析RGB666,有18 bit packed和loosely:18 bit Packed/pixelv Command Mode下Data Type都是0x39 v RGB565和RGB888类似18 bit loosely/pixelWrite Picture—Video Modev Video Mode,RGB565,RGB666 packed,RGB666 loosely,RGB888对应的Data Type分别是0x0E,0x1E,0x2E,0x3E,以RGB888为例:数据传输例程v两个数据通道数据传输例程v三个数据通道发送方数据处理接收方数据处理Video Mode v Video Mode有三个子模式:(1)Non-Burst Mode with Sync Pulses(2) Non-Burst Mode with Sync Events(3)Burst ModeNon-Burst Mode with Sync Pulsesv Accurately reconstruct original video timing, including sync pulse widths.v The goal is to accurately convey DPI-type timing over the DSI serial Link.Non-Burst Mode with Sync Events v和Sync Pulses类似,但只同步每个脉冲的起始位Burst Modev In this mode, blocks of pixel data can be transferred in a shorter time using a time-compressed burst format.v低功耗,高效率BLLPv BLLP:Blanking or Low Power periodv通常有以下几个情况:1. Host and panel remain in Idle Mode. Lanes are in LP-11 state.2. Host transmits one or more non-video packets to the peripheral using Escapemode (low-power Tx).3. Host transmits one or more non-video packets to the peripheral using HS Mode,for example transmit blanking packets or DCS commands.4. If the previous processor-to-peripheral transmission ended with BTA, paneltransmits one or more packets to the host processor using Escape Mode.5. Host Transmit one or more packets to a different peripheral using a differentvirtual Channel ID (VC).Clock For Video Modev Continuous Clock ModeClock在传输数据包时持续工作在hs模式MIPI协议规定所有DSI收发器必须支持v Non-continuous Clock Mode可选,一般在Vertical blanking和Horizontal blanking插入LPS。