Professional Documents
Culture Documents
com
BIHE university
Chapter 1
Introduction to AVR MCU
AVR Microcontroller and Embedded System Using Assembly and C © 2011 Pearson Higher Education,
Mazidi, Naimi, and Naimi Upper Saddle River, NJ 07458. • All Rights Reserved.
Objectives
Upon completion of this chapter, you will be able to:
• Compare and contrast microprocessors and
microcontrollers
• Compare and contrast the various members of the
AVR family
• Compare the AVR with microcontrollers offered by
other manufacturers
2
Topics
1. Microcontrollers vs. Microprocessors
2. AVR Features
3. AVR members
3
General Purpose MPU vs. MCU
• General Purpose Microprocessors
General I/O Serial
Purpose RAM ROM Timer
Port Port
Micropro
cessor
(CPU) Buses
• Microcontrollers
Microcontroller
I/O Serial
RAM ROM Timer
Port Port
CPU
Buses
4
Differences between microcontrollers and
microprocessor
5
Most common microcontrollers
• 8-bit microcontrollers
– AVR
– PIC
– HCS12
– 8051
• 32-bit microcontrollers
– ARM
– AVR32
– PIC32
– CodeFire
– PowerPC
6
Some of the Companies that Produce Widely
Used 8-bit Microcontrollers
Company Web Site Architecture
• Atmel http://www.atmel.com AVR and 8051
• Microchip http://www.microchip.com PIC16xxx/18xxx
• Intel http://www.intel.com/design/mcs51 8051
• Philips/Signetics
http://www.semiconductors.philips.com 8051
• Zilog http://www.zilog.com Z8 and Z80
• Dallas Semi/Maxim
http://www.maxim-ic.com 8051
• Freescale Semi
http://www.firecscale.com 68HC11/HCS08
• See http://www.microcontroller.com for a complete list.
Note: In 2016, Microchip agreed to buy Atmel for US$3.6 (equivalent to $3.76 in
2018) billion in a deal brokered by JPMorgan Chase and Qatalyst.
7
Comparison of 8051, PIC18 Family,
and AVR (40-pin package)
Feature 8052 PIC18F452 ATmega32
• Program ROM 8KB 32KB 32KB
• Data RAM 256B 2KB 2KB
• EEPROM 0B 256B 1KB
• Timers 3 4 3
• I/O pins 32 35 32
8
Topics
1. Microcontrollers vs. Microprocessors
2. AVR Features
3. AVR members
9
Introduction to Atmel AVR
• Atmel Corporation is a manufacturer of semiconductors,
founded in 1984.
10
Introduction to Atmel AVR
• The AVR architecture was conceived by two students at the Norwegian
Institute of Technology (NTH) Alf-Egil Bogen and Vegard Wollan.
• The AVR is a modified Harvard architecture 8-bit RISC single chip
microcontroller which was developed by Atmel in 1996. The AVR was one of
the first microcontroller families to use on-chip flash memory for program
storage, as opposed to one-time programmable ROM, EPROM, or EEPROM
used by other microcontrollers at the time.
• The AVR is a modified Harvard architecture machine where program and data
is stored in separate physical memory systems that appear in different address
spaces, but having the ability to read data items from program memory using
special instructions.
• Atmel says that the name AVR is not an acronym and does not stand for
anything in particular. The creators of the AVR give no definitive answer as to
what the term "AVR" stands for. However, it is commonly accepted that AVR
stands for Alf (Egil Bogen) and Vegard (Wollan)'s Risc processor"
11
CISC vs RISC
CISC RISC
Emphasis on hardware Emphasis on software
Include multi-clock complex instructions Include single-clock reduce instruction only
13
Computer architectures
Von Neumann vs Harvard
15
AVR internal architecture
PROGRAM
ROM
Program
Bus Bus
CPU
Interrupt Other
OSC Ports
Unit Peripherals
I/O
PINS
16
ATmega32 PDIP Package
40 PIN DIP
(XCK/T0) PB0 1 40 PA0 (ADC0)
(T1) PB1 2 39 PA1 (ADC1)
(INT2/AIN0) PB2 3 38 PA2 (ADC2)
(OC0/AIN1) PB3 4 MEGA32 37 PA3 (ADC3)
(SS) PB4 5 36 PA4 (ADC4)
(MOSI) PB5 6 35 PA5 (ADC5)
(MISO) PB6 7 34 PA6 (ADC6)
(SCK) PB7 8 33 PA7 (ADC7)
RESET 9 32 AREF
VCC 10 31 AGND
GND 11 30 AVCC
XTAL2 12 29 PC7 (TOSC2)
XTAL1 13 28 PC6 (TOSC1)
(RXD) PD0 14 27 PC5 (TDI)
(TXD) PD1 15 26 PC4 (TDO)
(INT0) PD2 16 25 PC3 (TMS)
(INT1) PD3 17 24 PC2 (TCK)
(OC1B) PD4 18 23 PC1 (SDA)
(OC1A) PD5 19 22 PC0 (SCL)
(ICP) PD6 20 21 PD7 (OC2)
17
Topics
1. Microcontrollers vs. Microprocessors
2. AVR Features
3. AVR members
18
AVR different groups
• Classic AVR
– e.g. AT90S2313, AT90S4433
• Mega
– e.g. ATmega8, ATmega32, ATmega128
• Tiny
– e.g. ATtiny13, ATtiny25
• Special Purpose AVR
– e.g. AT90PWM216,AT90USB1287
19
Let’s get familiar with the AVR part numbers
ATmega128
Atmel group
Flash =128K
ATtiny44 AT90S4433
Atmel
Tiny Flash =4K Atmel Classic
Flash =4K
group group
20
AVR Atmega — Robust and Flexible
21