SlideShare a Scribd company logo
Avr microcontroller
Embedded System
IS COMBINATION OF HARDWARE AND SOFTWARE
• “ An embedded system can be defined as those control
systems which are designed either by microprocessor or
microcontroller for a specific tasks. ”
• “ An embedded system is some combination of computer
hardware & software, either fixed in capability or
programmable, that is specifically designed for a particular
kind of application device. "
EMBEDDED SYSTEM
Embedded System In Daily Life
Moving message display
DVD player Traffic Light
Digital clock
Game
APPLICATION
.
INPUT OUTPUT
RAM ROM
MICROCONTROLLER
Microprocessor & Microcontroller
Microprocessor:
A silicon chip that contains a CPU. In the world of personal computers, the
terms microprocessor and CPU are used interchangeably. At the heart of all
personal computers and most of all automatic systems.
Microcontroller :
A microcontroller (sometimes abbreviated µC, uC or MCU) is a small
computer on a single integrated circuit containing a processor core, memory,
and programmable input/output peripherals.
Basic Block Diagram of Microcontroller
AVR
A: Advance
V: Virtual
R:Risc
AVR
ATMEGA 8
MICRO-CONTROLLER
It was developed by Atmel Corporation
‘8’ in Atmega8 means this microcontroller has 8Kb of flash
memory
ALL AVR MC Is 8 bit microcontroller.
It was developed in the year 1996 by Atmel Corporation.
What is RISC?
 RISC stands for “Reduced Instruction Set Computer”
It is a very fast architecture which executes one instruction per clock
cycle.
RISC contains very small instruction set.
Programming is easy, but code length increases.
.
Some xtra FEATURES
• Up to 16 MIPS Throughput at 16 MHz
• 32 x 8 General Purpose Working Registers
• Six ADC channels in PDIP package
• Internal Calibrated Oscillator of 2,4,8 MHz.
MEMORY SEGMENTS
• 8K Bytes of Flash program memory
• 512 Bytes EEPROM (Electrically Erasable
Programmable Read Only Memory)
• 1K Byte Internal RAM (Random Access Memory)
Avr microcontroller
Atmega8
PORTB-8ch
PORTC-7ch
PORTD-8ch
total port pin:23
1.VCC
2.GND
3.GND
4.AVCC
5.AREF
PORT
PORT is use for input and out put communication.
PORT are 8 bit wide.
PORT are bidirectional data bus.
Every PORT has three registers associated with it each one with 8 bit.
PB7 PB6 PB5 PB4 PB3 PB2 PB1 PB0
PORT IS 8 BIT REGISTERS.
PORT IS COMBINATION OF 8 FLIP FLOP
PORTB
PORTC
-------- PC6 PC5 PC4 PC3 PC2 PC1 PC0
PD7 PD6 PD5 PD4 PD3 PD2 PD1 PD0
PORTD
PORT Associated Registers
DDRx – Data Direction Register
PORTx – Pin Output Register
PINx – Pin Input Register
where x = GPIO port name ( B, C or D)
DDRx register
DDRx (Data Direction Register) configures data direction of port pins. Means its
setting determines whether port pins will be used for input or output. Writing 0
to a bit in DDRx makes corresponding port pin as input, while writing 1 to a bit in
DDRx makes corresponding port pin as output.
0 0 0 0 0 0 0 0DDRB=
PORTB is become input. DDRB=0b00000000
1 1 1 1 1 1 1 1DDRB=
PORTB is become OUTPUT DDRB=0b11111111
PORTx register
 PORT give output voltage to external hardware.
 PORT is similar as printf .
PORTB=0b00000000
0 0 0 0 0 0 0 0
PORTB provide low (0) voltage to blub.
PORTx register
 PORT give output voltage to external hardware.
 PORT is similar as printf .
PORTB=0b11111111
1 1 1 1 1 1 1 1
PORTB provide high (5) voltage to blub.
PORTx register
 PORT give output voltage to external hardware.
 PORT is similar as printf .
PORTB=0b11000011
1 1 0 0 0 0 1 1
PORTB provide high (5) voltage to blub.
INTERFACING LED WITH ATMEGAX
LED stands for "Light Emmiting Diode", It has 2 PINs one for +ve Source and the other one for Ground
Basically 5mm LEDs work at 20mA and 3V
current. Now the question comes, How to get the
same Value of source from the MCU. Well,
actually Micro Controller can provide constant 5V
with 20mA Current through its PORTs(A to D)
Lets calculate the Resistance Value, Our Requirements : 20mA , 3V
We Have : 20mA, 5V.So, we need to Decrese the Voltage by 2V.
The Current Flowing in the Cct is 20mA.
V = I X R .
V = 2V.
I = 20mA.
R= ?
2= 0.020 X R
=> R = 2 / 0.020
= 100 Ohm.
LED BLINKING
STEP1:
Make Portb as output
DDRB=0b11111111
STEP2:
Provide +5v to LED.
PORTB=0b11111111
LED BLINKING
shifting
PORTB=0b00000001
PORTB=0b00000010
PORTB=0b00000100
PORTB=0b00001000
PORTB=0b00010000
PORTB=00100000
STEP1: WRITING CODE.
STEP2: COMPILE CODE.
STEP3: FLASH HEX FILE INTO AVR MICROCONTROLLER
COMPUTER
.hex file
Thanks........

More Related Content

What's hot (20)

PPTX
Difference Between Microprocessors and Microcontrollers
elprocus
 
PDF
AVR Microcontroller
Özcan Acar
 
PDF
Introduction to Microcontroller
Pantech ProLabs India Pvt Ltd
 
PPT
8051 instruction set
Andri Prastiyo
 
PPT
Interfacing adc
PRADEEP
 
PPTX
Pulse width modulation (PWM)
amar pandey
 
PDF
Question Bank microcontroller 8051
Nilesh Bhaskarrao Bahadure
 
PPT
8051 MICROCONTROLLER
THANDAIAH PRABU
 
PPTX
Microprocessor and microcontrollers
Hiran Gabriel
 
PPTX
AVR ATmega32
Prashant Tiwari
 
PDF
ASK,FSK and M-PSK using Matlab
Amirah Nadrah Ghazali
 
PDF
8085 microprocessor notes
Prof. Dr. K. Adisesha
 
DOC
8051 Microcontroller Notes
Dr.YNM
 
PPT
AVR Fundamentals
Vinit Vyas
 
PPTX
Semiconductor memories
SambitShreeman
 
PPTX
AVRTIMER.pptx
Pratik Gohel
 
PPT
Rs232 485 fundamental
rounak077
 
PPT
Introduction to stm32-part2
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
PPTX
ATMEGA 328
ABHISHEK MAURYA
 
PPTX
Pic 18 microcontroller
Ashish Ranjan
 
Difference Between Microprocessors and Microcontrollers
elprocus
 
AVR Microcontroller
Özcan Acar
 
Introduction to Microcontroller
Pantech ProLabs India Pvt Ltd
 
8051 instruction set
Andri Prastiyo
 
Interfacing adc
PRADEEP
 
Pulse width modulation (PWM)
amar pandey
 
Question Bank microcontroller 8051
Nilesh Bhaskarrao Bahadure
 
8051 MICROCONTROLLER
THANDAIAH PRABU
 
Microprocessor and microcontrollers
Hiran Gabriel
 
AVR ATmega32
Prashant Tiwari
 
ASK,FSK and M-PSK using Matlab
Amirah Nadrah Ghazali
 
8085 microprocessor notes
Prof. Dr. K. Adisesha
 
8051 Microcontroller Notes
Dr.YNM
 
AVR Fundamentals
Vinit Vyas
 
Semiconductor memories
SambitShreeman
 
AVRTIMER.pptx
Pratik Gohel
 
Rs232 485 fundamental
rounak077
 
ATMEGA 328
ABHISHEK MAURYA
 
Pic 18 microcontroller
Ashish Ranjan
 

Similar to Avr microcontroller (20)

PPTX
Microcontroller
Spitiq
 
PPTX
Overview of Microcontroller and ATMega32 microcontroller
Rup Chowdhury
 
PPT
microcontroller basics
sagar Ramdev
 
PPTX
Atmega16
Thrived Kumar
 
PDF
The document provides an overview of the Arduino platform for beginners.
QucngV
 
PPT
Introduction2_PIC.ppt
AakashRawat35
 
PPTX
unit-2.pptx
KanchanThory
 
PPTX
CHAPTER1.pptx ON 8051 MICROCONTROLLER INTRODUCTION CHAPTER
NagarathnaRajur2
 
PPT
Microcontroller 8051
Sadiq Rahim
 
DOCX
digital clock atmega16
Arcanjo Salazaku
 
DOC
Pc based wire less data aquisition system using rf(1)
Vishalya Dulam
 
PPT
Microcontroller 8051 gs
Moorthy Peesapati
 
PPTX
EC18713 EMBEDDED SYSTEMS LABORATORY, EC18713
ARULPECE
 
PPTX
5. Features of the LPC214X Family.pptx
SivakumarG52
 
PDF
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080
Vivek Venugopal
 
PPTX
Microcontroller from basic_to_advanced
Imran Sheikh
 
PPTX
embedded system and microcontroller
SHILPA Sillobhargav
 
DOCX
Avr report
NITISH KUMAR
 
PPT
8051 Presentation
Sayan Chakraborty
 
PPT
Chp4 introduction to the pic microcontroller copy
mkazree
 
Microcontroller
Spitiq
 
Overview of Microcontroller and ATMega32 microcontroller
Rup Chowdhury
 
microcontroller basics
sagar Ramdev
 
Atmega16
Thrived Kumar
 
The document provides an overview of the Arduino platform for beginners.
QucngV
 
Introduction2_PIC.ppt
AakashRawat35
 
unit-2.pptx
KanchanThory
 
CHAPTER1.pptx ON 8051 MICROCONTROLLER INTRODUCTION CHAPTER
NagarathnaRajur2
 
Microcontroller 8051
Sadiq Rahim
 
digital clock atmega16
Arcanjo Salazaku
 
Pc based wire less data aquisition system using rf(1)
Vishalya Dulam
 
Microcontroller 8051 gs
Moorthy Peesapati
 
EC18713 EMBEDDED SYSTEMS LABORATORY, EC18713
ARULPECE
 
5. Features of the LPC214X Family.pptx
SivakumarG52
 
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080
Vivek Venugopal
 
Microcontroller from basic_to_advanced
Imran Sheikh
 
embedded system and microcontroller
SHILPA Sillobhargav
 
Avr report
NITISH KUMAR
 
8051 Presentation
Sayan Chakraborty
 
Chp4 introduction to the pic microcontroller copy
mkazree
 
Ad

Recently uploaded (20)

PDF
MAD Unit - 2 Activity and Fragment Management in Android (Diploma IT)
JappanMavani
 
DOCX
8th International Conference on Electrical Engineering (ELEN 2025)
elelijjournal653
 
PPTX
MobileComputingMANET2023 MobileComputingMANET2023.pptx
masterfake98765
 
PDF
PORTFOLIO Golam Kibria Khan — architect with a passion for thoughtful design...
MasumKhan59
 
PPTX
Product Development & DevelopmentLecture02.pptx
zeeshanwazir2
 
PDF
Set Relation Function Practice session 24.05.2025.pdf
DrStephenStrange4
 
DOC
MRRS Strength and Durability of Concrete
CivilMythili
 
PDF
Design Thinking basics for Engineers.pdf
CMR University
 
PPTX
Depth First Search Algorithm in 🧠 DFS in Artificial Intelligence (AI)
rafeeqshaik212002
 
PPTX
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
PPTX
Shinkawa Proposal to meet Vibration API670.pptx
AchmadBashori2
 
PPTX
VITEEE 2026 Exam Details , Important Dates
SonaliSingh127098
 
PPTX
GitOps_Without_K8s_Training simple one without k8s
DanialHabibi2
 
PPTX
Arduino Based Gas Leakage Detector Project
CircuitDigest
 
PPTX
美国电子版毕业证南卡罗莱纳大学上州分校水印成绩单USC学费发票定做学位证书编号怎么查
Taqyea
 
PPTX
Green Building & Energy Conservation ppt
Sagar Sarangi
 
PPTX
Mechanical Design of shell and tube heat exchangers as per ASME Sec VIII Divi...
shahveer210504
 
PPTX
Evaluation and thermal analysis of shell and tube heat exchanger as per requi...
shahveer210504
 
PPTX
原版一样(Acadia毕业证书)加拿大阿卡迪亚大学毕业证办理方法
Taqyea
 
PPTX
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
 
MAD Unit - 2 Activity and Fragment Management in Android (Diploma IT)
JappanMavani
 
8th International Conference on Electrical Engineering (ELEN 2025)
elelijjournal653
 
MobileComputingMANET2023 MobileComputingMANET2023.pptx
masterfake98765
 
PORTFOLIO Golam Kibria Khan — architect with a passion for thoughtful design...
MasumKhan59
 
Product Development & DevelopmentLecture02.pptx
zeeshanwazir2
 
Set Relation Function Practice session 24.05.2025.pdf
DrStephenStrange4
 
MRRS Strength and Durability of Concrete
CivilMythili
 
Design Thinking basics for Engineers.pdf
CMR University
 
Depth First Search Algorithm in 🧠 DFS in Artificial Intelligence (AI)
rafeeqshaik212002
 
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
Shinkawa Proposal to meet Vibration API670.pptx
AchmadBashori2
 
VITEEE 2026 Exam Details , Important Dates
SonaliSingh127098
 
GitOps_Without_K8s_Training simple one without k8s
DanialHabibi2
 
Arduino Based Gas Leakage Detector Project
CircuitDigest
 
美国电子版毕业证南卡罗莱纳大学上州分校水印成绩单USC学费发票定做学位证书编号怎么查
Taqyea
 
Green Building & Energy Conservation ppt
Sagar Sarangi
 
Mechanical Design of shell and tube heat exchangers as per ASME Sec VIII Divi...
shahveer210504
 
Evaluation and thermal analysis of shell and tube heat exchanger as per requi...
shahveer210504
 
原版一样(Acadia毕业证书)加拿大阿卡迪亚大学毕业证办理方法
Taqyea
 
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
 
Ad

Avr microcontroller

  • 2. Embedded System IS COMBINATION OF HARDWARE AND SOFTWARE
  • 3. • “ An embedded system can be defined as those control systems which are designed either by microprocessor or microcontroller for a specific tasks. ” • “ An embedded system is some combination of computer hardware & software, either fixed in capability or programmable, that is specifically designed for a particular kind of application device. " EMBEDDED SYSTEM
  • 4. Embedded System In Daily Life Moving message display DVD player Traffic Light Digital clock Game
  • 7. Microprocessor & Microcontroller Microprocessor: A silicon chip that contains a CPU. In the world of personal computers, the terms microprocessor and CPU are used interchangeably. At the heart of all personal computers and most of all automatic systems. Microcontroller : A microcontroller (sometimes abbreviated µC, uC or MCU) is a small computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals.
  • 8. Basic Block Diagram of Microcontroller
  • 11. It was developed by Atmel Corporation ‘8’ in Atmega8 means this microcontroller has 8Kb of flash memory ALL AVR MC Is 8 bit microcontroller. It was developed in the year 1996 by Atmel Corporation.
  • 12. What is RISC?  RISC stands for “Reduced Instruction Set Computer” It is a very fast architecture which executes one instruction per clock cycle. RISC contains very small instruction set. Programming is easy, but code length increases. .
  • 13. Some xtra FEATURES • Up to 16 MIPS Throughput at 16 MHz • 32 x 8 General Purpose Working Registers • Six ADC channels in PDIP package • Internal Calibrated Oscillator of 2,4,8 MHz.
  • 14. MEMORY SEGMENTS • 8K Bytes of Flash program memory • 512 Bytes EEPROM (Electrically Erasable Programmable Read Only Memory) • 1K Byte Internal RAM (Random Access Memory)
  • 17. PORT PORT is use for input and out put communication. PORT are 8 bit wide. PORT are bidirectional data bus. Every PORT has three registers associated with it each one with 8 bit.
  • 18. PB7 PB6 PB5 PB4 PB3 PB2 PB1 PB0 PORT IS 8 BIT REGISTERS. PORT IS COMBINATION OF 8 FLIP FLOP PORTB PORTC -------- PC6 PC5 PC4 PC3 PC2 PC1 PC0 PD7 PD6 PD5 PD4 PD3 PD2 PD1 PD0 PORTD
  • 19. PORT Associated Registers DDRx – Data Direction Register PORTx – Pin Output Register PINx – Pin Input Register where x = GPIO port name ( B, C or D)
  • 20. DDRx register DDRx (Data Direction Register) configures data direction of port pins. Means its setting determines whether port pins will be used for input or output. Writing 0 to a bit in DDRx makes corresponding port pin as input, while writing 1 to a bit in DDRx makes corresponding port pin as output. 0 0 0 0 0 0 0 0DDRB= PORTB is become input. DDRB=0b00000000 1 1 1 1 1 1 1 1DDRB= PORTB is become OUTPUT DDRB=0b11111111
  • 21. PORTx register  PORT give output voltage to external hardware.  PORT is similar as printf . PORTB=0b00000000 0 0 0 0 0 0 0 0 PORTB provide low (0) voltage to blub.
  • 22. PORTx register  PORT give output voltage to external hardware.  PORT is similar as printf . PORTB=0b11111111 1 1 1 1 1 1 1 1 PORTB provide high (5) voltage to blub.
  • 23. PORTx register  PORT give output voltage to external hardware.  PORT is similar as printf . PORTB=0b11000011 1 1 0 0 0 0 1 1 PORTB provide high (5) voltage to blub.
  • 24. INTERFACING LED WITH ATMEGAX LED stands for "Light Emmiting Diode", It has 2 PINs one for +ve Source and the other one for Ground Basically 5mm LEDs work at 20mA and 3V current. Now the question comes, How to get the same Value of source from the MCU. Well, actually Micro Controller can provide constant 5V with 20mA Current through its PORTs(A to D) Lets calculate the Resistance Value, Our Requirements : 20mA , 3V We Have : 20mA, 5V.So, we need to Decrese the Voltage by 2V. The Current Flowing in the Cct is 20mA. V = I X R . V = 2V. I = 20mA. R= ? 2= 0.020 X R => R = 2 / 0.020 = 100 Ohm.
  • 25. LED BLINKING STEP1: Make Portb as output DDRB=0b11111111 STEP2: Provide +5v to LED. PORTB=0b11111111
  • 28. STEP1: WRITING CODE. STEP2: COMPILE CODE. STEP3: FLASH HEX FILE INTO AVR MICROCONTROLLER COMPUTER .hex file