本来项目中用的是 SII9134,最近项目中需要用4k的功能,所以用 SII9136,不过这两天一直遇到一个问题,FPGA 输出 YCbCr4:2:2给 SII9136, 可是偏红特别厉害。 第一反应是我的 FPGA 代码的RGB->Ycbcr的转换公式出问题了。挑了好长时间,还是不行。后来才意识到,SII9136一直把输入默认为 RGB, 导致 偏色严重。不过调试寄存器的过程中,发现寄存器写进去了,但是不起作用。好人好报,最后成功了!最后附上 RGB-> 转 Ycbcr的公式:
Y=16+0.183*R+0.614*G+0.062*B
Cb=128-0.101*R-0.338*G+0.439*B
Cr=128+0.439*R-0.339*G-0.040*B
---------------------------------------------------------------------华丽丽滴分割----------------------------------------------------------------------------------------
好多网友反映说,寄存器就是调不对。 可我觉得难度也不大,不知为何?我把 我的代码附上吧。
第一,确保自己的I2C读写没有问题。
第二,参考以下代码,诸君好运。
Write_OneByte(0x72, 0xC7, 0X00, 0); Uart_Send_Byte(0x55); Uart_Send_Byte(0x55); test_read_byte = Read_OneByte(0x72, 0x1B, 0); Uart_Send_Byte(test_read_byte); test_read_byte = Read_OneByte(0x72, 0x1C, 0); Uart_Send_Byte(test_read_byte); test_read_byte = Read_OneByte(0x72, 0x1D, 0); Uart_Send_Byte(test_read_byte); // Write_OneByte(0x72, 0x08, 0x70, 0); Write_OneByte(0x72, 0x09, 0X04, 0); Write_OneByte(0x72, 0x1E, 0X00, 0); Write_OneByte(0x72, 0x1A, 0X01, 0); // Write_OneByte(0x72, 0x19, 0x80, 0); // Write_OneByte(0x72, 0xBF, 0x06, 0); //Write_OneByte(0x72, 0x31, 0X06, 0); // Write_OneByte(0x72, 0x0d, 0X20, 0); // Write_OneByte(0x72, 0x09, 0x06, 0); // Write_OneByte(0x72, 0x0A, 0x00, 0); Write_OneByte(0x72, 0xBC, 0x00, 0); Write_OneByte(0x72, 0xBD, 0x50, 0); Write_OneByte(0x72, 0xBE, 0X03, 0); Write_OneByte(0x72, 0x19, 0x01, 0);