SlideShare a Scribd company logo
1 of 29
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)
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

What's hot (20)

Microcontroller-8051.ppt
Microcontroller-8051.pptMicrocontroller-8051.ppt
Microcontroller-8051.ppt
 
Architecture of 8086 Microprocessor
Architecture of 8086 Microprocessor  Architecture of 8086 Microprocessor
Architecture of 8086 Microprocessor
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
 
Sensor interfacing in 8051
Sensor interfacing in 8051Sensor interfacing in 8051
Sensor interfacing in 8051
 
Introduction to 8085 microprocessor
Introduction to 8085 microprocessorIntroduction to 8085 microprocessor
Introduction to 8085 microprocessor
 
Pin diagram 8085
Pin diagram 8085 Pin diagram 8085
Pin diagram 8085
 
8086 pin details
8086 pin details8086 pin details
8086 pin details
 
Flip Flop
Flip FlopFlip Flop
Flip Flop
 
memory 8051
memory  8051memory  8051
memory 8051
 
I/O port programming in 8051
I/O port programming in 8051I/O port programming in 8051
I/O port programming in 8051
 
8251 USART
8251 USART8251 USART
8251 USART
 
8155 GPPI
8155 GPPI8155 GPPI
8155 GPPI
 
Unit4.tms320c54x
Unit4.tms320c54xUnit4.tms320c54x
Unit4.tms320c54x
 
Microprocessor Interfacing and 8155 Features
Microprocessor Interfacing and 8155 FeaturesMicroprocessor Interfacing and 8155 Features
Microprocessor Interfacing and 8155 Features
 
Memory organization of 8051
Memory organization of 8051Memory organization of 8051
Memory organization of 8051
 
Interrupt programming with 8051 microcontroller
Interrupt programming with 8051  microcontrollerInterrupt programming with 8051  microcontroller
Interrupt programming with 8051 microcontroller
 
Data flow model -Lecture-4
Data flow model -Lecture-4Data flow model -Lecture-4
Data flow model -Lecture-4
 
ARM Processors
ARM ProcessorsARM Processors
ARM Processors
 
EPROM, PROM & ROM
EPROM, PROM & ROMEPROM, PROM & ROM
EPROM, PROM & ROM
 
AVR Fundamentals
AVR FundamentalsAVR Fundamentals
AVR Fundamentals
 

Similar to Avr microcontroller

Microcontroller
MicrocontrollerMicrocontroller
MicrocontrollerSpitiq
 
Overview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerOverview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerRup Chowdhury
 
microcontroller basics
microcontroller basicsmicrocontroller basics
microcontroller basicssagar Ramdev
 
Introduction2_PIC.ppt
Introduction2_PIC.pptIntroduction2_PIC.ppt
Introduction2_PIC.pptAakashRawat35
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051Sadiq Rahim
 
Pc based wire less data aquisition system using rf(1)
Pc based wire less data aquisition system using rf(1)Pc based wire less data aquisition system using rf(1)
Pc based wire less data aquisition system using rf(1)Vishalya Dulam
 
5. Features of the LPC214X Family.pptx
5. Features of the LPC214X Family.pptx5. Features of the LPC214X Family.pptx
5. Features of the LPC214X Family.pptxSivakumarG52
 
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080Vivek Venugopal
 
Microcontroller from basic_to_advanced
Microcontroller from basic_to_advancedMicrocontroller from basic_to_advanced
Microcontroller from basic_to_advancedImran Sheikh
 
embedded system and microcontroller
 embedded system and microcontroller embedded system and microcontroller
embedded system and microcontrollerSHILPA Sillobhargav
 
Chp4 introduction to the pic microcontroller copy
Chp4 introduction to the pic microcontroller   copyChp4 introduction to the pic microcontroller   copy
Chp4 introduction to the pic microcontroller copymkazree
 
Embedded system design using arduino
Embedded system design using arduinoEmbedded system design using arduino
Embedded system design using arduinoSantosh Verma
 

Similar to Avr microcontroller (20)

Microcontroller
MicrocontrollerMicrocontroller
Microcontroller
 
Overview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerOverview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontroller
 
microcontroller basics
microcontroller basicsmicrocontroller basics
microcontroller basics
 
Atmega16
Atmega16Atmega16
Atmega16
 
Introduction2_PIC.ppt
Introduction2_PIC.pptIntroduction2_PIC.ppt
Introduction2_PIC.ppt
 
unit-2.pptx
unit-2.pptxunit-2.pptx
unit-2.pptx
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
 
digital clock atmega16
digital clock atmega16digital clock atmega16
digital clock atmega16
 
Pc based wire less data aquisition system using rf(1)
Pc based wire less data aquisition system using rf(1)Pc based wire less data aquisition system using rf(1)
Pc based wire less data aquisition system using rf(1)
 
Microcontroller 8051 gs
Microcontroller 8051 gsMicrocontroller 8051 gs
Microcontroller 8051 gs
 
5. Features of the LPC214X Family.pptx
5. Features of the LPC214X Family.pptx5. Features of the LPC214X Family.pptx
5. Features of the LPC214X Family.pptx
 
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080
 
Microcontroller from basic_to_advanced
Microcontroller from basic_to_advancedMicrocontroller from basic_to_advanced
Microcontroller from basic_to_advanced
 
embedded system and microcontroller
 embedded system and microcontroller embedded system and microcontroller
embedded system and microcontroller
 
Avr report
Avr reportAvr report
Avr report
 
8051 Presentation
8051 Presentation8051 Presentation
8051 Presentation
 
Chp4 introduction to the pic microcontroller copy
Chp4 introduction to the pic microcontroller   copyChp4 introduction to the pic microcontroller   copy
Chp4 introduction to the pic microcontroller copy
 
Embedded system design using arduino
Embedded system design using arduinoEmbedded system design using arduino
Embedded system design using arduino
 
Assignment
AssignmentAssignment
Assignment
 
8051 full ppt
8051 full ppt8051 full ppt
8051 full ppt
 

Recently uploaded

247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 

Recently uploaded (20)

247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 

Avr microcontroller

  • 1.
  • 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)
  • 15.
  • 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