The mini2440 provides a camera interface that can output RGB24, RGB16 raw images and encoded images such as YUV formats, and provides offset flipping, zooming in and out functions. The camera module that comes with the development board is CAM130, which uses the ov9650 chip. The camera interface is used to capture and display video, and the registers of the two parts are mainly configured: the registers of the ov9650 and the camera interface registers.
The ov9650 register is inside the module, and the s3c2440 communicates with the ov9650 via the sccb bus. The sccb bus is similar to the iic bus, and the sccb bus of the mini2440 camera interface is connected to its iic interface, so the ov9650 register can be configured through the Iic, and the sccb bus timing can also be simulated with gpio. The ov9650 has a large number of registers that need to be set, but generally we don't need to care about them. The manufacturer writes some commonly used configurations into arrays and directly assigns them. What we need to care about is the manufacturer ID register, which is generally used to determine whether the camera is installed correctly before the camera is initialized.
The configuration of the camera interface register is more complicated, and generally three types of registers need to be configured. The first type is the camera interface input video format register CISRCFMT, which is used to set the format and length and width of the camera interface input data.
The camera interface of s3c2440 provides two DMA channels, one is preview output DMA, which has four DMA buffers. This channel is used to display the acquired video image directly on the LCD. The other is encoding output DMA, which also has four DMA buffers for post-processing video. So the second category is the preview output video format register. This type of register mainly includes the following:
CIPRTRGFMT This register mainly sets the length and width of the target image and whether to rotate and mirror it.
CIPRCTRL burst length register. The value here is related to the width of the target image. There is a calculation formula. You don't need to close it. You just need to call the function to calculate and then assign it.
CIPRSCPRERATIO
CIPRSCPREDST
CIPRSCCTRL These three registers are mainly used to set the scaling ratio and parameters related to the scaling offset. The original image and the size of the transformed image are used as parameters and calculated by a certain formula. The formula is fixed and can be used directly without concern. The CIPRSCCTRL register is particularly important because the 30th bit is the format of the video output, 1 is RGB24, 0 is RGB16 format, and needs to be set according to the type of LCD. The T35 LCD used by my mini2440 is an RGB16 screen, so it needs to be set to 0 here, otherwise the image color output to the LCD will be wrong. If it is an RGB24 screen, the 30th bit should be set to 1.
CIPRTAREA target image area register, which is mainly used to determine the amount of data transferred by DMA at one time
CIPRCLRSA1
CIPRCLRSA2
CIPRCLRSA3
CIPRCLRSA4 These four registers are DMA destination registers, which are where the camera interface outputs and stores data. If they are displayed directly, they must all be assigned to the first address of the LCD frame buffer.
The third type of register is the encoding output video format register, which is similar to the second type. The camera interface also has some function registers that need to be set, such as the clock register CAMDIVN and the control register CIGCTRL, which are responsible for setting the polarity of the signal and resetting the camera. In summary, operating the camera requires the following steps:
(1) Read the manufacturer ID to determine whether the camera is installed correctly. This first requires the correct operation of the sccb bus. This step can also be used to determine whether the sccb bus timing is correct.
(2) To configure the camera, write the register address and the corresponding value into the array in advance, and then complete the configuration directly through a loop. After the configuration is completed, there is no need to operate the sccb bus, that is, there is no need to worry about the ov9650 end. The following operations can be used to set the registers on the camera interface end.
(3) Set the clock required by the camera, set the control register, and reset the camera.
(4) Set the source image register, preview output register, etc. according to the type of LCD and the size of the video to be displayed.
The above are the basic operation steps of using the preview output function of the camera interface. In addition, the camera will generate an interrupt for each frame of image acquisition. The specific program is in my download resources: http://download.csdn.net/detail/yaozhenguo2006/4001720. It is compiled with amr-linux-gcc under Ubuntu. If arm-linux-gcc is installed and the command is imported into the environment variable, you can directly make it in the code directory. The program refers to http://blog.csdn.net/zhaocj/article/details/5653479. Thanks to the blogger for the detailed description of the camera. The program can run correctly on the mini2440 development board (the matching LCD is a 3.5-inch screen of TPO). If other screens need to change the parameters.
Previous article:OV7670 transplantation (register configuration) - based on TQ2440
Next article:Mini2440 driver analysis TouchScreen
Recommended ReadingLatest update time:2024-11-16 10:39
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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
- Excellent GaN PA recommendation, please take a look if you are interested.
- [GD32E503 Review]——step01. Start the journey of experiencing the domestically produced M33
- Practical sharing | How much do you know about the basics of laser technology?
- Apply for VICOR DCM DC-DC converter module related evaluation board for free!
- For thyristors, can digital resistors be used to control chopping in addition to optocouplers?
- [Raspberry Pi 4B Review] + FTP Server Setup
- Bear Pie Huawei IoT Operating System LiteOS Kernel Tutorial 05- Mutex Lock
- Questions about MOS tube VGS(th)
- ADI Award-winning Live Broadcast: Voltage Reference Product Technology and Application Selection July 25th 10:00-11:30 am Don't miss it~
- Why do you think that domestic chip manufacturers do not provide good support?