SlideShare uma empresa Scribd logo
1 de 45
Introduction to AVR Microcontrollers
by:
Eng. Mohamed Tarek.
© 2015 by Eng. Mohamed Tarek. 1
Micro-controller vs. Micro-processor
 Micro-controller
• Basically a microcontroller can be described as
a computer on a chip. a single chip containing
a CPU, non-volatile memory (RAM), volatile
memory(ROM), a timer and an I/O control unit.
• A microcontroller apart from the above mentioned
components usually also include serial
communication capabilities, interrupt controls and
analog I/O capabilities.
• Used for a few dedicated functions determined by
the system designer.
© 2015 by Eng. Mohamed Tarek. 2
Micro-controller vs. Micro-processor
Many IC’s into one IC
© 2015 by Eng. Mohamed Tarek. 3
Micro-controller vs. Micro-processor
 Microcontrollers don’t work alone in the circuit it must
interfaces with other on chip devices like Sensors,
Switches, Leds, LCD, Keypad and DC Motor
 Microcontroller can accept inputs from some
components and provide outputs to other components
within any given system.
 Differences in requirements, make the manufacturers
produce different microcontrollers with different
memory sizes, number of I/O lines and number of
integrated peripheral devices. Other wise they are all
similar to use.
© 2015 by Eng. Mohamed Tarek. 4
Micro-controller vs. Micro-processor
© 2015 by Eng. Mohamed Tarek. 5
Micro-controller vs. Micro-processor
 Micro-processor
• Just a CPU has to add externally memory, clock,
input/output interfaces, timer and all other
needed peripheral. This is the reason
a microprocessor has so many pins.
• The difference between a microcontroller and
a microprocessor is that the microprocessor is
a general purpose computer while a microcontroller
is a computer dedicated to one or just a few tasks.
© 2015 by Eng. Mohamed Tarek. 6
Micro-controller vs. Micro-processor
© 2015 by Eng. Mohamed Tarek. 7
Micro-Controller Components
 Processor
The processor refers to the Central Processing Unit (CPU) of the
microcontroller. It contains the Arithmetic Logic Unit (ALU), Control
Unit, Instruction Decoder and some Special Registers (Stack
Pointer, Status Register, Program Counter, etc.).
 Volatile Data Memory(RAM)
This is memory used by the microcontroller for temporary data
storage, system setup and peripherals configuration registers.
Memory in this category includes SRAM and DRAM. AVR
microcontrollers utilize SRAM.
© 2015 by Eng. Mohamed Tarek. 8
Micro-Controller Components
 Non-Volatile Program Memory
This is memory used by the microcontroller to store programs. Data
can also be stored in this memory but the access time is much
slower than that of RAM. Memory in this category includes ROM,
PROM, EPROM, EEPROM and FLASH. The AVR microcontrollers
utilize Flash for program storage, some AVR controllers contains a
bit of EEPROM as well to store non volatile data.
 Timer Module
Most microcontrollers have at least one timer/counter peripheral.
Timer/Counter modules are used to perform timing or counting
operations in the controller. These include time stamping, measuring
intervals, counting events, etc.
© 2015 by Eng. Mohamed Tarek. 9
Micro-Controller Components
 Interrupt Module
Interrupts enable the microcontroller to monitor certain events in the
background while executing and application program and react to
the event if necessary pausing the original program. This is all
coordinated by the interrupt module.
 Digital I/O Module
This module allows digital/logic communication with the
microcontroller and the external world. Communication signals are
that of TTL or CMOS logic.
 Analog I/O Modules
These modules are use to input/output analog information from/to
the external world. Analog modules include Analog Comparators
and Analog-to-Digital Converters.
© 2015 by Eng. Mohamed Tarek. 10
Micro-Controller Components
 Serial Modules
These modules are used for serial communication with the external
world. An example is the USART peripheral which utilizes the
RS232 standard. Serial Peripheral Interface(SPI) and Inter
Integrated Circuit(I2C).
© 2015 by Eng. Mohamed Tarek. 11
How to select a Micro-Controller
 Number of I/O ports.
 Peripherals required (Timers, ADC, USART,SPI and
EEPROM).
 Memory requirements.
 Maximum clock speed.
 Real-Time considerations.
 Number of interrupts required
 Power Consumption / sleep modes.
 Availability and Cost.
 Vendor Support.
 Development Environment.
12© 2015 by Eng. Mohamed Tarek.
Microcontroller Vendors
 Microcontroller Vendor is the manufacture of
the microcontroller chip it self.
© 2015 by Eng. Mohamed Tarek. 13
Vendor Families Derivative
AVR ATmega16
8051 AT83EB5114
PIC PIC16F877A
V850 V850ES
HC12 MC9S12XEP100
TM4C TM4C123GH6PM
AVR History
 AVR was developed in the year 1996 by Atmel
Corporation.
 The architecture of AVR was developed by Alf-Egil
Bogen and Vegard Wollan.
 AVR derives its name from its developers and stands for
Alf-Egil Bogen Vegard Wollan RISC microcontroller.
 Also known as Advanced Virtual RISC.
 The first microcontroller to hit the commercial market
was AT90S1200 in the year 1997.
© 2015 by Eng. Mohamed Tarek. 14
AVR Micro-controllers Categories
 1.TinyAVR
• Less memory
• small size
• suitable only for simpler applications.
 2.MegaAVR
• These are the most popular ones.
• having good amount of memory (up to 256 KB) higher number of
inbuilt peripherals.
• suitable for moderate to complex applications.
 3.XmegaAVR
• Used commercially for complex applications, which require large
program memory and high speed.
© 2015 by Eng. Mohamed Tarek. 15
AVR Micro-controllers Categories
© 2015 by Eng. Mohamed Tarek. 16
AVR Micro-controllers Categories
© 2015 by Eng. Mohamed Tarek. 17
What’s special about AVR?
 AVR micro-controllers are fast 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.
 Free IDE.
 Available in Egyptian market.
© 2015 by Eng. Mohamed Tarek. 18
What’s special about AVR?
 Comparison between the three most
commonly used families of microcontrollers:
© 2015 by Eng. Mohamed Tarek. 19
What’s special about AVR?
© 2015 by Eng. Mohamed Tarek. 20
What’s special about AVR?
 8-bit Micro-controllers
© 2015 by Eng. Mohamed Tarek. 21
What’s special about AVR?
 AVR follows Harvard Architecture
• the processor is equipped with separate memories and buses for
Program and the Data information. Here while an instruction is
being executed, the next instruction is pre-fetched from the
program memory.
© 2015 by Eng. Mohamed Tarek. 22
ATmega16
 Naming Convention
© 2015 by Eng. Mohamed Tarek. 23
Flavors of ATmega16
 There are two flavors for ATmega16 microcontroller:
1. ATmega16: Operating frequency range is 0 – 16 MHz.
2. ATmega16L: Operating frequency range is 0 – 8 MHz.
If we are using a crystal of 8 MHz = 8 x 106 Hertz =
8 Million cycles, then AVR can execute 8 million add
instructions per second.
© 2015 by Eng. Mohamed Tarek. 24
ATmega16 Architecture
© 2015 by Eng. Mohamed Tarek. 25
ATmega16 Architecture
 I/O Ports
ATmega16 has four (PORTA, PORTB, PORTC and PORTD) 8-bit
input-output ports.
 Timers/Counters
ATmega16 consists of two 8-bit and one 16-bit timer/counter.
 Watchdog Timer
Present with internal oscillator. Watchdog timer continuously
monitors and resets the controller if the code gets stuck at any
execution action for more than a defined time interval.
 ADC Interface
ATmega16 is equipped with an 8 channel ADC with a resolution of
10-bits.
© 2015 by Eng. Mohamed Tarek. 26
ATmega16 Architecture
 Analog Comparator
The Analog Comparator compares the input values of two analog
signals.
 Interrupt Unit
Consists of 21 interrupt sources out of which four are external. The
remaining are internal interrupts which support the peripherals like
USART, ADC, Timers etc.
 USART
Universal Synchronous and Asynchronous Receiver and
Transmitter interface is available for interfacing with external device
capable of communicating serially (data transmission bit by bit).
© 2015 by Eng. Mohamed Tarek. 27
ATmega16 Architecture
 TWI(Two Wire Interface )
Also called Inter-integrated Circuits can be used to set up a network
of devices, many devices can be connected over TWI interface
forming a network, the devices can simultaneously transmit and
receive and have their own unique address.
 SPI (Serial Peripheral Interface)
Used for serial communication between two devices on a
common clock source.
 ISP(In System Programmable )
Flash Memory which can be programmed without removing the IC
from the circuit.
© 2015 by Eng. Mohamed Tarek. 28
ATmega16 Architecture
 Internal Calibrated Oscillator
• ATmega16 is equipped with an internal oscillator for driving its
clock. By default ATmega16 is set to operate at internal
calibrated oscillator of 1 Mhz.
• The maximum frequency of internal oscillator is 8Mhz.
• ATmega16 can be operated using an external crystal oscillator
with a maximum frequency of 16MHz
© 2015 by Eng. Mohamed Tarek. 29
ATmega16 Architecture
 Memory: ATmega16 has three different memories
• Program flash EEPROM memory: ATmega16 is available with
16KB of in system programmable Flash EEPROM.
• SRAM(data memory) :ATmega16 is equipped with 1KB of
internal SRAM.
• Byte Addressable EEPROM: ATmega16 has 512 bytes of
EEPROM used to store non-volatile data.
Note: A small portion of SRAM is set aside for general
purpose registers used by CPU and for the peripheral
subsystems of the microcontroller.
© 2015 by Eng. Mohamed Tarek. 30
ATmega16 pins
© 2015 by Eng. Mohamed Tarek. 31
ATmega16 pins
© 2015 by Eng. Mohamed Tarek. 32
ATmega16 pins
© 2015 by Eng. Mohamed Tarek. 33
ATmega16 pins
© 2015 by Eng. Mohamed Tarek. 34
ATmega16 Active Low Reset circuit
R= 4.7KΩ
C= 0.1µf or 100nf
© 2015 by Eng. Mohamed Tarek. 35
Micro-controller clock
 Clock signal is a particular type of signal that oscillates
between a high and a low state, Circuits use the clock
signal for synchronization may become active at either
the rising edge, falling edge, or, in the case of double
data rate, both in the rising and in the falling edges of the
clock cycle.
 Microcontroller clock generator source could be internal
or external.
 Microcontroller external clock sources could be RC
oscillator or Crystal oscillator but internal clock source
could by RC oscillator only.
36© 2015 by Eng. Mohamed Tarek.
Micro-controller clock(External sources)
37
Crystal oscillator RC oscillator
© 2015 by Eng. Mohamed Tarek.
ATmega16 Internal Calibrated RC Oscillator
© 2015 by Eng. Mohamed Tarek. 38
ATmega16 External Crystal Oscillator
C1 = C2 = 12 - 22pf
© 2015 by Eng. Mohamed Tarek. 39
ATmega16 External Crystal Oscillator
© 2015 by Eng. Mohamed Tarek. 40
ATmega16 External Crystal Oscillator
 Example configure the µC to deal with 16Mhz Crystal
• CKSEL3  1
• CKSEL2  1
• CKSEL1  1
• CKSEL0  1
• CKOPT  0
© 2015 by Eng. Mohamed Tarek. 41
How to program AVR Microcontroller using ISP
 Connection between Microcontroller and PC
Parallel Port
© 2015 by Eng. Mohamed Tarek. 42
AVR Useful Tutorials
 http://maxembedded.com/
 http://extremeelectronics.co.in/
 http://www.embedds.com/avr-tutorials/
 http://avr-tutorials.com/
© 2015 by Eng. Mohamed Tarek. 43
© 2015 by Eng. Mohamed Tarek. 44
Contact Details
Eng. Mohamed Tarek.
Embedded Software Engineer
Mob: 01115154316
Mail: mtarek.2013@gmail.com
45
My Embedded Diploma Contents :
http://www.mediafire.com/download/94n11ai9ovo1xri/Embedded+Diploma+
Contents.pdf
Facebook Group :
https://www.facebook.com/groups/Embedded.Systems.Programming/
© 2015 by Eng. Mohamed Tarek.

Mais conteúdo relacionado

Mais procurados

L8 understanding-atmega328 p-1
L8 understanding-atmega328 p-1L8 understanding-atmega328 p-1
L8 understanding-atmega328 p-1rsamurti
 
Arm architecture chapter2_steve_furber
Arm architecture chapter2_steve_furberArm architecture chapter2_steve_furber
Arm architecture chapter2_steve_furberasodariyabhavesh
 
LPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLERLPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLERsravannunna24
 
L15 timers-counters-in-atmega328 p
L15 timers-counters-in-atmega328 pL15 timers-counters-in-atmega328 p
L15 timers-counters-in-atmega328 prsamurti
 
Pic microcontroller architecture
Pic microcontroller architecturePic microcontroller architecture
Pic microcontroller architectureDominicHendry
 
ATmega32-AVR microcontrollers-Part I
ATmega32-AVR microcontrollers-Part IATmega32-AVR microcontrollers-Part I
ATmega32-AVR microcontrollers-Part IVineethMP2
 
8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil KawareProf. Swapnil V. Kaware
 
Embedded Systems - Training ppt
Embedded Systems - Training pptEmbedded Systems - Training ppt
Embedded Systems - Training pptNishant Kayal
 
Microcontoller and Embedded System
Microcontoller and Embedded SystemMicrocontoller and Embedded System
Microcontoller and Embedded SystemKaran Thakkar
 
microcontroller vs microprocessor
microcontroller vs microprocessormicrocontroller vs microprocessor
microcontroller vs microprocessorsobhadevi
 
Microcontroller presentation
Microcontroller presentationMicrocontroller presentation
Microcontroller presentationxavierpaulino
 
Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)Aarav Soni
 
Msp 430 architecture module 1
Msp 430 architecture module 1Msp 430 architecture module 1
Msp 430 architecture module 1SARALA T
 

Mais procurados (20)

Embedded system
Embedded systemEmbedded system
Embedded system
 
Embedded System Basics
Embedded System BasicsEmbedded System Basics
Embedded System Basics
 
ARM Processors
ARM ProcessorsARM Processors
ARM Processors
 
L8 understanding-atmega328 p-1
L8 understanding-atmega328 p-1L8 understanding-atmega328 p-1
L8 understanding-atmega328 p-1
 
ATMEGA 328
ATMEGA 328ATMEGA 328
ATMEGA 328
 
Arm architecture chapter2_steve_furber
Arm architecture chapter2_steve_furberArm architecture chapter2_steve_furber
Arm architecture chapter2_steve_furber
 
LPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLERLPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLER
 
ARM Micro-controller
ARM Micro-controllerARM Micro-controller
ARM Micro-controller
 
L15 timers-counters-in-atmega328 p
L15 timers-counters-in-atmega328 pL15 timers-counters-in-atmega328 p
L15 timers-counters-in-atmega328 p
 
Pic microcontroller architecture
Pic microcontroller architecturePic microcontroller architecture
Pic microcontroller architecture
 
ATmega32-AVR microcontrollers-Part I
ATmega32-AVR microcontrollers-Part IATmega32-AVR microcontrollers-Part I
ATmega32-AVR microcontrollers-Part I
 
8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware
 
Embedded Systems - Training ppt
Embedded Systems - Training pptEmbedded Systems - Training ppt
Embedded Systems - Training ppt
 
Microcontoller and Embedded System
Microcontoller and Embedded SystemMicrocontoller and Embedded System
Microcontoller and Embedded System
 
ARM Architecture
ARM ArchitectureARM Architecture
ARM Architecture
 
microcontroller vs microprocessor
microcontroller vs microprocessormicrocontroller vs microprocessor
microcontroller vs microprocessor
 
Microcontroller presentation
Microcontroller presentationMicrocontroller presentation
Microcontroller presentation
 
Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)
 
ARM CORTEX M3 PPT
ARM CORTEX M3 PPTARM CORTEX M3 PPT
ARM CORTEX M3 PPT
 
Msp 430 architecture module 1
Msp 430 architecture module 1Msp 430 architecture module 1
Msp 430 architecture module 1
 

Semelhante a Introduction to AVR Microcontrollers

1.Introduction to AVR.pdf
1.Introduction to AVR.pdf1.Introduction to AVR.pdf
1.Introduction to AVR.pdfMostafaKhaled78
 
Intro to micro controller (Atmega16)
Intro to micro controller (Atmega16)Intro to micro controller (Atmega16)
Intro to micro controller (Atmega16)Ramadan Ramadan
 
introduction to embedded systems part 2
introduction to embedded systems part 2introduction to embedded systems part 2
introduction to embedded systems part 2Hatem Abd El-Salam
 
embedded systems - Developer Student Clubs.pptx.pdf
embedded systems - Developer Student Clubs.pptx.pdfembedded systems - Developer Student Clubs.pptx.pdf
embedded systems - Developer Student Clubs.pptx.pdfYoussefAbobakr
 
Overview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerOverview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerRup Chowdhury
 
Summer training embedded system and its scope
Summer training  embedded system and its scopeSummer training  embedded system and its scope
Summer training embedded system and its scopeArshit Rai
 
EE6602 Embedded System
EE6602 Embedded SystemEE6602 Embedded System
EE6602 Embedded Systemrmkceteee
 
Tutorial on avr atmega8 microcontroller, architecture and its applications
Tutorial on avr atmega8 microcontroller, architecture and its applicationsTutorial on avr atmega8 microcontroller, architecture and its applications
Tutorial on avr atmega8 microcontroller, architecture and its applicationsEdgefxkits & Solutions
 
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptxINDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptxMeghdeepSingh
 
Summer training embedded system and its scope
Summer training  embedded system and its scopeSummer training  embedded system and its scope
Summer training embedded system and its scopeArshit Rai
 
Solution manual the 8051 microcontroller based embedded systems
Solution manual the 8051 microcontroller based embedded systemsSolution manual the 8051 microcontroller based embedded systems
Solution manual the 8051 microcontroller based embedded systemsmanishpatel_79
 
Embedded training report(mcs 51)
Embedded training report(mcs 51)Embedded training report(mcs 51)
Embedded training report(mcs 51)Gurwinder Singh
 

Semelhante a Introduction to AVR Microcontrollers (20)

1.Introduction to AVR.pdf
1.Introduction to AVR.pdf1.Introduction to AVR.pdf
1.Introduction to AVR.pdf
 
Intro to micro controller (Atmega16)
Intro to micro controller (Atmega16)Intro to micro controller (Atmega16)
Intro to micro controller (Atmega16)
 
Micro controller
Micro controllerMicro controller
Micro controller
 
Microcontroller
MicrocontrollerMicrocontroller
Microcontroller
 
3.TechieNest microcontrollers
3.TechieNest  microcontrollers3.TechieNest  microcontrollers
3.TechieNest microcontrollers
 
introduction to embedded systems part 2
introduction to embedded systems part 2introduction to embedded systems part 2
introduction to embedded systems part 2
 
embedded systems - Developer Student Clubs.pptx.pdf
embedded systems - Developer Student Clubs.pptx.pdfembedded systems - Developer Student Clubs.pptx.pdf
embedded systems - Developer Student Clubs.pptx.pdf
 
Overview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerOverview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontroller
 
Summer training embedded system and its scope
Summer training  embedded system and its scopeSummer training  embedded system and its scope
Summer training embedded system and its scope
 
Embedded system
Embedded  systemEmbedded  system
Embedded system
 
EE6602 Embedded System
EE6602 Embedded SystemEE6602 Embedded System
EE6602 Embedded System
 
Tutorial on avr atmega8 microcontroller, architecture and its applications
Tutorial on avr atmega8 microcontroller, architecture and its applicationsTutorial on avr atmega8 microcontroller, architecture and its applications
Tutorial on avr atmega8 microcontroller, architecture and its applications
 
LECT 2.pptx
LECT 2.pptxLECT 2.pptx
LECT 2.pptx
 
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptxINDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
 
Summer training embedded system and its scope
Summer training  embedded system and its scopeSummer training  embedded system and its scope
Summer training embedded system and its scope
 
Solution manual the 8051 microcontroller based embedded systems
Solution manual the 8051 microcontroller based embedded systemsSolution manual the 8051 microcontroller based embedded systems
Solution manual the 8051 microcontroller based embedded systems
 
ankit
ankitankit
ankit
 
Embedded training report(mcs 51)
Embedded training report(mcs 51)Embedded training report(mcs 51)
Embedded training report(mcs 51)
 
Introduction in microcontroller
Introduction in microcontrollerIntroduction in microcontroller
Introduction in microcontroller
 
Atmega 128 datasheet
Atmega 128   datasheetAtmega 128   datasheet
Atmega 128 datasheet
 

Último

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 

Último (20)

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 

Introduction to AVR Microcontrollers

  • 1. Introduction to AVR Microcontrollers by: Eng. Mohamed Tarek. © 2015 by Eng. Mohamed Tarek. 1
  • 2. Micro-controller vs. Micro-processor  Micro-controller • Basically a microcontroller can be described as a computer on a chip. a single chip containing a CPU, non-volatile memory (RAM), volatile memory(ROM), a timer and an I/O control unit. • A microcontroller apart from the above mentioned components usually also include serial communication capabilities, interrupt controls and analog I/O capabilities. • Used for a few dedicated functions determined by the system designer. © 2015 by Eng. Mohamed Tarek. 2
  • 3. Micro-controller vs. Micro-processor Many IC’s into one IC © 2015 by Eng. Mohamed Tarek. 3
  • 4. Micro-controller vs. Micro-processor  Microcontrollers don’t work alone in the circuit it must interfaces with other on chip devices like Sensors, Switches, Leds, LCD, Keypad and DC Motor  Microcontroller can accept inputs from some components and provide outputs to other components within any given system.  Differences in requirements, make the manufacturers produce different microcontrollers with different memory sizes, number of I/O lines and number of integrated peripheral devices. Other wise they are all similar to use. © 2015 by Eng. Mohamed Tarek. 4
  • 5. Micro-controller vs. Micro-processor © 2015 by Eng. Mohamed Tarek. 5
  • 6. Micro-controller vs. Micro-processor  Micro-processor • Just a CPU has to add externally memory, clock, input/output interfaces, timer and all other needed peripheral. This is the reason a microprocessor has so many pins. • The difference between a microcontroller and a microprocessor is that the microprocessor is a general purpose computer while a microcontroller is a computer dedicated to one or just a few tasks. © 2015 by Eng. Mohamed Tarek. 6
  • 7. Micro-controller vs. Micro-processor © 2015 by Eng. Mohamed Tarek. 7
  • 8. Micro-Controller Components  Processor The processor refers to the Central Processing Unit (CPU) of the microcontroller. It contains the Arithmetic Logic Unit (ALU), Control Unit, Instruction Decoder and some Special Registers (Stack Pointer, Status Register, Program Counter, etc.).  Volatile Data Memory(RAM) This is memory used by the microcontroller for temporary data storage, system setup and peripherals configuration registers. Memory in this category includes SRAM and DRAM. AVR microcontrollers utilize SRAM. © 2015 by Eng. Mohamed Tarek. 8
  • 9. Micro-Controller Components  Non-Volatile Program Memory This is memory used by the microcontroller to store programs. Data can also be stored in this memory but the access time is much slower than that of RAM. Memory in this category includes ROM, PROM, EPROM, EEPROM and FLASH. The AVR microcontrollers utilize Flash for program storage, some AVR controllers contains a bit of EEPROM as well to store non volatile data.  Timer Module Most microcontrollers have at least one timer/counter peripheral. Timer/Counter modules are used to perform timing or counting operations in the controller. These include time stamping, measuring intervals, counting events, etc. © 2015 by Eng. Mohamed Tarek. 9
  • 10. Micro-Controller Components  Interrupt Module Interrupts enable the microcontroller to monitor certain events in the background while executing and application program and react to the event if necessary pausing the original program. This is all coordinated by the interrupt module.  Digital I/O Module This module allows digital/logic communication with the microcontroller and the external world. Communication signals are that of TTL or CMOS logic.  Analog I/O Modules These modules are use to input/output analog information from/to the external world. Analog modules include Analog Comparators and Analog-to-Digital Converters. © 2015 by Eng. Mohamed Tarek. 10
  • 11. Micro-Controller Components  Serial Modules These modules are used for serial communication with the external world. An example is the USART peripheral which utilizes the RS232 standard. Serial Peripheral Interface(SPI) and Inter Integrated Circuit(I2C). © 2015 by Eng. Mohamed Tarek. 11
  • 12. How to select a Micro-Controller  Number of I/O ports.  Peripherals required (Timers, ADC, USART,SPI and EEPROM).  Memory requirements.  Maximum clock speed.  Real-Time considerations.  Number of interrupts required  Power Consumption / sleep modes.  Availability and Cost.  Vendor Support.  Development Environment. 12© 2015 by Eng. Mohamed Tarek.
  • 13. Microcontroller Vendors  Microcontroller Vendor is the manufacture of the microcontroller chip it self. © 2015 by Eng. Mohamed Tarek. 13 Vendor Families Derivative AVR ATmega16 8051 AT83EB5114 PIC PIC16F877A V850 V850ES HC12 MC9S12XEP100 TM4C TM4C123GH6PM
  • 14. AVR History  AVR was developed in the year 1996 by Atmel Corporation.  The architecture of AVR was developed by Alf-Egil Bogen and Vegard Wollan.  AVR derives its name from its developers and stands for Alf-Egil Bogen Vegard Wollan RISC microcontroller.  Also known as Advanced Virtual RISC.  The first microcontroller to hit the commercial market was AT90S1200 in the year 1997. © 2015 by Eng. Mohamed Tarek. 14
  • 15. AVR Micro-controllers Categories  1.TinyAVR • Less memory • small size • suitable only for simpler applications.  2.MegaAVR • These are the most popular ones. • having good amount of memory (up to 256 KB) higher number of inbuilt peripherals. • suitable for moderate to complex applications.  3.XmegaAVR • Used commercially for complex applications, which require large program memory and high speed. © 2015 by Eng. Mohamed Tarek. 15
  • 16. AVR Micro-controllers Categories © 2015 by Eng. Mohamed Tarek. 16
  • 17. AVR Micro-controllers Categories © 2015 by Eng. Mohamed Tarek. 17
  • 18. What’s special about AVR?  AVR micro-controllers are fast 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.  Free IDE.  Available in Egyptian market. © 2015 by Eng. Mohamed Tarek. 18
  • 19. What’s special about AVR?  Comparison between the three most commonly used families of microcontrollers: © 2015 by Eng. Mohamed Tarek. 19
  • 20. What’s special about AVR? © 2015 by Eng. Mohamed Tarek. 20
  • 21. What’s special about AVR?  8-bit Micro-controllers © 2015 by Eng. Mohamed Tarek. 21
  • 22. What’s special about AVR?  AVR follows Harvard Architecture • the processor is equipped with separate memories and buses for Program and the Data information. Here while an instruction is being executed, the next instruction is pre-fetched from the program memory. © 2015 by Eng. Mohamed Tarek. 22
  • 23. ATmega16  Naming Convention © 2015 by Eng. Mohamed Tarek. 23
  • 24. Flavors of ATmega16  There are two flavors for ATmega16 microcontroller: 1. ATmega16: Operating frequency range is 0 – 16 MHz. 2. ATmega16L: Operating frequency range is 0 – 8 MHz. If we are using a crystal of 8 MHz = 8 x 106 Hertz = 8 Million cycles, then AVR can execute 8 million add instructions per second. © 2015 by Eng. Mohamed Tarek. 24
  • 25. ATmega16 Architecture © 2015 by Eng. Mohamed Tarek. 25
  • 26. ATmega16 Architecture  I/O Ports ATmega16 has four (PORTA, PORTB, PORTC and PORTD) 8-bit input-output ports.  Timers/Counters ATmega16 consists of two 8-bit and one 16-bit timer/counter.  Watchdog Timer Present with internal oscillator. Watchdog timer continuously monitors and resets the controller if the code gets stuck at any execution action for more than a defined time interval.  ADC Interface ATmega16 is equipped with an 8 channel ADC with a resolution of 10-bits. © 2015 by Eng. Mohamed Tarek. 26
  • 27. ATmega16 Architecture  Analog Comparator The Analog Comparator compares the input values of two analog signals.  Interrupt Unit Consists of 21 interrupt sources out of which four are external. The remaining are internal interrupts which support the peripherals like USART, ADC, Timers etc.  USART Universal Synchronous and Asynchronous Receiver and Transmitter interface is available for interfacing with external device capable of communicating serially (data transmission bit by bit). © 2015 by Eng. Mohamed Tarek. 27
  • 28. ATmega16 Architecture  TWI(Two Wire Interface ) Also called Inter-integrated Circuits can be used to set up a network of devices, many devices can be connected over TWI interface forming a network, the devices can simultaneously transmit and receive and have their own unique address.  SPI (Serial Peripheral Interface) Used for serial communication between two devices on a common clock source.  ISP(In System Programmable ) Flash Memory which can be programmed without removing the IC from the circuit. © 2015 by Eng. Mohamed Tarek. 28
  • 29. ATmega16 Architecture  Internal Calibrated Oscillator • ATmega16 is equipped with an internal oscillator for driving its clock. By default ATmega16 is set to operate at internal calibrated oscillator of 1 Mhz. • The maximum frequency of internal oscillator is 8Mhz. • ATmega16 can be operated using an external crystal oscillator with a maximum frequency of 16MHz © 2015 by Eng. Mohamed Tarek. 29
  • 30. ATmega16 Architecture  Memory: ATmega16 has three different memories • Program flash EEPROM memory: ATmega16 is available with 16KB of in system programmable Flash EEPROM. • SRAM(data memory) :ATmega16 is equipped with 1KB of internal SRAM. • Byte Addressable EEPROM: ATmega16 has 512 bytes of EEPROM used to store non-volatile data. Note: A small portion of SRAM is set aside for general purpose registers used by CPU and for the peripheral subsystems of the microcontroller. © 2015 by Eng. Mohamed Tarek. 30
  • 31. ATmega16 pins © 2015 by Eng. Mohamed Tarek. 31
  • 32. ATmega16 pins © 2015 by Eng. Mohamed Tarek. 32
  • 33. ATmega16 pins © 2015 by Eng. Mohamed Tarek. 33
  • 34. ATmega16 pins © 2015 by Eng. Mohamed Tarek. 34
  • 35. ATmega16 Active Low Reset circuit R= 4.7KΩ C= 0.1µf or 100nf © 2015 by Eng. Mohamed Tarek. 35
  • 36. Micro-controller clock  Clock signal is a particular type of signal that oscillates between a high and a low state, Circuits use the clock signal for synchronization may become active at either the rising edge, falling edge, or, in the case of double data rate, both in the rising and in the falling edges of the clock cycle.  Microcontroller clock generator source could be internal or external.  Microcontroller external clock sources could be RC oscillator or Crystal oscillator but internal clock source could by RC oscillator only. 36© 2015 by Eng. Mohamed Tarek.
  • 37. Micro-controller clock(External sources) 37 Crystal oscillator RC oscillator © 2015 by Eng. Mohamed Tarek.
  • 38. ATmega16 Internal Calibrated RC Oscillator © 2015 by Eng. Mohamed Tarek. 38
  • 39. ATmega16 External Crystal Oscillator C1 = C2 = 12 - 22pf © 2015 by Eng. Mohamed Tarek. 39
  • 40. ATmega16 External Crystal Oscillator © 2015 by Eng. Mohamed Tarek. 40
  • 41. ATmega16 External Crystal Oscillator  Example configure the µC to deal with 16Mhz Crystal • CKSEL3  1 • CKSEL2  1 • CKSEL1  1 • CKSEL0  1 • CKOPT  0 © 2015 by Eng. Mohamed Tarek. 41
  • 42. How to program AVR Microcontroller using ISP  Connection between Microcontroller and PC Parallel Port © 2015 by Eng. Mohamed Tarek. 42
  • 43. AVR Useful Tutorials  http://maxembedded.com/  http://extremeelectronics.co.in/  http://www.embedds.com/avr-tutorials/  http://avr-tutorials.com/ © 2015 by Eng. Mohamed Tarek. 43
  • 44. © 2015 by Eng. Mohamed Tarek. 44
  • 45. Contact Details Eng. Mohamed Tarek. Embedded Software Engineer Mob: 01115154316 Mail: mtarek.2013@gmail.com 45 My Embedded Diploma Contents : http://www.mediafire.com/download/94n11ai9ovo1xri/Embedded+Diploma+ Contents.pdf Facebook Group : https://www.facebook.com/groups/Embedded.Systems.Programming/ © 2015 by Eng. Mohamed Tarek.