Register configuration for the realization of camera drive 0V7725

August 23, 2021

Latest company news about Register configuration for the realization of camera drive 0V7725

Register configuration for the realization of camera drive 0V7725

SCCB timing

The picture below is the overall framework implemented by OV7725, which is a bit ugly. FPGA describes the SCCB timing and completes the configuration of the OV7725. After the configuration is completed, the OV7725 sensor outputs PCLK and href, vsync and cmos_data signals. After the format conversion unit, the data after format conversion is sent to the SDRAM unit, and finally VGA/LCD/host computer display is realized.

latest company news about Register configuration for the realization of camera drive 0V7725  0

The SCCB interface mainly implements the configuration of various registers inside the sensor, such as AGC, AWB, gama, color saturation, etc.,The configuration of the register is explained below. The reference manual is shown in the figure below. The register configuration also needs to be used in conjunction with the register setting chapter in the OV7725 manual.

latest company news about Register configuration for the realization of camera drive 0V7725  1

latest company news about Register configuration for the realization of camera drive 0V7725  2

In the last chapter of the manual, reference settings are given, but the output format is YCbCr format, other settings need to contact FAE.

latest company news about Register configuration for the realization of camera drive 0V7725  3

As shown in the figure below, the first 8 bits of data written in the register, such as 0x3d represents the address of the register, and the last 8 bits 0x03 represent the value set by the register.According to the final content of the manual, the description of the relevant registers can be found in the 0V7725 datasheet (OV7725 datasheet).

latest company news about Register configuration for the realization of camera drive 0V7725  4

For example, 0x3d, the function represented in the data sheet (OV7725 datasheet) is the control of the DC offset.As shown in the figure below, other registers can be found by analogy. Note that the register address or the name of the register can be set during the setting, such as 0x3d, 0x03, or com12, 0x03.

latest company news about Register configuration for the realization of camera drive 0V7725  5

In the OV7725 configuration manual, the conversion method between YCbCr and RGB24 format is described. As shown in the figure below, because FPGA is not good at handling floating-point numbers, it needs to be converted into fixed-point number processing.

latest company news about Register configuration for the realization of camera drive 0V7725  6

latest company news about Register configuration for the realization of camera drive 0V7725  7

In the OV7725 configuration manual, a detailed description of the OV7725 format output is described, divided into ISP and no ISP situations. This module can build a format output unit inside the FPGA. This aspect will be explained later.

latest company news about Register configuration for the realization of camera drive 0V7725  8

For the register setting, according to the reference setting in the OV7725 application manual, there are several important parts that must be set, as shown below:

1. ID setting

For manufacturers, each sensor has a unique ID address.

latest company news about Register configuration for the realization of camera drive 0V7725  9

Manufacturer’s unique ID address.

latest company news about Register configuration for the realization of camera drive 0V7725  10

2. Reset all registers

After power-on, reset all the registers inside the OV first. Register 12 not only has a reset function, but also controls the OV video output format, which will be mentioned below, see item 10.

latest company news about Register configuration for the realization of camera drive 0V7725  11

latest company news about Register configuration for the realization of camera drive 0V7725  12

3.DC bias in analog processing

latest company news about Register configuration for the realization of camera drive 0V7725  13

latest company news about Register configuration for the realization of camera drive 0V7725  14

4.Setting of rows and fields

The 17-bit row start control of the register, 18 is the downstream pixel size in VGA mode. 19 is the start of field control, and 1A is the field pixel size in VGA mode.

latest company news about Register configuration for the realization of camera drive 0V7725  15

latest company news about Register configuration for the realization of camera drive 0V7725  16

5.Invert the vertical sync signal

In order to be consistent with the VGA timing, the timing of VSYNC is reversed. For the timing diagram of one frame, refer to the previous blog.

write_SCCB (Ox15, Ox02); for this setting, pclk is defined as valid on the rising edge, href is positioned as valid at high level, and vsync is reversed.

6.The starting position and size control of the image

latest company news about Register configuration for the realization of camera drive 0V7725  17

latest company news about Register configuration for the realization of camera drive 0V7725  18

7.Size control of line and field output data

latest company news about Register configuration for the realization of camera drive 0V7725  19

latest company news about Register configuration for the realization of camera drive 0V7725  20

latest company news about Register configuration for the realization of camera drive 0V7725  21

8.Internal clock control

Register 0d is to set the frequency multiplier of the internal PLL, select 4 multiplier, AEC automatic exposure control selects one-half window.

Register 11 is the setting of the internal clock. After multiplying by PLL4, the calculated result should be equal to the XCLK clock.

latest company news about Register configuration for the realization of camera drive 0V7725  22

latest company news about Register configuration for the realization of camera drive 0V7725  23

latest company news about Register configuration for the realization of camera drive 0V7725  24

latest company news about Register configuration for the realization of camera drive 0V7725  25

9.High Insertion of Virtual Pixels

The default values given in the configuration manual above are actually useless.

latest company news about Register configuration for the realization of camera drive 0V7725  26

latest company news about Register configuration for the realization of camera drive 0V7725  27

10.OV video format output configuratio

Register 12, function multiplexing, write_SCCB (Ox12, Ox06); the output format is RGB565 format.So this register is very important and determines the format of OV output.

11.RGB format YUV format sequence and test color bar control

write_SCCB (Ox0c, Ox10); Among them, register 0c controls the sequence of RGB and YUV format, and also controls the enable of the test color bar inside the OV. The default value is used here, and the color bar is not enabled.

latest company news about Register configuration for the realization of camera drive 0V7725  28

latest company news about Register configuration for the realization of camera drive 0V7725  29

12.DSP control parameters

Among them, the 0x42 register controls the backlight compensation blue control amount, as shown in the figure below, select the manual reference value.

latest company news about Register configuration for the realization of camera drive 0V7725  30

Among them, 0x4d is the control of the repair gain, and 0x42 sets the B component of the backlight compensation color.

latest company news about Register configuration for the realization of camera drive 0V7725  31

latest company news about Register configuration for the realization of camera drive 0V7725  32

Register 0x63 is the control of AWB automatic white balance control word 0. Select the default value in the manual. 0xf0;

latest company news about Register configuration for the realization of camera drive 0V7725  33

Registers 0x64~67 are controlled by DSP as 1~4, 0x64 is set as the default value 0xff in the configuration register; 0x65 is the default value of the manual, and the configuration manual is 0x20, and the default value 0x00 is selected, which does not affect the imaging effect.0x66 is the alternate format of UV. Select 0x00. 0x67 is the output format selection, here set 0x00/0x01, it is YUV or RGB output.

latest company news about Register configuration for the realization of camera drive 0V7725  34

latest company news about Register configuration for the realization of camera drive 0V7725  35

13.AWB, AEC, AGC parameter control adjustment

latest company news about Register configuration for the realization of camera drive 0V7725  36

0x13 controls whether AEC, AWB, AGC are enabled, set to 0xff; 0x0f controls the window to automatically adapt when the output format is converted. 0x14 set 0x11.0x22 set to 0x98, as a 50Hz bandwidth filter.In the OV7725 register configuration manual, 0x13, 0x22, and 0x23 are about the setting of the band-pass filter in the case of an AC frequency of 50 Hz and a frame frequency of 25.

latest company news about Register configuration for the realization of camera drive 0V7725  37

latest company news about Register configuration for the realization of camera drive 0V7725  38

latest company news about Register configuration for the realization of camera drive 0V7725  39

latest company news about Register configuration for the realization of camera drive 0V7725  40

latest company news about Register configuration for the realization of camera drive 0V7725  41

latest company news about Register configuration for the realization of camera drive 0V7725  42

latest company news about Register configuration for the realization of camera drive 0V7725  43

14.Edge strengthening treatment

Both choose to configure the specified value.

latest company news about Register configuration for the realization of camera drive 0V7725  44

latest company news about Register configuration for the realization of camera drive 0V7725  45

15.Color reproduction matrix setting

latest company news about Register configuration for the realization of camera drive 0V7725  46

latest company news about Register configuration for the realization of camera drive 0V7725  47

16. Brightness, contrast, UV and SDE control

Choose the default value.

latest company news about Register configuration for the realization of camera drive 0V7725  48

latest company news about Register configuration for the realization of camera drive 0V7725  49

latest company news about Register configuration for the realization of camera drive 0V7725  50

latest company news about Register configuration for the realization of camera drive 0V7725  51

latest company news about Register configuration for the realization of camera drive 0V7725  52

latest company news about Register configuration for the realization of camera drive 0V7725  53

17.gama parameter settings

Among them, the registers 0x7e~0x8c are the settings of the gama curve, setting the default value of the configuration manual.

latest company news about Register configuration for the realization of camera drive 0V7725  54

latest company news about Register configuration for the realization of camera drive 0V7725  55

latest company news about Register configuration for the realization of camera drive 0V7725  56

18.UV control

write_sccb{0xa7, 0x65};
write_sccb{0xa8, 0x65};
write_sccb{0xa9, 0x80};
write_sccb {0xaa, 0x80};

latest company news about Register configuration for the realization of camera drive 0V7725  57

latest company news about Register configuration for the realization of camera drive 0V7725  58

19.Automatically adjust the frame rate at night

latest company news about Register configuration for the realization of camera drive 0V7725  59

latest company news about Register configuration for the realization of camera drive 0V7725  60

latest company news about Register configuration for the realization of camera drive 0V7725  61

The above is the setting of commonly used registers, most of which refer to the set value in the manual, and then we will realize the SCCB timing and realize the configuration of OV7725.