AN2676 Freescale Semiconductor / Motorola, AN2676 Datasheet

no-image

AN2676

Manufacturer Part Number
AN2676
Description
Image Capture with i.MX21
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Application Note
AN2676/D
Rev. 0, 03/2004
MC9328MX21
Image Capture with
i.MX21
By Cliff Wong
Contents
1 Abstract . . . . . . . . . . . . . 1
2 Introduction . . . . . . . . . . 1
3 Hardware Configuration 3
4 Initialization . . . . . . . . . . 3
5 Sensor Interface . . . . . . 3
6 Bayer Statistics . . . . . . . 5
7 Image Data Path . . . . . . 8
8 Software Design . . . . . 10
9 Reference Schematics 17
This document contains information on a new product. Specifications and information herein are subject to change
without notice. © Motorola, Inc., 2004. All rights reserved.
1 Abstract
This document provides guidelines to implement image capture applications using the
CMOS Sensor Interface Module (CSI) of the i.MX21. Several scenarios are analyzed,
including the view finder, still capture, and video conferencing. This application note also
includes supplementary information about the CSI module and the CSI-PRP connection.
2 Introduction
Image capture is one of the key features of the i.MX21 processor. Using the CSI module and
the eMMA Pre-processor (PRP), the user can easily build view finder, still image capture,
and video recording applications.
Image data from the sensor is collected by the CSI module and passed to the PRP through a
private bus. It is resized and converted to appropriate color space by the PRP. The output
from the PRP is split into 2 channels. Channel 1 outputs RGB565 data for LCD display;
while Channel 2 outputs YUV420 data for MPEG or JPEG encoding. For view finder
applications, because most of the operation is managed by the hardware and involves little
CPU MIPS and memory, the system can run at a very low speed to save power.
The CSI module is able to accept most image data formats: YUV444 / YUV422 / RGB565 /
RGB888 / Bayer. However, the data path from the CSI module to the PRP is designed for
YUV422 and RGB565 only. For the other formats, image pre-processing is handled by
software. Choose the path from the CSI module to Memory through DMA. CPU MIPS and
memory usage, and thus the power consumption, increases according to the image size.
Features of the i.MX21 include:
Glueless interface to most of the dumb sensors and smart sensors available in the
market
Ability to do view finding without any CPU MIPS
Maximum image size supported by the CSI module is 2560
2048
Freescale Semiconductor, Inc.
For More Information On This Product,
×
2048
The PRP settings defined in this application note apply only
to the MC9328MX21 with the mask sets 0L92S and 1L92S.
Go to: www.freescale.com
NOTE:
×
1920, by PRP is

Related parts for AN2676

AN2676 Summary of contents

Page 1

... Freescale Semiconductor, Inc. Application Note AN2676/D Rev. 0, 03/2004 MC9328MX21 Image Capture with i.MX21 1 Abstract By Cliff Wong This document provides guidelines to implement image capture applications using the Contents CMOS Sensor Interface Module (CSI) of the i.MX21. Several scenarios are analyzed, 1 Abstract . . . . . . . . . . . . . 1 including the view finder, still capture, and video conferencing. This application note also 2 Introduction ...

Page 2

Freescale Semiconductor, Inc. Hardware Configuration 3 Hardware Configuration Figure 1 shows the basic connection of a sensor to i.MX21. Sensor Figure 1. Basic Connection of a Sensor to i.MX21 In this basic connection, the following ports are identified: • CSI ...

Page 3

Freescale Semiconductor, Inc. 4 Initialization 4.1 Power Saving The clock trees connected to the CSI, I off by default in the Clock Control Module for power saving purpose. The clock must be enabled first. Table 1. Clock Trees for the ...

Page 4

Freescale Semiconductor, Inc. Sensor Interface The basic operation of traditional timing is Gated-Clock Mode as shown in Figure 2. Figure 2. Gated-Clock Mode Timing The start of frame (SOF) interrupt is generated upon the rising or falling edge of the ...

Page 5

Freescale Semiconductor, Inc. Upon the arrival of SOF, an interrupt triggers, which forces the software to run in the ISR register of the CSI module. DMA is then enabled. To avoid loss of data, DMA must be enabled within the ...

Page 6

Freescale Semiconductor, Inc. Bayer Statistics 6.1 White Balance According to the Grey World model, to give a correct white color, the average (or sum) of every color in an image should be equal. This is done by applying multipliers on ...

Page 7

Freescale Semiconductor, Inc. HSC = 16 VSC = 16 480 64 64 Figure 5. Maximum Resolution Supported Another choice for VGA can be LVRM = 1, and HSC = VSC = 24, and so on. Table 4 shows suggested settings ...

Page 8

Freescale Semiconductor, Inc. Image Data Path 7 Image Data Path 7.1 View Finder The view finder is the most basic application of image capture. An image is taken from the sensor, through CSI, and is placed in the LCD buffer ...

Page 9

Freescale Semiconductor, Inc. Sensors with Bayer, YUV444, or RGB888 output are also supported, with several software blocks inserted in between. YUV422 RGB565 CSI Bayer YUV444 RGB888 STAT FIFO Line Buffer Camera Control Path 1 (Red)—A smart sensor with YUV422 and ...

Page 10

Freescale Semiconductor, Inc. Software Design CSI STAT FIFO Camera Control Statistics Path 1 (Blue)—A smart sensor with YUV422 / RGB565 output is used. Data is resized and converted to YUV420 by PRP channel 2 for MPEG4 encoding. The same image ...

Page 11

Freescale Semiconductor, Inc. Init CSI Port Enable Enable HCLK Enable MCLK Init I2C Init Sensor ISR for CSI SOF_INT = ‘1’? Write ‘1’ to SOF_INT DMA complete flag set? Y Enable DMA channel Clear DMA complete flag Figure 9. DMA ...

Page 12

Freescale Semiconductor, Inc. Software Design Table 5. Data Formats Accepted by PRP Data Format RGB565 YUV422 Table 6 shows VGA output in RGB565 format. Table 6. VGA Output in RGB565 Format Signal CSI Input CSI Output / PRP Input PRP ...

Page 13

Freescale Semiconductor, Inc. //Module init *(uint32_t *)CRM_PCCR0 |= 0x8008000;//Clock enable for PRP *(uint32_t *)EMMA_PRP_CNTL |= 0x10000;//PRP reset //common control *(uint32_t *)EMMA_PRP_CNTL = 0x0008F24E;//LOOP mode matrix B0 (RGB2YUV) //RGB565 => RGB565 (ch1), YUV420 (ch2) *(uint32_t *)EMMA_PRP_CNTL |= 0x8000000;//bug fix *(uint32_t *)EMMA_PRP_RSIZE_CTRL ...

Page 14

Freescale Semiconductor, Inc. Software Design //module init * (uint32_t *)GPIOB_GIUS &= ~0x3FFC00; * (uint32_t *)CRM_PCCR0 |= 0x80000000; *(uint32_t *) CSI_CSICR1 = 0x0; *(uint32_t *) CSI_CSICR1 |= 0x0200; //CCIR control *(uint32_t *) CSI_CSICR1 |= 0x400; *(uint32_t *) CSI_CSICR1 |= 0x8000000; *(uint32_t ...

Page 15

Freescale Semiconductor, Inc. CSI Output / PRP Input Case Resolution Format 1 CIF RGB565 2 CIF RGB565 3 CIF YUV422 4 CIF YUV422 5 VGA RGB565 6 VGA RGB565 7 VGA YUV422 8 VGA YUV422 9 QVGA RGB565 10 QVGA ...

Page 16

Freescale Semiconductor, Inc. Software Design For channel 1, to fit the view finder output on a 240 with output width greater than 240 are strided to 240. These include CIF, VGA and QVGA. The output width can be restored to ...

Page 17

Freescale Semiconductor, Inc. 9 Reference Schematics Several CMOS and CCD sensors have been (or will be) tested on the i.MX21EVB platform. The connection of the sensors to i.MX21 is shown in this section for reference. 9.1 iMagic IM8803 VGA Sensor ...

Page 18

Freescale Semiconductor, Inc. Reference Schematics 9.2 OmniVision OV9640 1.3MegaPixel Sensor OV9640 Socket CSI Connector Figure 11. OmniVision OV9640 1.3MegaPixel Sensor 18 For More Information On This Product, MC9328MX21 Application Note Go to: www.freescale.com MOTOROLA ...

Page 19

Freescale Semiconductor, Inc. 9.3 Sharp LZ0P3721 1.1MegaPixel CCD Sensor Sharp CCD Figure 12. Sharp LZ0P3721 1.1MegaPixel CCD Sensor MOTOROLA For More Information On This Product, MC9328MX21 Application Note Go to: www.freescale.com Reference Schematics 19 ...

Page 20

Freescale Semiconductor, Inc. Reference Schematics 9.4 TransChip TC5740 VGA Sensor Figure 13. TransChip TC5740 VGA Sensor 20 For More Information On This Product, P5KS 24 pins Header CSI Connector MC9328MX21 Application Note Go to: www.freescale.com MOTOROLA ...

Page 21

Freescale Semiconductor, Inc. MOTOROLA For More Information On This Product, NOTES MC9328MX21 Application Note Go to: www.freescale.com 21 ...

Page 22

... Motorola and the Stylized M Logo are registered in the U.S. Patent and Trademark Office. All other product or service names are the property of their respective owners. The ARM POWERED logo is the registered trademark of ARM Limited. Motorola, Inc Equal Opportunity/Affirmative Action Employer. © Motorola, Inc. 2004 AN2676/D For More Information On This Product, Go to: www.freescale.com ...

Related keywords