The output format of the camera has RGB565, YUY422 and other formats, and the output format of the first camera OV7620 that I came into contact with is YUV422. Let's introduce YUV422 to you.
The human eye is more sensitive to low frequency signals than high frequency signals. In fact, the human eye is more sensitive to changes in brightness than to changes in color. Therefore, people change the RGB three-color signal to YUV to represent, where Y is gray scale and UV is color difference. If it is to represent a color image, the same reason, YUV444 is a lossless storage method, but it requires 3 bytes, and the storage space is very expensive. Since the Y component is much more important than the UV component, it is represented by YUV422. In this way, the image is much compressed, and one byte can represent its color information.
For OV7620, it has two sets of parallel data ports Y [7..0] and UV [7..0], where for data port Y [7..0], the output is gray value Y, and for UV [7..0], the output chrominance signal UV. The following figure shows the format of the k pixel (K byte) output.
OV762 is controlled using the SerialCameraControlBus (SCCB) protocol. SCCB's simplified I2C protocol, SIO-I is a serial clock input line, SIO-O is a serial bidirectional data line, respectively equivalent to the SCL and SDA of the I2C protocol. The bus timing of SCCB is basically the same as that of I2C, and its response signal ACK is generated by the 9th bit of a transmission unit of Chen Wei, respectively Donotcare and NA.Donotcare bits are generated by the slave. The NA bit is generated by the host. Since SCCB does not support multi-byte read and write, the NA bit must be high. In addition, SCCB has no concept of repeated start, so during the SCCB read cycle, when the host sends a read command, the slave will not generate a Donotcare response signal.
Due to some subtle differences between I2C and SCCB, GPIO is used to simulate the SCCB bus, and the connected pin of SCL is always set to the output mode, while the connected pin of SDA dynamically changes the input/output mode of the pin by setting the value of IODIR during data transmission. The write cycle of SCCB directly uses the write cycle timing of I2C bus protocol. The SC-CB read cycle adds a bus stop condition.