Ov9650 camera bare metal test based on mini2440

Publisher:leader4Latest update time:2022-10-11 Source: csdnKeywords:mini2440  ov9650  camera Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.


Keywords:mini2440  ov9650  camera Reference address:Ov9650 camera bare metal test based on mini2440

Previous article:OV7670 transplantation (register configuration) - based on TQ2440
Next article:Mini2440 driver analysis TouchScreen

Recommended ReadingLatest update time:2024-11-16 10:39

Mini2440 bare metal development: Keil development environment construction
Mini2440 bare metal development: Keil development environment construction I have worked on STM32 for a while, and also worked on uboot and Linux drivers, but I feel that these are not systematic and unsystematic. I feel that what I learned is very miscellaneous, and there is no record, so I decided to stick to blog
[Microcontroller]
Mini2440 bare metal development: Keil development environment construction
Transplanting QT on mini2440
QT download: http://download.qt-project.org/ qt-everywhere-opensource-src-4.8.4.tar.gz: http://download.qt-project.org/archive/qt/ tslib download: https://github.com/libts/tslib/releases Compile and install QT-X11-4.5.3 QT-X11-4.5.3 is a software running on the Linux platform for simulating QT applications. In this
[Microcontroller]
Transplanting QT on mini2440
Socket communication of Apache php on mini2440
server.php ?php // Make sure there is no timeout when connecting to the client set_time_limit(0); //Set IP and port number $address='127.0.0.1'; $port=2009; //When debugging, you can change the port to test the program!
[Microcontroller]
Socket communication of Apache php on mini2440
J-Link + ADS + mini2440 debug interruption issue
In RAM, I can debug programs like ticker and buzzer online. But I cannot debug an interrupt program today. It is a simple external interrupt. I get the external interrupt by pressing a button, but the interrupt never goes in (I can't jump in even if I set a breakpoint and press a button). I looked up some informatio
[Microcontroller]
Solve the full-duplex problem of mini2440 sound card to achieve simultaneous recording and playback
#include  unistd.h #include  fcntl.h #include  sys/types.h #include  sys/ioctl.h #include  stdlib.h #include  stdio.h #include  linux/soundcard.h #include  pthread.h #define LENGTH 3 #define RATE 8000
[Microcontroller]
Mini2440 system transplantation chapter rootfs production
 Make a root file system 1. Create a directory 2. Create necessary device files 3. Install the required shared libraries 4. Install init files, shells and various Linux commands, provided by busybox 5. Create and edit configuration 1.1. Create a directory mkdir rootfs cd rootfs mkdir bin sbin dev lib etc root usr
[Microcontroller]
Porting madplay to mini2440 under Ubuntu 11.10
Today I spent half a day learning how to port madplay. Thanks to the rich online resources, I was able to find solutions to one problem after another. After returning from shopping, I immediately started porting madplay to mini2440 under Ubuntu 11.10. With the experience of porting madplay in the morning
[Microcontroller]
mini2440 driver analysis ADC
1. ADC_DEV structure typedef struct { wait_queue_head_t wait; int channel; int prescale; }ADC_DEV;  wait waits for the queue. The process reads the device. If the data is not converted, it will sleep on this queue. channel conversion channel, s3c2440 has eight channels of ad, but only four channels AIN can be us
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号