Download - PROJ DEMO
-
8/6/2019 PROJ DEMO
1/24
Presented By:
Internal Guide: Md.Akheel AhmedMr.Prashanth S. Pise 05621A0484
N.Narender Reddy
05621A0485
Department of Electronics and Communication Engineering,
Auroras engineering college,bhongir
-
8/6/2019 PROJ DEMO
2/24
AIM OF THE PROJECT:
The aim of the project is the design and construction of an interface
between the CMOS camera and a computer, using the AVRmicrocontroller.
The proposed tasks for the project:
Make the AVR Atmega128 and its environment work
Communicate the AVR Atmega128 with the computer
Interfacing CMOS image sensor to AVR Atmega128
Make the camera work and see images in the TV
Read and write the registers of the camera using the I2C protocol
Read a line from the camera and send it to the computerRead a whole image from the camera and send it to the computer
Image processing on the system is done using MATLAB software
Make a little process of the image inside the AVR and send the
result to the computer or color graphical lcd
-
8/6/2019 PROJ DEMO
3/24
BLOCK DIAGRAM:
-
8/6/2019 PROJ DEMO
4/24
BLOCK DIAGRAM EXPLANATION:
The information flows in two ways: on the one hand there arecommands from the computer to the camera to change different
characteristics of it, on the other images from the camera should be
sent to the computer.
The communication between the computer and the AVR
Microcontroller is through the serial port.
The communication between the camera and the microcontroller is:
using the I2Cprotocol to access to the different registers of the
camera and using an 8-bit port to read the images. In addition the
camera will be connected to a TV with its analog output for
debugging purpose.
-
8/6/2019 PROJ DEMO
5/24
-
8/6/2019 PROJ DEMO
6/24
AVR MICROCONTROLLER:
The AVR is a Modified Harvard architecture machine with program
and data stored in separate physical memory systems that appear indifferent address spaces but having the ability to read data items from
program memory using special instructions.
ATMEGA 128:
The ATmega128 is a low-power CMOS 8-bit microcontroller based on
the AVR enhanced RISC architecture. By executing powerful
instructions in a single clock cycle, the ATmega128 achieves
throughputs approaching 1 MIPS perMHz allowing the system
designer to optimize power consumption versus processing speed.
-
8/6/2019 PROJ DEMO
7/24
Pin Diagram of AVR AT Mega 128:
-
8/6/2019 PROJ DEMO
8/24
FEATURESOFAVR:
RISC / Harvard
Powerful microcontroller designed for small applications
Very low power operation
118 instructions
1 instruction per clock cycle (pipelined)
Register-to-register operation
RISC core with ~100 instructions Modest clock speeds (4-16 MHz)
8-bit bus, 32 GP 8-bit registers
Intended as single chip solutions
In-circuit programmable Flash(~1000 cycles)
Small amount of EEPROM and SRAM
Single-cycle execution of most instructions
Several on-chip peripherals
(UART, SPI,TWI, ADC, PWM, WDT..)
-
8/6/2019 PROJ DEMO
9/24
-
8/6/2019 PROJ DEMO
10/24
CMOS Image Sensor:
Until recently,CCD sensors were only image sensors used in digitalcameras, now new type image sensors has entered the market i.e.,
CMOS.
The C3088 is the color camera module used here in this project withdigital output. It usesOmni visions CMOS image sensorOV6620.
Combining CMOS technology with an easy to use digital interfacemakes C3088 a low cost solution for higher quality video imageapplication.
The digital video port supplies a continuous 8/16 bit-wide imagedata stream. All camera functions such as exposure ,gamma ,gain,white balancing ,color matrix ,windowing are programmable throughTWI .
-
8/6/2019 PROJ DEMO
11/24
CMOS IMAGE SENSOR(OV6620)
Image sensor is a device that converts avisual image to an electric signal.
ComplementaryM
etalO
xideSemiconductor image sensor is heart ofthe camera.
It produces a digital/analog outputrepresenting each pixel.
It contains a crystal oscillator whichworks at a frequency of 16MHz.
-
8/6/2019 PROJ DEMO
12/24
FEATURES OF OV 6620:
101,376 pixels, 1/4 lens.Small size-40x28mm
Data format - RGB Raw Data.
8/16 bit video data.
Wide dynamic range.
Anti-blooming.White balance control.
Single 5-Volt supply, low power dissipation.
Lens-4.9mm.
Array size-176x144
Signal to noise ratio-48db
I2C interface.
Image enhancement - brightness, contrast, saturation, sharpness.
-
8/6/2019 PROJ DEMO
13/24
-
8/6/2019 PROJ DEMO
14/24
INTER-INTEGRATED CIRCUIT (I2C)PROTOCOL:
I2C devices include EEPROMs, thermal sensors, and real-time
clocks
Used as a control interface to signal processing devices that haveseparate data interfaces, e.g. RF tuners, video decoders andencoders, and audio processors.
I2
C bus has three speeds:Slow (under 100 Kbps)
Fast (400 Kbps)
High-speed (3.4 Mbps) I2C v.2.0
Limited to about 10 feet for moderate speeds
-
8/6/2019 PROJ DEMO
15/24
I2C Bus Configuration
2-wire serial bus Serial data (SDA) and Serial clock (SCL)
Half-duplex, synchronous, multi-master bus
No chip select or arbitration logic required Lines pulled high via resistors, pulled down via open-drain
drivers (wired-AND)
-
8/6/2019 PROJ DEMO
16/24
I2C Protocol
1.Master sends start condition (S) and controls the clock signal
2.Master sends a unique 7-bit slave device address
3.Master sends read/write bit (R/W) 0 - slave receive, 1 - slavetransmit
4. Receiver sends acknowledge bit (ACK)
5. Transmitter (slave or master) transmits 1 byte of data
-
8/6/2019 PROJ DEMO
17/24
I2C Protocol (cont.)
6. Receiver issues an ACK bit for the byte received
7. Repeat 5 and 6 if more bytes need to be transmitted.
8.a) For write transaction (master transmitting), master issues stop
condition (P) after last byte of data.
8.b) For read transaction (master receiving), master does not
acknowledge final byte, just issues stop condition (P) to tell the
slave the transmission is done
-
8/6/2019 PROJ DEMO
18/24
Two Wire InterfaceTWI Registers
TWBR (bit rate register)-Controls the period ofSCL when the TWI module is
operating in Master mode.TWAR (address register)
-Used when TWI module is receiving data to identify its address.
TWCR (control register)-Controls operation of the TWI unit-Used to generate START, STOP, ACK pulse-Also enables TWI operation including interrupt enables
TWSR (status register)-Reflects the status of the TWI logic bus via codes.-Holds the prescale value for the TWI SCL pulse generator
TWDR (data register)-In transmit mode, it holds the data to send-In receive mode, it holds the data received
-
8/6/2019 PROJ DEMO
19/24
-
8/6/2019 PROJ DEMO
20/24
USART
Universal Synchronous and Asynchronous serial Receiver and
Transmitter
A standard I/O device that provides conversions between serial
and parallel data
Provides a basic protocol for serial communication
Speed, framing, error control
USART ON AVR (ATMega128)
USART - The Universal Synchronous and Asynchronous
serial Receiver and Transmitter
(USART) is a highly flexible serial communication device
-
8/6/2019 PROJ DEMO
21/24
Features:
Full Duplex Operation (Independent Serial Receive and Transmit
Registers)
Asynchronous orSynchronous Operation
Master orSlave Clocked Synchronous Operation
High Resolution Baud Rate Generator
Supports Serial Frames with 5, 6, 7, 8, or 9 Data Bits and 1 or 2
Stop Bits
Odd or Even Parity Generation and Parity CheckSupported by
Hardware
Data Overrun Detection
Framing Error Detection
Noise Filtering Includes False Start Bit Detection and Digital Low
Pass Filter
-
8/6/2019 PROJ DEMO
22/24
Three Separate Interrupts on TX Complete, TX Data Register
Empty, and RX Complete
Multi-processor CommunicationMode
Double Speed Asynchronous Communication Mode
USART Initialization:
The USART has to be initialized before any communication can take
place. The initialization process normally consists of setting the baud
rate, setting frame format and enabling the Transmitter or the Receiver
depending on the usage. For interrupt driven USART operation, the
global interrupt flag should be cleared (and interrupts globallydisabled)
-
8/6/2019 PROJ DEMO
23/24
IMAGE PROCESSING:
A method for adjusting the color reproduction of a color image
composed of pixels provided in a plurality of color channels is based
on generating a reference image from a combination of the color
channels, whereby each spatial coordinate of the reference image is
characterized by a reference image level.
A method for processing Bayer images method comprising:
Receiving a raw image from a sensor with Bayer color arrays.
Determining a corresponding dot in the raw image that corresponds
to each pixel in a final image.
Locating color reference pixels in the raw image according to the
corresponding dot.Selecting interpolation pixels in the raw image according to the
color reference pixels and interpolating color values of the each pixel
in the final image according to color values of the interpolation pixels.
-
8/6/2019 PROJ DEMO
24/24
BAYERFORMAT:
Color filters used in most single-chip digital image sensors used in
digital cameras, camcorders, and scanners to create a color image.
The filter pattern is 50% green, 25% red and 25% blue, hence is also
called RGBG orGRGB.
This Bayer format is processed in MATLAB to obtain true RGB
picture.
To create a full color image, the camera's image processor calculates,
or interpolates, the actual color of each pixel by looking at the
brightness of the colors recorded by it and others around it.