The performance characteristics of the PB-0300 series CMOS digital image sensor and the design of the interface with the single-chip microcomputer

PB-0300 series CMOS active pixel digital image sensor, built-in analog-to-digital conversion 8, bit parallel data output, 64 internal registers, using I2C bus control, programmable control; it can work in both color and black and white modes. When external 24MHz clock crystal oscillator, 30 frames/s image output can be obtained. During the power-on period, the default parameter settings are automatically transferred, including the automatic exposure function, so the sensor can be used without programming.

1. Function description

1.1 Performance characteristics

PB-0300 series CMOS active pixel digital image sensor, built-in analog-to-digital conversion 8, bit parallel data output, 64 internal registers, using I2C bus control, programmable control; it can work in both color and black and white modes. When external 24MHz clock crystal oscillator, 30 frames/s image output can be obtained. During the power-on period, the default parameter settings are automatically transferred, including the automatic exposure function, so the sensor can be used without programming. The main performance indicators are shown in Table 1.

The performance characteristics of the PB-0300 series CMOS digital image sensor and the design of the interface with the single-chip microcomputer

Table 1 Main performance indicators

The performance characteristics of PB-0300 series CMOS digital image sensor and the interface design with single-chip microcomputer

1.2 Internal structure

PB-0300 is composed of five major parts: digital logic module, pixel array, column parallel gain circuit and readout circuit, 8-bit ADC, bias DACs, as shown in Figure 1.

The performance characteristics of the PB-0300 series CMOS digital image sensor and the design of the interface with the single-chip microcomputer

The main pin functions are shown in Table 2.

Table 2 Main pin function description

The performance characteristics of the PB-0300 series CMOS digital image sensor and the design of the interface with the single-chip microcomputer

PB-0300 has three separate power supplies: digital power, analog power and sensor array power. Pay special attention to the mutual influence between the power supplies when using it.

2. Image output format and timing

PB-0300 controls pixel data output signals: frame valid (FRAME-VALID) signal, line valid (LINE-VALID) signal, pixel clock (PIXCLK) signal. The FRAME-VALID signal controls the output of a frame of valid images, valid at high level; the LINE-VALID signal controls the output of valid signals for each line, #FormatImgID_0# is valid at high level; the PIXCLK signal controls the output of each pixel, when FRAME-VALID When both LINE-VALID and LINE-VALID are high, each pixel clock cycle outputs an 8-bit pixel signal; parallel DOUT0 ~ DOUT7 are 8-bit output of pixel data, and they are always synchronized with the pixel clock. When PIXCLK is on the falling edge, neither the data output nor the LINE-VALID can be changed. In the default VGA (640×480), after 640 valid pixel signals per line are output, LINE-VALID becomes low level, PB-0300 outputs 982 invalid signals according to a certain encoding method, and then outputs pixels Signal. After 480 rows of valid pixels and invalid signals are completely output, the sensor outputs 9 rows of blank signals. During this period, FRAME-VALID is at low level, marking the structure of the current frame and the beginning of the next frame; at the same time, the latest value of the register is read, and the image parameters changed by programming the register will take effect in the next frame. The signal output sequence is shown in Figure 2.

3. Register settings

PB-0300 has a total of 64 registers (R0-R63), the addresses are 00H~3FH, and have automatic exposure function by default; the size, position and speed of the output image can be changed; by adjusting the pixel accumulation time, ADC reference and The gain value can control the brightness of the captured image. The functions of several main registers are described below.

*Reset control register (R13)

R13 can reset PB-0300 to its default state after power-on. First write “1” to the lowest bit of R13 to make PB-0300 in the reset state, and then write “0” to continue working.

*Window position and size control register (R1, R2, R3, R4)

Control the position and size of the image capture window. Only the pixels in this window can be effectively read out. The maximum number of pixels in the window is 640×480. R1 is the starting coordinate of the row, R2 is the starting coordinate of the column, (1024-R3) is the effective number of rows, (1024-R4) is the effective number of columns; the default value of the window size is VGA (640×480), the upper right corner coordinates Is (0, 0), and the coordinates of the lower left corner are (639, 479).

* Pixel accumulation control register (R8, R9)

Control the lighting time of the pixel, R8 is the cumulative number of frames, R9 is the cumulative number of rows, the actual total cumulative time, that is, the time to actually process one frame of image: TInt=[(R8×(1024-R3)+R9)×TrowwhereTrowisthetimeittakestoprocessarowofeffectivepixelsGenerallyR8issetto0andthemaximumvalueofR9isthenumberofrowsoftheeffectiveimagewindowThevalueofTIntshouldbeabletosignaltoavoidstreaksintheimageduetolightflickerUnderthelightflickerfrequencyof60HzTIntmustbeanintegermultipleof1/120s;atafrequencyof50HzTIntmustbeanintegermultipleof1/100

*Frame rate control register (R5, R6, R10)

The performance characteristics of the PB-0300 series CMOS digital image sensor and the design of the interface with the single-chip microcomputer

Control the invalid signal time between valid pixel signals for each line and each frame. When other image parameters change, adjust the frame rate by changing the value of the upper frame rate control register. If the number of effective pixel columns is reduced by R4, the time for processing a row of effective pixels will be shorter and the frame rate will increase. At this time, you can adjust the value of R5 to increase the output quantity and time of each row of the element effect signal, so that the frame rate remains unchanged; in the same way, if the number of effective pixel rows is changed, adjust R6 to maintain the frame rate. R10 changes the pixel output time by controlling the output of PIXCLK.

*Gain setting register (R43, R44, R45, R46, R53)

Set the gain value of each color of the output pixel. The pixel signal passes through a gain amplifier circuit before analog-to-digital conversion to process various colors. R43 and R46 correspond to blue and red respectively, R44 and R45 correspond to green, and R53 is a global setting. Under general lighting conditions (100~1000lx), the gain value is 1~8, what is the programmed value, and what is the corresponding gain value. The gain value in auto exposure mode can be read from R53.

*Analog-to-digital conversion reference (ADC) control register (R25)

By changing the analog-digital conversion reference value, the digital output of the image is changed, thereby adjusting the image brightness. When the image brightness is large, increase the ADC value and the resulting image will become darker; when the image is darker, reduce the ADC value and the resulting image will become brighter. In non-automatic exposure mode, R25 controls the maximum reference value of ADC (minimum reference value is 0), and its typical value is between 24 and 38. In the automatic exposure mode, the ADC reference value cannot be changed.

*Signal drift value setting register (R32)

Set the signal drift value, adjust the brightness of the image, you can set both positive and negative values. When the image is too dark, add a positive value to R32, the pixel signal becomes larger, making the image brighter; when the image is too bright, add a negative value to R32 to make the image darker.

4. PB-0300 and MCU interface

When the PB-0300 is reset to the default state, it can work automatically. At this time, the automatic exposure function is adopted, and the output image is 640×480 pixels, and the output rate is 30 frames/s. It is also possible to change the working mode of the sensor and improve the output quality of the image by modifying the value of the register. On the MCS-51 series single chip, the virtual I2C bus software package VIIC can be used to simulate the I2C bus to read and write the registers of PB-0300. The interface circuit is shown as in Fig. 3.

PB-0300 uses a 16-bit register, and 2 bytes need to be written. The register address will automatically increase after it is full. Therefore, when writing to the connection register, you only need to write the address of the first register; when performing a read operation, write to the control register first to clarify the operation object, and then read. The subroutine WRITE is to modify the value of R5 (510) in the default state to 340 (0214H), so that the image output is VGA (640×480), and the output rate is 25 frames/s. The subroutine READ is a typical program that reads R9 and R10 as an example. The list of subroutines is as follows:

VSDA EQU P1.7

VSCL EQU P1.6

SLA EQU 50H

NUMBYT EQU 51H

MTD EQU 30H

MRD EQU 40H

WRITE: MOV 30H, #05H; address of register R5

MOV 31H, #02H; register value (0214H)

MOV 32H, #14H

MOV SLA, #0BAH; addressing and writing operation

MOV NUMBYT, #03H; number of bytes written

LCALL WRNBYT

RET

READ: MOV 30H, #09H; R9 address of the register

MOV NUMBYT, #01H; number of bytes written

MOV SLA, #0BAH; addressing and writing operation

LCALL WRNBYT

MOV SLA, #0BBH; address and read operation

MOV NUMBYT, #04H; read the number of bytes

LCALL RDNBYT

RET

The data of the PB-0300 chip can be read directly by using the USB interface. When the LINE-VALID and FRAME-VALID signals are both high, the reading is based on the output of the pixel clock PIXCLK. Due to the high speed of the USB interface, the data of PB-0300 can be transferred to the computer in real time.

PB-0300 has the characteristics of small size, low power consumption, simple interface, and flexible programming operation. It can work in the default mode without programming, and can also change the quality, size and speed of the output image through programming. It is especially suitable for on-site In application. PB-0300 is currently popularly used in the PB-0300 series.

The Links:   2MBI150L-120 NL6448BC26-30D

Related Posts