-
2022-09-23 10:13:53
Structural characteristics of solid-state fingerprint sensor chip MBF200 and its realization of SPI communication with S3C2410
With the development of network technology and communication technology, traditional identity authentication technology has become more and more powerless for information security. Due to the uniqueness and stability of human physical characteristics, people have begun to turn their attention to biometric technologies, such as fingerprints, iris, DNA, palm recognition, etc. Among many feature recognition, fingerprint collection equipment is favored by people due to its advantages of small size, low power consumption, good stability, and low probability of misjudgment. The fingerprint sensor is the core device in the fingerprint collection device, and the MBF200 of Fujitsu is selected here. It is an advanced solid-state fingerprint sensor chip with high performance, low power consumption, low cost and convenient interface. This makes it more convenient to realize data transmission in embedded systems. S3C2410 is an ARM920T core microprocessor launched by Samsung, mainly for handheld devices and applications with high cost performance and low power consumption, and integrates a wealth of components on the chip, which is conducive to its expansion.
1 Introduction to the structure and characteristics of MBF200
MBF200 is a high-performance, low-power capacitive fingerprint sensor designed for embedded systems. The chip has a sensing area of 1.28 cm × 1.50 Cm, a 256 × 300 sensor array and a resolution of 500 dpi, an integrated 8-bit A/D converter, an operating voltage of 3.3 to 5 V, and an automatic fingerprint detection function. Three bus interfaces are provided: 8-bit Microprocessor Bus Interface (MCU), Serial Peripheral Interface (SPI), and an integrated USB full-speed interface. In view of the simple interface, easy implementation and less I/O occupied, this paper adopts the SPI interface method.
The internal structure of MBF200 is shown in Figure 1. Among them, the 256×300 sensor array is used to generate the induced voltage; the function register is used to control the operation of the chip; the control circuit is used to control the sensor and the external interface circuit, and is responsible for reading and writing data; the address index register and the data register are respectively It is used to select the address of the function register and read and write data; the sample and hold and A/D conversion circuit are used to sample the voltage generated by the sensor array. In addition, a multi-frequency oscillator circuit is used to provide a clock signal for the chip.
Structural characteristics of solid-state fingerprint sensor chip MBF200 and its realization of SPI communication with S3C2410
MBF200 has a total of 19 registers, and the read/write operation of the chip is actually the operation of the register, so the use of the chip can be learned only by understanding the function of the register. Since this article adopts the slave operation mode of the Serial Peripheral Interface (SPI), only some important registers used are described here.
(1) CTRLA (control register A)
The function description of control register A is listed in Table 1.
Structural characteristics of solid-state fingerprint sensor chip MBF200 and its realization of SPI communication with S3C2410
Write this register to start image conversion, and read this register to get the A/D conversion result. The three bits of GETSUB, GETIMG and GETROW select a corresponding image access mode and initialize the conversion sequence of the A/D converter. The ANISEL bits determine the source of the A/D conversion. Set the GETSUB bit to 1 to start capturing the rectangular graphics area determined by RAH, RAL, CAL, REH, REL, CEL. Set the GETIMG bit to 1 to start capturing the entire image regardless of the row and column registers. Set the GETROW bit to 1 to start capturing the row element data determined by RAH and RAL. Writing a "1" to any one of GETSUB, GETIMG and GETROW will give up the image acquisition of the current corresponding mode and restart the image acquisition of the new mode, and these 3 bits can only have at most 1 bit at a time is set to 1. If more than one of these 3 bits is set to 1, the conversion of the image will not start. When GETIMG is set to 1, MBF200 will complete the following series of actions:
①The row address is set to O;
②The column address is set to 0;
③ Automatically start the line acquisition of the image;
④ The A/D conversion of the first pixel starts automatically.
Writing an "O" to CTRLA does not cause the MBF200 to discard the current image, other than clearing ANSEL. The result of A/D conversion can be obtained by reading the state of CTRLA.
(2) CTRLB (Control Register B)
The function description of control register B is listed in Table 2.
Structural characteristics of solid-state fingerprint sensor chip MBF200 and its realization of SPI communication with S3C2410
In SPI mode, AFDEN is used in conjunction with ENABLE to wake up the microprocessor and enable A/D conversion by generating an interrupt, which saves power. The AUTOINCEN bit in the control register CTRLB is used to set whether to start automatically incrementing the value of the row and column address registers. When this bit is set to 1, if the A/D conversion value of a certain pixel is read, the column address is automatically increased, and the A/D conversion of the next pixel is automatically started. Once the gray value of the last pixel of a row is read, the row address is automatically incremented, and the A/D conversion of the first pixel of the row starts automatically.
(3) ICR interrupt control register
This register mainly controls the two interrupt sources of the fingerprint sensor, the interrupt request O corresponds to the finger detection interrupt, and the interrupt request 1 corresponds to the external interrupt of the pin EXTINT. Please refer to the references for details.
2 Hardware interface design
2.1 SPI interface characteristics of MBF200
In SPI slave mode, the data transfer formats supported by the sensor are SPImode(0, 0) and SPI mode(1, 1). As shown in Figure 2, the timing requirements of MBF200 are as follows:
① During data transmission, SCS remains low;
② The data on the MOSI line is sampled on the rising edge of SCK;
③ When SCK is in idle state, it can be high level or low level;
④ The data on the MISO line changes on the falling edge of SCK;
⑤ The highest bit is moved out first;
⑥The instruction format is 8-bit instruction code plus 8-bit address code and 8-bit data.
Structural characteristics of solid-state fingerprint sensor chip MBF200 and its realization of SPI communication with S3C2410
2.2 SPI interface features of S3C2410
S3C2410 has 2 serial peripheral interfaces (SPI), each SPI interface has 2 8-bit shift registers for transmission and reception respectively. In SPI communication, data is sent (serial shift out) and received (serial shift in) at the same time, and the transmission rate of 8-bit serial data is determined by the associated control register.
SPI interface features: Compatible with SPI interface protocol v2.11; 8-bit shift register for transmission; 8-bit shift register for reception; 8-bit prescaler logic; query, interrupt and DMA transfer modes.
Configure the SPI of the S3C2410 as the main device, and complete the interface design of the MBF200. The hardware connection is shown in Figure 3. SPIMOSI0 is used as the output of the master device, SPIMISOO is used as the input of the master device, and SPICLK0 is used as the serial clock for SPI communication. And S3C2410 supports 4 different transmission formats, which can ensure the consistency of the master and slave equipment timing.
Structural characteristics of solid-state fingerprint sensor chip MBF200 and its realization of SPI communication with S3C2410
SPI interface operation of S3C2410: Through the SPI interface, S3C2410 can simultaneously send and receive 8-bit data with MBF, 200. The serial clock line is synchronized with the two data lines for shifting and data sampling. The data transfer rate is controlled by the SPPREn register, and the baud rate is adjusted by modifying the prescaler value. When the GPGO output is low, write byte data to the SPDATn register, and the SPI transmit and receive operations are started at the same time.
3 Software Design
The software design mainly realizes that S3C2410 controls the MBF200 fingerprint sensor to operate. It is written under the ARM integrated development environment ADS1.2 by using the C language with strong portability. The main program flow is shown in Figure 4. After the target board is powered on, the entire acquisition system is initialized, including the initialization of the ARM system and the initialization of the MBF200, and parameter configuration for them. After the initialization is completed, it starts to detect whether there is a finger on the fingerprint sensor, and if there is an interrupt, the fingerprint image is collected in the interrupt service program and saved.
Structural characteristics of solid-state fingerprint sensor chip MBF200 and its realization of SPI communication with S3C2410
3.1 Initialization of S3C2410 system
The initial task of any system startup is the initialization of hardware, which prepares some basic hardware environments for the execution of subsequent applications, including watchdog and interrupt settings, CPU speed and clock frequency configuration, and related memory settings. , and the settings of the registers related to SPI communication. Part of the code is as follows:
Structural characteristics of solid-state fingerprint sensor chip MBF200 and its realization of SPI communication with S3C2410
3.2 Initialization of MBF200
MBF200 has a total of 19 registers, in addition to SRA, CIDH, CIDL, must be initialized before fingerprint collection.
Structural characteristics of solid-state fingerprint sensor chip MBF200 and its realization of SPI communication with S3C2410
Structural characteristics of solid-state fingerprint sensor chip MBF200 and its realization of SPI communication with S3C2410
3.3 Fingerprint collection program design
The fingerprint collection work starts from detecting the finger interruption, and writes 0x02 to the CTRLA register to start the fingerprint image data collection of the entire area; after the line capture time and A/D conversion time are over, read the CTRLA register, that is, the 8-bit number of the current pixel. quantity value. After each reading of the value of the current pixel, the A/D conversion of the next pixel is automatically performed, and the data of a fingerprint image can be obtained by cyclically reading the value of CTRLA to the specified space. The process flow of fingerprint collection program is shown in Figure 5.
Structural characteristics of solid-state fingerprint sensor chip MBF200 and its realization of SPI communication with S3C2410
Since the structure and acquisition principle of MBF200 and fingerprint sensor FPS200 are similar, according to the algorithm of line capture time and A/D conversion time of FPS200, the line capture time TROW and A/D conversion time TA/D of MBF200 can be estimated. The calculation method is as follows:
Structural characteristics of solid-state fingerprint sensor chip MBF200 and its realization of SPI communication with S3C2410
Among them: TS is the sensor clock cycle, DT [6: O] is the discharge time constant. Since the two waiting times are not easy to be too short, the estimated D RROW is