Abstract: This paper introduces the working principle of an I2C control IP and its programmable registers in detail, and gives an application example of this IP in CMOS digital imaging. This example is designed based on the system-on-programmable chip (SOPC) technology. The system functions are realized by writing programs in the NioslI IDE, and verified by SignaITapII that comes with the QuartusII software. The results show that by selecting this IP core in the field of CMOS imaging, the system can fully utilize the advantages of SOPC technology, and has the characteristics of good scalability, flexible control, and short development cycle.
Keywords: SOPC; I2C control IP; CMOS
1 IP hardware structure and registers
1.1 IP hardware structure
The internal structure of IP is shown in Figure 1. It is mainly composed of five modules: baud rate clock register, register group controller, parallel I/O interface, I2C programmable interface, and I2C interface engine. The baud rate clock generator is used to generate the basic clock frequency of the I2C IP operation; the register group controller is used to set the register, and the setting data is transmitted to the module through the parallel I/O interface; the parallel I/O interface module is used to process the commands transmitted by the programmable interface module; the I2C programmable interface module is used to set the address of each register of the IP; and the I2C interface engine module executes the data transmission on the I2C bus.
1.2 Register Structure
The I2C control IP is mainly composed of 6 registers, as listed in Table 1. By reading and writing registers, the transmission of I2C bus data can be easily controlled, thereby realizing the communication between the NioslI processor and the device. The data register is used to store the data to be transmitted on the I2C bus; the baud rate generation module, the baud rate clock register and the clock register jointly determine the frequency of SCL on the I2C bus. The calculation formula of SCL is
. Where System_clk is the system clock; Value is the value of the clock register; divider is the frequency division number corresponding to the value of the baud rate clock register (the difference between the register value and the frequency division number is 1. If the register is set to 0, the frequency division number is 1; if the register is set to 1, the frequency division value is 2). The detailed introduction of the local address register, control register, and status register is omitted - Editor's note.
2 Application of I2C control IP in imaging system
CMOS sensors are widely used in imaging systems. Most of these sensors have built-in I2C serial communication interface. This article takes MT9M011 as an example to introduce the application of I2C control IP in imaging system. MT9M011 sensor can be divided into two modes according to the number of read and write bits: 16-bit data read and write mode and 8-bit data read and write mode. Here, the exposure register is selected and the 16-bit read and write mode is used for operation. The timing is shown in Figure 2.
The upper 7 bits of the slave device address (write mode) and the slave device address (read mode) are the slave device address, and the 8th bit is the read/write control bit (R/W), which controls the data transmission direction.
Write data to the exposure register 0x09: The master device starts the transmission and then sends the slave device address (write mode) it wants to address. MT9M011 monitors the bus. When its address matches the transmitted slave device address, it responds with a one-bit acknowledgement signal. Then the master device sends the exposure register address. MT9M011 responds again. After writing 16 bits of data to the exposure register, the master device stops writing data. Every time 8 bits of data are transmitted, the slave device MT9M011 will generate a one-bit acknowledgement signal.
Read data from the exposure register 0x09: The beginning part is the same as the timing of writing data. After the master device sends the slave device address (write mode) and the register address, it needs to restart and send the slave device address (read mode) before it can read data from the register. Every time 1 byte of data is read, the master device will generate a 1-bit acknowledgement signal. After the 16-bit data is read out, the master device sends a 1-bit non-acknowledge signal and the transmission ends.
3 IP Application Examples
3.1 Hardware Design
This article uses I2C control IP to configure the image sensor MT9M01l registers in parallel. The hardware design is based on SOPC technology, integrating the 32-bit Nios II soft-core processor, SDRAM interface module, TIMER timer module (providing the frequency of signal sampling in SignaltapII), PI0 module and I2C control IP (configured as the master device) provided by the system component library into an FPGA. QuartusII top-level principle is omitted - Editor's note.
3.2 Software Design
There are two ways to write software: one is to operate the I2C control IP application programming interface (API) function; the other is to use the read and write functions provided by Altera to operate the registers. In order to increase the speed of system operation, the second method is used. The system software part is completed by writing C code in NiosII IDE.
The parallel configuration program for CMOS registers mainly includes the following two parts:
①IP initialization setting: including setting the baud rate, setting the local address register, and setting the clock register value.
②Select CMOS1 to read and write its registers; select CMOS2 to read and write its registers. Register selection exposure register.
The key code is as follows:
the checkBus function queries the BB of the status register to determine the busy/idle status of the I2C bus, and the checkProgres function queries the PIN of the status register to determine whether the bus data transmission is completed. In order to facilitate the observation of whether the read data is consistent with the written data, the program is usually included in the while statement.
4 Experimental verification
Burn the download file generated by the hardware system to the FPGA chip and run the C code program. Use the SignaItapII logic analyzer that comes with QuartusII to observe the data on the I2C bus. Figure 3 shows the obtained waveform. The signals from top to bottom are the I2C bus signals m_sclk_2, m_sda_2, m_sclk_1, and m_sda_1 on CMOS2/CMOS1. The first half writes 0x06 and 0x07 to CMOS1 and then reads it out; the second half writes the same number to CMOS2 and reads it out. This waveform meets the timing read and write requirements of the MT9M011 image sensor.
5 System Expansion
In applications that require multi-channel CMOS configuration, this I2C control IP can easily implement multi-channel parallel CMOS register configuration. For example, an 8-channel parallel CMOS configuration system: 8 CMOS sensor chips are soldered on the circuit board, and the enable is loaded in parallel to the 8 CMOS chips by controlling the 3-channel signal of the distributor. The 3-channel control signal and the enable signal are realized by controlling the PIO interface module of the SOPC system, and the transmission of the configuration data is completed under the control of the I2C control IP. The circuit board structure is simple and the system is easy to implement.
Conclusion
The I2C IP introduced in this article can be loaded into the SOPC system as a custom component, making the system design more flexible and having great potential for functional expansion. In the imaging system using CMOS image sensor, the I2C interface is widely used. This article gives an application example of this IP, which shows that the use of this IP has broad prospects and high application value.
Previous article:Design of embedded data logging device for near field wireless communication
Next article:Design of Fiber Bragg Grating Demodulation System Based on DSP
- Popular Resources
- Popular amplifiers
- Molex leverages SAP solutions to drive smart supply chain collaboration
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- CGD and Qorvo to jointly revolutionize motor control solutions
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Nidec Intelligent Motion is the first to launch an electric clutch ECU for two-wheeled vehicles
- Bosch and Tsinghua University renew cooperation agreement on artificial intelligence research to jointly promote the development of artificial intelligence in the industrial field
- GigaDevice unveils new MCU products, deeply unlocking industrial application scenarios with diversified products and solutions
- Advantech: Investing in Edge AI Innovation to Drive an Intelligent Future
- CGD and QORVO will revolutionize motor control solutions
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Programming example: CPU card ESAM process key internal authentication
- BGA81 socket or adapter board available
- 51. Minimum system schematics for AVR, PIC, MSP430 and other microcontrollers
- BQ24610 Intelligent Li-ion Battery Charging System
- Application of X-NUCLEO-IKS01A3 sensor based on STM32F401RE development board
- Research and Design of SDTVHDTV Conversion Based on FPGA
- esp32 makes an open source handheld game console
- Some questions about DC-DC2596
- To show your companionship, you will get twice the result. Tektronix’s universal lucky bags are being delivered. There are seven lucky bags for you to choose from!
- High frequency power resonant amplifier, how to adjust the optimal impedance