在实际使用中,我们发现当输出1280*720p_yuv422_8bit@30fps的视频时,DS90UB960-Q1 总是多输出4列数据,总数据量为1284*720。
我们仅使用DS90UB960-Q1 测试模式输出时,发现仍然存在以上问题。
测试模式初始化代码如下:
0x32,0x01, //CSI0 select
0x33,0x03, //CSI_EN & CSI0 2Lane,BIT[5:4] controls lane count
0x21,0x83, // replicate port 0 to port 1
0x20,0x00, //e0//forwarding of RX0 to CSI0
0x1f,0x02,
0x4c,0x01,//
0x6E,0xAA, //BC_GPIO_CTL0: FrameSync signal to GPIO0/1
0x10,0x91,
0x58,0x58, //enable pass throu BCC_CONFIG Register:BACK Channel config
//0x19,0x01, //FS_HIGH_TIME_1
//0x1A,0x15, //FS_HIGH_TIME_0
//0x1B,0x09, //FS_LOW_TIME_1
//0x1C,0xc2, //FS_LOW_TIME_0
//0x18,0x01, //Enable FrameSync
//0x19,0x01, //FS_HIGH_TIME_1
0x1A,0x06, //FS_HIGH_TIME_0
0x1B,0x5b, //FS_LOW_TIME_1
0x1C,0x9b, //FS_LOW_TIME_0
0x18,0x43, //Enable FrameSync
//0x1f,0x02,
0x6d,0x7f, //Configure port to coax mode and FPD III to CSI mode
0x5c,0xb0, //7-bit Remote Serializer Alias ID TX_ID
0x5d,0x60, //7-bit Remote Slave Device ID 0 Sensor ID
//Sensor physical ID
//Configures the physical I2C address of the remote I2C Slave device
//attached to the remote Serializer. If an I2C transaction is addressed
//to the Slave Alias ID3, the transaction is remapped to this address
//before passing the transaction across the Bi-directional Control
//Channel to the Serializer.
0x65,0x60, //7-bit Remote Slave Device Alias ID 0 Sensor Alias ID
//Configures the decoder for detecting transactions designated for an
//I2C Slave device attached to the remote Serializer. The transaction
//is remapped to the address specified in the Slave ID0 register. A
//value of 0 in this field disables access to the remote I2C Slave.
0x70,0x1e, //RAW10_datatype_yuv422b10_VC0
0x7c,0xe1,
0xB0,0x00,
0xB1,0x01,
0xB2,0x01,
0xB1,0x02,
0xB2,0x33,
0xB1,0x03,
0xB2,0x1e,//yuv8bit
0xB1,0x04,
0xB2,0x0a,//1280*2
0xB1,0x05,
0xB2,0x00,
0xB1,0x06,
0xB2,0x01,
0xB1,0x07,
0xB2,0xE0,
0xB1,0x08,
0xB2,0x02,
0xB1,0x09,
0xB2,0xD0,
0xB1,0x0A,
0xB2,0x04,
0xB1,0x0B,
0xB2,0x1A,
0xB1,0x0C,
0xB2,0x0C,
0xB1,0x0D,
0xB2,0x67,
0xB1,0x0E,
0xB2,0x21,
0xB1,0x0F,
0xB2,0x0A,
0x20,0x00, //e0//forwarding of RX0 to CSI0
如代码所示,我配置的测试模式输出为1280*720的yuv4228bit。但是我上位机软件必须要配置为1284*720去解析图像才能得到正确的图像,且图像右侧有明显的一列异常处,如下图所示。
如果我使用1280*720去解析,则得到图像如下图所示:
但是,有趣的是,我将test pattern 输出数据调整为1200x720 的yuv 输出,则并不会存在以上问题。代码改动如下:
0x32,0x01, //CSI0 select
0x33,0x03, //CSI_EN & CSI0 2Lane,BIT[5:4] controls lane count
0x21,0x83, // replicate port 0 to port 1
0x20,0x00, //e0//forwarding of RX0 to CSI0
0x1f,0x02,
0x4c,0x01,//
0x6E,0xAA, //BC_GPIO_CTL0: FrameSync signal to GPIO0/1
0x10,0x91,
0x58,0x58, //enable pass throu BCC_CONFIG Register:BACK Channel config
//0x19,0x01, //FS_HIGH_TIME_1
//0x1A,0x15, //FS_HIGH_TIME_0
//0x1B,0x09, //FS_LOW_TIME_1
//0x1C,0xc2, //FS_LOW_TIME_0
//0x18,0x01, //Enable FrameSync
//0x19,0x01, //FS_HIGH_TIME_1
0x1A,0x06, //FS_HIGH_TIME_0
0x1B,0x5b, //FS_LOW_TIME_1
0x1C,0x9b, //FS_LOW_TIME_0
0x18,0x43, //Enable FrameSync
//0x1f,0x02,
0x6d,0x7f, //Configure port to coax mode and FPD III to CSI mode
0x5c,0xb0, //7-bit Remote Serializer Alias ID TX_ID
0x5d,0x60, //7-bit Remote Slave Device ID 0 Sensor ID
//Sensor physical ID
//Configures the physical I2C address of the remote I2C Slave device
//attached to the remote Serializer. If an I2C transaction is addressed
//to the Slave Alias ID3, the transaction is remapped to this address
//before passing the transaction across the Bi-directional Control
//Channel to the Serializer.
0x65,0x60, //7-bit Remote Slave Device Alias ID 0 Sensor Alias ID
//Configures the decoder for detecting transactions designated for an
//I2C Slave device attached to the remote Serializer. The transaction
//is remapped to the address specified in the Slave ID0 register. A
//value of 0 in this field disables access to the remote I2C Slave.
0x70,0x1e, //RAW10_datatype_yuv422b10_VC0
0x7c,0xe1,
0xB0,0x00,
0xB1,0x01,
0xB2,0x01,
0xB1,0x02,
0xB2,0x33,
0xB1,0x03,
0xB2,0x1e,//yuv8bit
0xB1,0x04,
0xB2,0x09,//1280*2
0xB1,0x05,
0xB2,0x60,
0xB1,0x06,
0xB2,0x01,
0xB1,0x07,
0xB2,0xE0,
0xB1,0x08,
0xB2,0x02,
0xB1,0x09,
0xB2,0xD0,
0xB1,0x0A,
0xB2,0x04,
0xB1,0x0B,
0xB2,0x1A,
0xB1,0x0C,
0xB2,0x0C,
0xB1,0x0D,
0xB2,0x67,
0xB1,0x0E,
0xB2,0x21,
0xB1,0x0F,
0xB2,0x0A,
0x20,0x00, //e0//forwarding of RX0 to CSI0
出图效果如下,图像右侧未见异常,且能按照设定的分辨率正常解析。