0% found this document useful (0 votes)
148 views

Introduction To AVR Microcontrollers: College of Engineering

Uploaded by

Abdulla Ashoor
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
148 views

Introduction To AVR Microcontrollers: College of Engineering

Uploaded by

Abdulla Ashoor
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

College of Engineering

IENF641: Microcontrollers

Introduction to AVR Microcontrollers


Chapter 1

Edited by:
Dr. Essam Alnatsheh
[email protected]
Topics
• Microcontrollers vs. Microprocessors
• Most common microcontrollers
• AVR Features
• AVR members

2
What is a Microcomputer?
General Purpose Microprocessors vs. Microcontrollers

• 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
What is a Microprocessor ?
Central Processing Unit
(CPU): Control the operation
of the computer and
performs its data processing CPU
functions; often simply
referred to as PROCESSOR
What is a Microcontroller?
Microprocessor vs. Microcontroller
Microprocessor vs. Microcontroller

Microprocessor Microcontroller
• A chip that contains only • A chip that contains all the
the processor components of a computer –
• Need other chips to make processor, memory, I/O, etc.
a working system
• designer can decide on • fix amount of on-chip ROM,
the amount of ROM, RAM, I/O ports
RAM and I/O ports. • for applications in which cost,
• Expansive power and space are critical
• general-purpose • single-purpose
Embedded System
• Embedded system means the microcontroller is embedded into
an application.
• An embedded product uses a microcontroller to do one task
only.
• In an embedded system, there is only one application software
that is typically burned into EEPROM.
• Example:printer, keyboard, video game player
List several reasons why microcontrollers are used
instead of PCs for some tasks?

• Cheaper,
• require less power,
• smaller,
• lighter,
• designed to run for years without re-starting.
Three Criteria in Choosing a Microcontroller

1. meeting the computing needs of the task efficiently and


cost effectively
– speed, the amount of ROM and RAM, the number of
I/O ports and timers, size, packaging, power
consumption
– easy to upgrade
– cost per unit
2. availability of software development tools
– assemblers, debuggers, C compilers, emulator,
simulator, technical support
3. wide availability and reliable sources of the
microcontrollers.
A microcontroller interfaces to external devices
An 8-bit microcontroller
Microcontroller Development System
Atmel AVR Microcontrollers
Most common microcontrollers
• 8-bit microcontrollers
– AVR
– PIC
– HCS12
– 8051

• 32-bit microcontrollers
– ARM
– AVR32
– PIC32

16
What does AVR RISC mean?

• The acronym AVR has been reported to stand


for: Advanced Virtual RISC and also for the chip's
designers: Alf-Egil Bogen and Vegard Wollan
who designed the basic architecture at the
Norwegian Institute of Technology.
CISC and RISC used for CPU design
• CISC – Complex Instruction Set Computer
– Large and complex instruction set
– Variable width instructions
– Requires microcode interpreter
– Example: Intel x86 family
• RISC – Reduced Instruction Set Computer
– Small and simple instruction set
– All instructions have the same width
– Simpler instruction formats and addressing modes
– Decoded and executed directly by hardware
– Examples: ARM, MIPS, PowerPC, SPARC, etc.
A little history
• The PIC (Programmable Interrupt Controller) appeared
around 1980.
→ 8 bit bus
→ executes 1 instruction in 4 clock cycles
→ Harvard architecture

• AVR (1994)
→ 8 bit bus
→ one instruction per cycle
→ Harvard architecture
AVR 8-Bit RISC High Performance
• True single cycle execution
→ single-clock-cycle-per-instruction execution
→ PIC microcontrollers take 4 clock cycles per instruction
• One MIPS (mega instructions per second) per MHz
→ up to 20 MHz clock
• 32 general purpose registers
→ provide flexibility and performance when using high
level languages
→ prevents access to RAM
• Harvard architecture
→ separate bus for program and data memory
AVR 8-Bit RISC Low Power Consumption
• 1.8 to 5.5V operation
→ will use all the energy stored in
your batteries
• A variety of sleep modes
→ AVR Flash microcontrollers have
up to six different sleep modes
→ fast wake-up from sleep modes
• Software controlled frequency
AVR 8-Bit RISC Compatibility
• AVR® Flash microcontrollers share a single core
architecture
→ use the same code for all families
→ 1 Kbytes to 256 Kbytes of code
→ 8 to 100 pins
→ all devices have
Internal oscillators
AVR 8-Bit RISC - picoPower Technology

• “PicoPower enables AVR to achieve the


industry’s lowest power consumption with 650 nA
with a RTC (real time clock) running and 100nA
in Power Down sleep” (from ATMEL website)
• - True 1.8V Supply Voltage
- Minimized Leakage Current
- Ultra Low Power 32 kHz Crystal Oscillator
- Digital Input Disable Registers
- Power Reduction Register
So what chip should I use?
• the application chooses the chip
• each family has a large number of variants
• the number of pins, the package, the cost of the
chip, the peripherals, the operating voltage, the
current consumption, and so forth
• PIC is more application oriented
• AVR mostly pin #s and flash memory differ
Many choices
• TI(MSP430), Zilog (Z8), Freescale (SC8),
Atmel(AVR), Microchip (PIC), ST, Renesas /
Hitachi (Mx or H8), Philips (8051) as just few of
the many possible selections
AVR vs. other Microcontrollers

Let’s do the comparison between the three most commonly


used families of microcontrollers:

8051 PIC AVR


SPEED Slow Moderate Fast
MEMORY Small Large Large
ARCHITECTURE CISC RISC RISC
ADC Not Present Inbuilt Inbuilt
Timers Inbuilt Inbuilt Inbuilt
PWM Channels Not Present Inbuilt Inbuilt
AVR internal architecture

28 pin
(PCINT14/RESET) PC6 1 28 PC5 (ADC5/SCL/PCINT13)
(PCINT16/RXD) PD0 2 RAM EEPROM
27 Timers
PC4 (ADC4/SDA/PCINT12)
(PCINT17/TXD) PD1 3 26 PC3 (ADC3/PCINT11)
PROGRAM
(PCINT18/INT0) PD2 4 MEGA328 25 PC2 (ADC2/PCINT10)
ROM
(PCINT19/OC2B/INT1) PD3 5 24 PC1 (ADC1/PCINT9)
Program
(PCINT20/XCK/T0) PD4 6 23 PC0 (ADC0/PCINT8)
Bus VCC
Bus 7 22 GND
CPU
GND 8 21 AREF
(PCINT6/XTAL1/TOSC1) PB6 9 20 AVCC
(PCINT7/XTAL2/TOSC2) PB7 10 19 PB5 (SCK/PCINT5)
(PCINT21/OC0B) PD5 11 18 PB4 (MISO/PCINT4)
(PCINT22/OC0A/AIN0) PD6 12 17 PB3 (MOSI/OC2A/PCINT3)
(PCINT23/AIN1) PD7 13
Interrupt 16 Other
PB2 (SS/OC1B/PCINT2)
OSC Ports
(PCINT0/CLKO/ICP1) PB0 14 Unit 15 Peripherals
PB1 (OC1A/PCINT1)

I/O
PINS

27
AVR different groups
• Classic AVR
– e.g. AT90S2313, AT90S4433
• Mega
– e.g. ATmega328, ATmega32, ATmega128
• Tiny
– e.g. ATtiny13, ATtiny25
• Special Purpose AVR
– e.g. AT90PWM216,AT90USB1287
• XMega
– New features like DMA, DAC, crypto engine, etc.

28
Naming Convention

ATtiny4 AT90S4

Atmel
Tiny Flash =4K Atmel Classic
Flash =4K
group group
Atmel AVR Atmega16 Microcontroller
Architecture of Atmega16
Applications
• AVR controllers come with a wide range of
applications where automation is required.
• Following are the main applications of Atmega16:
– Medical equipment
– Home automation
– Embedded systems
– Arduino Projects
– Used in automobiles and industrial automation
– Home appliances and security systems
– Temperature and pressure control devices
References 

You might also like