Professional Documents
Culture Documents
Atmega16 170901073108
Atmega16 170901073108
Atmega16 170901073108
Contents
• Introduction
• History of AVR
• AVR microcontroller
• Types of AVR microcontrollers
• AVR architecture
• GPIO Registers
• Interfacing
• Timers
• References 2
• Conclusion
Introduction
• AVR stand for ADVANCED VIRTUAL RISC.
• AVR micro controllers is family of RISC microcontrollers from
Atmel.
• AVR was one of the first microcontroller families to use on-
chip flash memory for program storage.
• AVR microcontrollers are very popular, used in numerous
applications, particularly in project prototyping and also in
embedded devices.
3
History of AVR
4
RISC microcontroller
5
AVR microcontroller
6
Types of AVR microcontrollers
AVR microcontrollers are obtainable in three
categories:-
• Tiny AVR
• Mega AVR
• Xmega AVR
7
TINY AVR
8
MEGA AVR
• This
microcontroller is the most popular having a good amount of
memory up to 256KB, higher no. of inbuilt peripherals and fit for
modest to difficult applications.
• 4–256 KB program memory
• 28–100-pin package
• Extended instruction set
9
ATMEGA16 PIN DIAGRAM
• Atmega16 have total of 40 pins in which 32 are I/O
pins.
•
CONTINUE…
• Port B (PB7..PB0) - Port B is an 8-bit bi-directional I/O port with internal
pull-up resistors selected for each bit.
• Port C (PC7..PC0) - Port C is an 8-bit bi-directional I/O port with internal
pull-up resistors selected for each bit.
• Port D (PD7..PD0) - Port D is an 8-bit bi-directional I/O port with internal
pull-up resistors selected for each bit.
• RESET - Reset Input a low level on this pin for longer than the minimum
pulse length will generate a reset
• AVCC - AVCC is the supply voltage pin for Port A and the A/D Converter.
• AREF - AREF is the analog reference pin for the A/D Converter. 11
12
AVR ARCHITECTURE
• ALU
• 32 General Purpose Registers
• Static RAM
• EEPROM
• Flash
• Timer/Counter
• Comparator
• Watch Dog timer
• Protocols: UART, SPI, I2C 13
• I/O Ports
GPIO Registers
15
16
17
Numeric Dp G F E D C B A Address
Value
0 0 0 1 1 1 1 1 1 0x3F
1 0 0 0 0 0 1 1 0 0x06
2 0 1 0 1 1 0 1 1 0x5B
3 0 1 0 0 1 1 1 1 0x4F
4 0 1 1 0 0 1 1 0 0x66
5 0 1 1 0 1 1 0 1 0x6D
6 0 1 1 1 1 1 0 1 0x7D
7 0 0 0 0 0 1 1 1 0x07
8 0 1 1 1 1 1 1 1 0x7F
9 0 1 1 0 1 1 1 1 18
0x6F
19
20
21
INTERFACING OF SWITCH
• An electrical switch is any device used to interrupt the flow of
electrons in a circuit. Switches are essentially binary devices they are
either completely on (“closed”) or completely off (“open”).
22
DC MOTOR INTERFACING
• Anelectric motor is an electrical machine that converts electrical
energy into mechanical energy.
23
24
25
LCD INTERFACING
• LCD (Liquid Crystal Display) screen is
an electronic display module and find a
wide range of applications. A 16x2 LCD
display is very basic module and is very
commonly used in various devices and
circuits.
26
27
28
TIMERS
• Timer is totally independent of the CPU.
• In AVR timers are of two types: 8-bit and 16-bit timers.
TIMER0 – 8-bit timer
TIMER1– 16-bit timer
TIMER2 – 8-bit timer
29
INTERRUPTS
• Interrupts are basically events that require immediate attention by the
microcontroller.
• Atmega16 in total has twenty one (21) interrupts available.
• The available interrupts are categorized in two classes:
External Interrupts
Internal Interrupts
30
Conclusion
• AVR is RISC architecture.
• AVR microcontrollers are very popular, used in numerous applications,
particularly in project prototyping and also in embedded devices.
• Programming is easy.
• AVR is Pipe lined processors resulting in faster execution.
• A watchdog to handle hanging software states is added.
31
REFERENCES
32
33