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

MCU Overview

Uploaded by

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

MCU Overview

Uploaded by

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

AVR Microcontroller: History, Features &

Family Overview

S u m a i y a Ta s n i m
Lecturer(Provisional)
Department of CSE
Va r e n d r a U n i v e r s i t y
CSE-425
Reference: Second chapter of textbook
Acknowledgment: Some websites and Chung-Ping Young from Dept. of Computer Science and
Information Engineering, National Cheng Kung University, TAIWAN
Lecture Objective

Upon completion of this lecture, the students will be able to:


• Compare and contrast microprocessors and microcontrollers
• Explain the concept of embedded system
• Determine criteria before considering a microcontroller
• Compare and contrast the various members of the AVR family
Sections

• Microprocessor & Embedded system


• Overview of the AVR family
Microcontroller vs Microprocessor
What is a microprocessor?
The microprocessor is an electronic component. It is kind of computer
processor that resides on single or multiple integrated circuits (IC). This IC
contains many other electronics components such as a resistor, transistor,
diode… The microprocessor performs all the functions of the central
processing system. One way it differs from CPU as it occupies small space
and resides on only a couple of integrated circuits
It does not have I/O peripheral component and internal memory. So it
requires external components such as RAM, ROM, timer, Serial interface,
I/O port to operate.
How does a microprocessor work?
Microprocessor holds the number of instruction. Every instruction consists of
multiple steps such as fetch, decode, executes and store. While running
instruction in the microprocessor, it executes multiple steps as Fetch the input,
Decode instruction, Execute instruction, Store result back in the memory.
Here, Instruction gets fetched and Input to is given using external I/O
components. The microprocessor executes an instruction. The result gets stored in
the externally connected memory unit hghgh.
What is microcontroller ?
The microcontroller is the electronic device. It has its own processing unit
along with fixed sized ROM, RAM, and other required peripheral
components. These all the components are embedded on the single chip.
As it has all the components required to process and store data, it is also
called as mini computer or computer on the single chip.
H o w d i ff e r e n t a m i c r o p r o c e s s o r i s , f r o m a m i c r o c o n t r o l l e r ?
Microprocessor: Microcontroller:
• Must add RAM, ROM, I/O • The fixed amount of on-chip ROM,
ports, and timers externally to RAM, and number of I/O ports
make them functional makes them ideal for many
applications in which cost and
• Makes the system bulkier and
space are critical
much more expensive
• In many applications, the space it
• Have the advantage of
takes, the power it consumes, and
versatility on the amount of the price per unit are much more
RAM, ROM, and I/O ports critical considerations than the
computing power
Ta s k :
W i t h p r o p e r e x p l a n a ti o n , d i s c u s s h o w a m i c r o c o n t r o l l e r
f u n c ti o n s d i ff e r e n t l y f r o m a m i c r o c o m p u t e r s y s t e m .
Microcontrollers for Embedded system
What is an embedded system?
• An embedded system is a microprocessor-based computer hardware system with
software that is designed to perform a dedicated function, either as an
independent system or as a part of a large system. At the core is an integrated
circuit designed to carry out computation for real-time operations.
• Complexities range from a single microcontroller to a suite of processors with
connected peripherals and networks; from no user interface to complex graphical
user interfaces. The complexity of an embedded system varies significantly
depending on the task for which it is designed.
• Embedded system applications range from digital watches and microwaves to
hybrid vehicles. As much as 98 percent of all microprocessors manufactured are
used in embedded systems.
H o w a n E m b e d d e d S y s t e m Wo r k s :
• Embedded systems are managed by microcontrollers or digital signal
processors (DSP), application-specific integrated circuits (ASIC), field-
programmable gate arrays (FPGA), GPU technology, and gate arrays. These
processing systems are integrated with components dedicated to handling
electric and/or mechanical interfacing.
• Embedded systems programming instructions, referred to as firmware, are
stored in read-only memory or flash memory chips, running with limited
computer hardware resources. Embedded systems connect with the outside
world through peripherals, linking input and output devices.
Basic Structure of an Embedded System:

The basic structure of an embedded system includes the following components:


• Sensor: The sensor measures and converts the physical quantity to an electrical signal, which can
then be read by an embedded systems engineer or any electronic instrument. A sensor stores the
measured quantity to the memory.
• A-D Converter: An analog-to-digital converter converts the analog signal sent by the sensor into
a digital signal.
• Processor & ASICs: Processors assess the data to measure the output and store it to the
memory.
• D-A Converter: A digital-to-analog converter changes the digital data fed by the processor to
analog data
• Actuator: An actuator compares the output given by the D-A Converter to the actual output
stored and stores the approved output.
Future Trends in Embedded Systems:
• The industry for embedded systems is expected to continue growing
rapidly, driven by the continued development of Artificial Intelligence (AI),
Virtual Reality (VR) and Augmented Reality (AR), machine learning , deep
learning, and the Internet of Things (IoT). The cognitive embedded system
will be at the heart of such trends as: reduced energy consumption,
improved security for embedded devices, cloud connectivity and mesh
networking, deep learning applications, and visualization tools with real
time data.
• According to a 2018 report published by QYResearch, the global market
for the embedded systems industry was valued at $68.9 billion in 2017
and is expected to rise to $105.7 billion by the end of 2025.
Embedded system: General-purpose system:

• An embedded product uses a • A PC, in contrast with the embedded


microprocessor (or system, can be used for any number of
microcontroller) to do one task applications.
and one task only • It has RAM memory and an operating
• There is only one application system that loads a variety of applications
software that is typically burned into RAM and lets the CPU run them
into ROM • A PC contains or is connected to various
embedded products and each one
peripheral has a microcontroller inside it
that performs only one task
Some Embedded Products Using Microcontrollers:
Office: Home: Auto:
Telephones, Appliances, intercom, telephones, Trip computer,
computers, security systems, garage door engine control, air
security openers, answering machines, fax bag, ABS,
systems, fax machines, home computers, TVs, instrumentation,
machines, cable TV tuner, VCR, camcorder, security system,
microwave, remote controls, video games, transmission control,
copier, laser cellular phones, musical instruments, entertainment,
printer, color sewing machines, lighting control, climate control,
printer, paging paging, camera, pinball machines, cellular phone,
toys, exercise equipment keyless entry
Criteria for Choosing a microcontroller:

The most important factor is that the microcontroller should be cost-efficient


and work capably to handle the dedicated task. Some questions that should
be asked while deciding on a microcontroller are as follows:

1. What is the maximum speed of the microcontroller?


2. What is the amount of RAM and ROM on chip?
3. How easy it is to upgrade to higher upgrade or lower consumption versions?
4. Is the microcontroller readily available at cheaper rates?
5. What is the number of I/O pins and timer on the chip?
Criteria for Choosing a microcontroller:

Meeting the computing needs of the task at hand efficiently and cost effectively
• Speed
• Packaging
• Power consumption
• The amount of RAM and ROM on chip
• The number of I/O pins and the timer on chip
• How easy to upgrade to higher performance or lower power-consumption versions
• Cost per unit
Criteria for Choosing a microcontroller:
• Availability of software development tools such as compilers, assemblers,
and debuggers
• Wide availability and reliable sources of the microcontroller
• The 8051 family has the largest number of diversified (multiple source) suppliers
• Intel (original)
• Atmel
• Philips/Signetics
• AMD
• Infineon (formerly Siemens)
• Matra
• Dallas Semiconductor/Maxim
Overview of the AVR family
A b r i e f h i s t o r y o f t h e AV R m i c ro c o n t ro l l e r :
• The basic architecture of AVR was designed by two students of Norwegian Institute of
Technology(NTH), Alf-Egil Bogen and Vegard Wollan and then was bought and developed by
Atmel in 1996.
• One might wonder what AVR stands for! AVR can have different meanings for different people!
According to Atmel, it is nothing more than a product name but it might stands for Advanced
Virtual RISC or Alf and Vegard RISC.
• There are many kinds of AVR microcontroller with different properties. Except for AVR32,
which is a 32 bit microcontroller, AVRs all are 8-bit microprocessors.
• One of the problems with the AVR microcontrollers is that they are not all 100% compatible in
terms of software. To run programs written for the ATtiny25 on a ATmega64, we must recompile
the program and possibly change some register locations before loading it into the ATmega64.
What’s special about AVR?
They are fast.  An AVR microcontroller executes most of the instructions in single
execution cycle. AVRs are about 4 times faster than PICs, they consume less power and
can be operated in different power saving modes. Let’s do the comparison between the
three most commonly used families of microcontrollers:

 Criteria 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


Overview of the AVR family
AVR can be classified into four groups:
• Classic AVR (AT90Sxxxx): The original AVR chip, which has been replaced by newer AVR
chips. For new designs, they are not recommended. Like: AT90S2313, AT90S2323,
AT90S4433
• Mega AVR (ATmegaxxxx): Powerful microcontrollers with more than 120 instructions and
lots of different peripheral capabilities which can be used in different designs. These are the
most popular ones having good amount of memory (upto 256 KB), higher number of inbuilt
peripherals and suitable for moderate to complex applications.
• Tiny AVR (ATtinyxxxx): Less memory, small size, suitable only for simpler applications. Like
ATtiny13, ATtiny25, ATtiny44
• Special purpose AVR: The IC’s of this group can be considered as a subset of other groups
but their special capabilities are made for designing specific applications like USB controller,
LCD controller etc. Example: ATmega169, AT90CAN128, AT90USB1287, AT90PWM216
Let’s do the comparison between available series of AVR microcontrollers:

Series Name Pins Flash Memory Special Feature


TinyAVR 6-32 0.5-8 KB Small in size

MegaAVR 28-100 4-256KB Extended peripherals


DMA , Event System
XmegaAVR 44-100 16-384KB
included
AVR product number scheme
• All the product numbers start with AT that stands for Atmel.
• Look at the number at the end, from left to right and find the biggest number
that is a power of 2. This number most probably shows the amount of the
microcontroller’s ROM. For example, in ATmega1280 the biggest power 2
that we can find is 128, so it has 128K bytes of ROM.
• Although this rule has a few exception such as AT90PWM216 that has 16K
of ROM instead of 2K, it works in most of the cases.
AVR features
AVR is an 8-bit RISC single-chip microcontroller Harvard architecture that comes with
some standard features like:
• On-chip program (code) ROM
• Data (RAM)
• Data (EEPROM)
• Timer
• I/O ports
• Interrupt
• Most AVRs have some additional features like ADC, PWM, different kind of serial
interface like USART, SPI, I2C (TWI), CAN, USB and so on.
A s i m p l i fi e d v i e w o f a n AV R M i c r o c o n t r o l l e r :

Program RAM EEPROM Timers


ROM

CPU

OSC Interrupt I/O Other


Unit Ports Peripherals
AVR features
• AVR microcontroller program ROM: In microcontroller, the ROM is used to store
programs and for that it is called program or code ROM. The AVR has 8M of program
ROM space, not all members come with that much ROM installed. The size can vary
from 1K to 256K at the time of writing, depending on the family member. AVR was
the first microcontroller to use flash memory for program storage.
• AVR microcontroller data RAM and EEPROM: RAM space is used for data storage. The
AVR has a maximum of 64K bytes of data RAM space though not all family member
comes with that much. The data RAM space has 3 components: general-purpose
registers, I/O memory and internal SRAM. There are 32 general purpose register in all
of the AVRs but the SRAM’s size and I/O memory’s size vary from chip to chip. AVRs
have also a small amount of EEPROM that does not need to be changed very often.
AVR features
• AVR microcontroller I/O pins: AVR can have from 3 to 86 pins for I/O. The number of
pins depend on the number of pins in the package itself. The number of pins for the
AVR package goes from 8 to 100 at this time. In the case of 8-pin AT90S2323, we
have 3 pins for I/O. While in 100-pin ATmega1280, we can use up to 86 pins for I/O.
• AVR microcontroller peripherals: Most of the AVR comes with ADC (analog-to-digital
converter), timers, USART (universal synchronous asynchronous receiver transmitter)
as standard peripherals. ADC is 10bit and number of ADC channels in AVR chip can
vary and can be up to 16 depending on the pin of package. The AVR can have up to 6
timers beside watchdog timer. Most of the AVR family comes with the I2C and SPI
buses and some of them have USB or CAN bus as well. USART peripheral allows us to
connect the AVR based system to serial ports.
Features of ATmega32
• High-performance, Low-power AVR® 8-bit Microcontroller
• Advanced RISC Architecture
– 131 Powerful Instructions
– Most Single-clock Cycle Execution
– 32 x 8 General Purpose Working Registers
– Fully Static Operation
• High Endurance Non-volatile Memory segments
– 32K Bytes of In-System Self-programmable Flash program memory
– 1024 Bytes EEPROM
– 2K Byte Internal SRAM
– Write/Erase Cycles: 10,000 Flash/100,000 EEPROM
– Data retention: 20 years at 85°C/100 years at 25°C(1)
– Programming by On-chip Boot Program True Read-While-Write Operation
– Programming Lock for Software Security
Features of ATmega32
• Peripheral Features
– Two 8-bit Timer/Counters with Separate Prescalers and Compare Modes
– One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture Mode
– Real Time Counter with Separate Oscillator
– Four PWM Channels
– 8-channel, 10-bit ADC 8 Single-ended Channels 7 Differential Channels in TQFP Package Only 2
Differential Channels with Programmable Gain at 1x, 10x, or 200x
– Byte-oriented Two-wire Serial Interface
– Programmable Serial USART
– Master/Slave SPI Serial Interface
– Programmable Watchdog Timer with Separate On-chip Oscillator
– On-chip Analog Comparator
Features of ATmega32
• Special Microcontroller Features
– Power-on Reset and Programmable Brown-out Detection
– Internal Calibrated RC Oscillator
– External and Internal Interrupt Sources
– Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, Standby and Extended
Standby
• I/O and Packages
– 32 Programmable I/O Lines
– 40-pin PDIP, 44-lead TQFP, and 44-pad QFN/MLF
• Operating Voltages
– 2.7 - 5.5V for ATmega32L
– 4.5 - 5.5V for ATmega32
Features of ATmega32
• Speed Grades
– 0 - 8 MHz for ATmega32L
– 0 - 16 MHz for ATmega32
• Power Consumption at 1 MHz, 3V, 25°C for ATmega32L
– Active: 1.1 mA
– Idle Mode: 0.35 mA
– Power-down Mode: < 1 μA
Features of ATmega8
• High-performance, Low-power AVR® 8-bit Microcontroller
• Advanced RISC Architecture
– 130 Powerful Instructions
– Most Single-clock Cycle Execution
– 32 x 8 General Purpose Working Registers
– Fully Static Operation – Up to 16 MIPS Throughput at 16 MHz
– On-chip 2-cycle Multiplier

• High Endurance Non-volatile Memory segments


– 8K Bytes of In-System Self-programmable Flash program memory
– 512 Bytes EEPROM
– 1K Byte Internal SRAM
– Write/Erase Cycles: 10,000 Flash/100,000 EEPROM – Data retention: 20 years at 85°C/100 years at 25°C(1)
– Optional Boot Code Section with Independent Lock Bits In-System Programming by On-chip Boot Program True Read-While-Write
Operation
– Programming Lock for Software Security
Features of ATmega8
• Peripheral Features
– Two 8-bit Timer/Counters with Separate Prescaler, one Compare Mode
– One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture Mode
– Real Time Counter with Separate Oscillator
– Three PWM Channels
– 8-channel ADC in TQFP and QFN/MLF package Eight Channels 10-bit Accuracy
– 6-channel ADC in PDIP package Six Channels 10-bit Accuracy
– Byte-oriented Two-wire Serial Interface
– Programmable Serial USART
– Master/Slave SPI Serial Interface
– Programmable Watchdog Timer with Separate On-chip Oscillator
– On-chip Analog Comparator
Features of ATmega8
• Special Microcontroller Features
– Power-on Reset and Programmable Brown-out Detection
– Internal Calibrated RC Oscillator
– External and Internal Interrupt Sources
– Five Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, and Standby

• I/O and Packages


– 23 Programmable I/O Lines
– 28-lead PDIP, 32-lead TQFP, and 32-pad QFN/MLF

• Operating Voltages
– 2.7 - 5.5V (ATmega8L)
– 4.5 - 5.5V (ATmega8)
Features of ATmega8

• Speed Grades
– 0 - 8 MHz (ATmega8L)
– 0 - 16 MHz (ATmega8)

• Power Consumption at 4 Mhz, 3V, 25°C


– Active: 3.6 mA
– Idle Mode: 1.0 mA
– Power-down Mode: 0.5 μA
T h e m e g a AV R f a m i l y :

Part Name ROM RAM EEPROM I/0 Timer Interrupts Operation V Operating Packaging
Pins oltage frequency
ATmega8 8KB 1KB 512B 23 3 19 4.5-5.5 V 0-16 MHz 28
ATmega8L 8KB 1KB 512B 23 3 19 2.7-5.5 V 0-8 MHz 28
ATmega16 16KB 1KB 512B 32 3 21 4.5-5.5 V 0-16 MHz 40

ATmega16L 16KB 1KB 512B 32 3 21 2.7-5.5 V 0-8 MHz 40

ATmega32 32KB 2KB 1KB 32 3 21 4.5-5.5 V 0-16 MHz 40

ATmega32L 32KB 2KB 1KB 32 3 21 2.7-5.5 V 0-8 MHz 40


“The people who are crazy
enough to think they can change
the world are the ones who do.”
Steve Jobs

You might also like