SlideShare a Scribd company logo
What is a Microcontroller?
A microcontroller (sometimes abbreviated µC
or MCU) is a small computer on a single IC
containing a processor core, memory, and
programmable input/output peripherals.
It is a decision making device used widely in
embedded systems and all intelligent devices.
Basic Block Diagram of
Microcontroller
Difference between Microcontroller
and Microprocessor
Microcontroller has I/O ports, Memory, timers
etc all integrated on chip itself
 In Microprocessors, I/O ports, memory, timer
etc are to be connected externally
Block Diagram to show the difference
What is a 8-bit microcontroller?
8-bit means it can process 8-bit data per clock
cycle
It has 8-bit data bus
It can process 1byte of data at a time
AVR ATmega8 Microcontroller
How AVR ATmega8 got its name?
It was developed by Atmel Corporation
AVR implies it belongs to AVR family.
‘8’ in Atmega8 means this microcontroller has
8Kb of flash memory
What is AVR?
 AVR is a modified Harvard architecture , 8-bit
RISC single chip microcontroller.
It was developed in the year 1996 by Atmel
Corporation.
What’s special about AVR?
They are fast.
 AVR Microcontroller executes most of the
instructions in single execution cycle.
 AVRs are about 4 times faster than PIC.
 They consume less power and can be operated
in different power saving modes.
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.
Harvard and Von Neumann
Architecture
Harvard Architecture
Harvard architecture has separate data and
instruction buses.
 This allows transfers to be performed
simultaneously on both buses.
Von Neumann Architecture
A Von Neumann architecture has only one bus
which is used for both data transfers and
instruction fetch
Data transfers and instruction fetches must be
scheduled as they cannot be performed at the
same time
Introduction to Atmega8
ATmega8 is a low-power CMOS 8-bit
microcontroller based on the AVR RISC
architecture.
By executing powerful instructions in a single
clock cycle, the ATmega8 achieves throughput
approaching 1 MIPS per MHz
In order to maximize performance and
parallelism, the AVR uses a Harvard
architecture.
Features Of ATmega8
High-performance, Low-power AVR 8-bit
Microcontroller
Up to 16 MIPS Throughput at 16 MHz
32 x 8 General Purpose Working Registers
Internal Calibrated RC Oscillator
External and Internal Interrupt Sources
Data retention: 20 years at 85°C/100 years at
25°C
Memory Segments
8K Bytes of In-System Self-programmable
Flash program memory
512 Bytes EEPROM (Electrically Erasable
Programmable Read Only Memory)
1K Byte Internal SRAM (Static Random Access
Memory)
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 package .
Continued…
6-channel ADC in PDIP package.
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.
TYPES OF PACKAGES
28-lead PDIP (Plastic Dual In-line Package)
32-lead TQFP (Thin Quad film Package)
How ATmega8 PDIP Package looks like?
How ATmega8 TQFP Package looks like?
Pinout of ATmega8
Pin Description
VCC: Digital supply voltage 5V.
GND: Ground.
RESET: A low level on this pin for longer than
the minimum pulse length will generate a
reset, even if the clock is not running.
AREF: The analog reference pin for the A/D
Converter.
Continued….
AVCC : The supply voltage pin for the A/D
Converter, Port C (3..0).It should be externally
connected to VCC, even if the ADC is not used.
If the ADC is used, it should be connected to
VCC through a low-pass filter.
PORTS
There are 3 ports in ATmega8: Port B, Port C,
Port D.
Three registers are associated with every port
DDRx – Data Direction Register
PINx – Port input
PORTx- Port output
Where x would be either B,C or D.
PORT B(PB7-PB0)
It is a 8-bit bi-directional I/O port.
It has internal pull up resistors(selected for
each bit).
It can be used either as a input port or as
output port ( direction must be specified in
programming).
PORT C(PC6-PC0)
It is a 7-bit bi-directional I/O port.
It has internal pull up resistors(selected for
each bit).
It can be used either as a input port or as
output port ( direction must be specified in
programming).
PORTD(PD7-PD0)
It is a 8-bit bi-directional I/O port.
It has internal pull up resistors(selected for
each bit).
It can be used either as a input port or as
output port ( direction must be specified in
programming).
Registers to Communicate with I/O
Ports
To communicate with the ports of Atmega8,
we use three registers:
 PINx
 PORTx
 DDRx
Where x would be either B,C or D.
REGISTER DESCRIPTION OF I/O PORTS
…
Continued....
Continued....
Continued....
DDRx Register
It stands for Data Direction Register.
It is used to define Port as Input or Output.
In order to make Port as Input Port:
DDRx=0x00 (In Hexadecimal)
DDRx=0b00000000(In Binary)
In order to make Port as output Port:
DDRx=0xFF (In Hexadecimal)
DDRx=0b11111111(In Binary)
PORTx Register
If DDRx=0xFF(Output port)
 Writing logic 1 to PORTx will make output
high i.e 5v for that particular pin.
 Writing 0 to PORTx will make output low i.e
0v for that particular pin.
Continued..
If DDRx=Ox00(Input port):
 If corresponding PORTx bit is set to 1, Internal
pull up resistors are enabled i.e if we do not
connect this pin to anything it still reads as 1.
 If corresponding PORTx bit is set to 0, internal
pull up resistors are disabled i.e the pin will
enter a high impedance state and will become
unpredictable.
PINx Register
It reads data from the port pins.
If any/all bits of DDRx is set to 0(input)for a
particular pin, we can read data from PINx
If any/all bits of DDRx is set to 1(output), then
reading PINx register gives the same data
which has been output on that particular pin.
THANK YOU

More Related Content

What's hot

8051 Microcontroller ppt
8051 Microcontroller ppt8051 Microcontroller ppt
8051 Microcontroller ppt
Rahul Kumar
 
AVR Fundamentals
AVR FundamentalsAVR Fundamentals
AVR Fundamentals
Vinit Vyas
 
8085 microproceesor ppt
8085 microproceesor ppt8085 microproceesor ppt
8085 microproceesor ppt
RJ Aniket
 
Microprocessor & Micro-controller
Microprocessor & Micro-controllerMicroprocessor & Micro-controller
Microprocessor & Micro-controller
Om Bheda
 
8251 USART
8251 USART8251 USART
8251 USART
ShivamSood22
 
Pic microcontroller architecture
Pic microcontroller architecturePic microcontroller architecture
Pic microcontroller architecture
Jamia Hamdard
 
Intel 8051 - pin description
Intel 8051  - pin descriptionIntel 8051  - pin description
Intel 8051 - pin description
DEPARTMENT OF PHYSICS
 
8096 microcontrollers notes
8096 microcontrollers notes8096 microcontrollers notes
8096 microcontrollers notesDr.YNM
 
Introduction to Microcontroller
Introduction to MicrocontrollerIntroduction to Microcontroller
Introduction to Microcontroller
Nikhil Sharma
 
PIC Microcontrollers.ppt
PIC Microcontrollers.pptPIC Microcontrollers.ppt
PIC Microcontrollers.ppt
Dr.YNM
 
introduction to microprocessors
introduction to microprocessorsintroduction to microprocessors
introduction to microprocessors
vishi1993
 
ATmega32-AVR microcontrollers-Part I
ATmega32-AVR microcontrollers-Part IATmega32-AVR microcontrollers-Part I
ATmega32-AVR microcontrollers-Part I
VineethMP2
 
INTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLERINTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLER
Ankita Jaiswal
 
Microprocessor & microcontroller
Microprocessor & microcontroller Microprocessor & microcontroller
Microprocessor & microcontroller Nitesh Kumar
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
Sadiq Rahim
 
Unit 5
Unit 5Unit 5
Unit 5
tamilnesaner
 
Microcontroller 8051 and its interfacing
Microcontroller 8051 and its interfacingMicrocontroller 8051 and its interfacing
Microcontroller 8051 and its interfacing
Ankur Mahajan
 
I2C Protocol
I2C ProtocolI2C Protocol
I2C Protocol
Sudhanshu Janwadkar
 
8086 micro processor
8086 micro processor8086 micro processor
8086 micro processor
Poojith Chowdhary
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the ArduinoWingston
 

What's hot (20)

8051 Microcontroller ppt
8051 Microcontroller ppt8051 Microcontroller ppt
8051 Microcontroller ppt
 
AVR Fundamentals
AVR FundamentalsAVR Fundamentals
AVR Fundamentals
 
8085 microproceesor ppt
8085 microproceesor ppt8085 microproceesor ppt
8085 microproceesor ppt
 
Microprocessor & Micro-controller
Microprocessor & Micro-controllerMicroprocessor & Micro-controller
Microprocessor & Micro-controller
 
8251 USART
8251 USART8251 USART
8251 USART
 
Pic microcontroller architecture
Pic microcontroller architecturePic microcontroller architecture
Pic microcontroller architecture
 
Intel 8051 - pin description
Intel 8051  - pin descriptionIntel 8051  - pin description
Intel 8051 - pin description
 
8096 microcontrollers notes
8096 microcontrollers notes8096 microcontrollers notes
8096 microcontrollers notes
 
Introduction to Microcontroller
Introduction to MicrocontrollerIntroduction to Microcontroller
Introduction to Microcontroller
 
PIC Microcontrollers.ppt
PIC Microcontrollers.pptPIC Microcontrollers.ppt
PIC Microcontrollers.ppt
 
introduction to microprocessors
introduction to microprocessorsintroduction to microprocessors
introduction to microprocessors
 
ATmega32-AVR microcontrollers-Part I
ATmega32-AVR microcontrollers-Part IATmega32-AVR microcontrollers-Part I
ATmega32-AVR microcontrollers-Part I
 
INTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLERINTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLER
 
Microprocessor & microcontroller
Microprocessor & microcontroller Microprocessor & microcontroller
Microprocessor & microcontroller
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
 
Unit 5
Unit 5Unit 5
Unit 5
 
Microcontroller 8051 and its interfacing
Microcontroller 8051 and its interfacingMicrocontroller 8051 and its interfacing
Microcontroller 8051 and its interfacing
 
I2C Protocol
I2C ProtocolI2C Protocol
I2C Protocol
 
8086 micro processor
8086 micro processor8086 micro processor
8086 micro processor
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
 

Viewers also liked

Basic os-concepts
Basic os-conceptsBasic os-concepts
Basic os-concepts
Akhilesh Jain
 
Operating System
Operating SystemOperating System
Operating System
joygracia
 
Silberschatz / OS Concepts
Silberschatz /  OS Concepts Silberschatz /  OS Concepts
Silberschatz / OS Concepts Alanisca Alanis
 
Ch13 (1)
Ch13 (1)Ch13 (1)
Ch13 (1)
Hari sankar
 
Operating system notes
Operating system notesOperating system notes
Operating system notesSANTOSH RATH
 
Operating System (Scheduling, Input and Output Management, Memory Management,...
Operating System (Scheduling, Input and Output Management, Memory Management,...Operating System (Scheduling, Input and Output Management, Memory Management,...
Operating System (Scheduling, Input and Output Management, Memory Management,...
Project Student
 
Fpga
FpgaFpga
Chapter 1: Introduction to Operating System
Chapter 1: Introduction to Operating SystemChapter 1: Introduction to Operating System
Chapter 1: Introduction to Operating System
Shafaan Khaliq Bhatti
 
Introduction to Operating System
Introduction to Operating SystemIntroduction to Operating System
Introduction to Operating Systempriya_sinha02
 
Operating system and its function
Operating system and its functionOperating system and its function
Operating system and its functionNikhi Jain
 
Operating system.ppt (1)
Operating system.ppt (1)Operating system.ppt (1)
Operating system.ppt (1)Vaibhav Bajaj
 
Slides For Operating System Concepts By Silberschatz Galvin And Gagne
Slides For Operating System Concepts By Silberschatz Galvin And GagneSlides For Operating System Concepts By Silberschatz Galvin And Gagne
Slides For Operating System Concepts By Silberschatz Galvin And Gagnesarankumar4445
 
Operating system overview concepts ppt
Operating system overview concepts pptOperating system overview concepts ppt
Operating system overview concepts ppt
RajendraPrasad Alladi
 
BASIC CONCEPTS OF COMPUTER NETWORKS
BASIC CONCEPTS OF COMPUTER NETWORKS BASIC CONCEPTS OF COMPUTER NETWORKS
BASIC CONCEPTS OF COMPUTER NETWORKS Kak Yong
 
Introduction to computer network
Introduction to computer networkIntroduction to computer network
Introduction to computer network
Ashita Agrawal
 

Viewers also liked (16)

Basic os-concepts
Basic os-conceptsBasic os-concepts
Basic os-concepts
 
Operating System
Operating SystemOperating System
Operating System
 
Silberschatz / OS Concepts
Silberschatz /  OS Concepts Silberschatz /  OS Concepts
Silberschatz / OS Concepts
 
Ch13 (1)
Ch13 (1)Ch13 (1)
Ch13 (1)
 
Operating system notes
Operating system notesOperating system notes
Operating system notes
 
Operating System (Scheduling, Input and Output Management, Memory Management,...
Operating System (Scheduling, Input and Output Management, Memory Management,...Operating System (Scheduling, Input and Output Management, Memory Management,...
Operating System (Scheduling, Input and Output Management, Memory Management,...
 
Fpga
FpgaFpga
Fpga
 
Chapter 1: Introduction to Operating System
Chapter 1: Introduction to Operating SystemChapter 1: Introduction to Operating System
Chapter 1: Introduction to Operating System
 
Introduction to Operating System
Introduction to Operating SystemIntroduction to Operating System
Introduction to Operating System
 
Operating system and its function
Operating system and its functionOperating system and its function
Operating system and its function
 
Operating Systems
Operating SystemsOperating Systems
Operating Systems
 
Operating system.ppt (1)
Operating system.ppt (1)Operating system.ppt (1)
Operating system.ppt (1)
 
Slides For Operating System Concepts By Silberschatz Galvin And Gagne
Slides For Operating System Concepts By Silberschatz Galvin And GagneSlides For Operating System Concepts By Silberschatz Galvin And Gagne
Slides For Operating System Concepts By Silberschatz Galvin And Gagne
 
Operating system overview concepts ppt
Operating system overview concepts pptOperating system overview concepts ppt
Operating system overview concepts ppt
 
BASIC CONCEPTS OF COMPUTER NETWORKS
BASIC CONCEPTS OF COMPUTER NETWORKS BASIC CONCEPTS OF COMPUTER NETWORKS
BASIC CONCEPTS OF COMPUTER NETWORKS
 
Introduction to computer network
Introduction to computer networkIntroduction to computer network
Introduction to computer network
 

Similar to microcontroller basics

Avr report
Avr reportAvr report
Avr report
NITISH KUMAR
 
Atemega saya
Atemega sayaAtemega saya
Atemega saya
sulej77
 
Avr microcontroller
Avr microcontrollerAvr microcontroller
Avr microcontroller
Dhananjay Chauhan
 
Atmega16 datasheet
Atmega16 datasheetAtmega16 datasheet
Atmega16 datasheet
chiragchitroda3
 
Atmega16 Microconntroller Data sheet
Atmega16 Microconntroller Data sheetAtmega16 Microconntroller Data sheet
Atmega16 Microconntroller Data sheet
Microtech Solutions
 
Microcontroller
MicrocontrollerMicrocontroller
MicrocontrollerSpitiq
 
A tmega16A Microcontroller Data Sheet
A tmega16A Microcontroller Data SheetA tmega16A Microcontroller Data Sheet
A tmega16A Microcontroller Data Sheet
Microtech Solutions
 
Atmega16
Atmega16Atmega16
Atmega16
Thrived Kumar
 
digital clock atmega16
digital clock atmega16digital clock atmega16
digital clock atmega16
Arcanjo Salazaku
 
Overview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerOverview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontroller
Rup Chowdhury
 
embedded system and microcontroller
 embedded system and microcontroller embedded system and microcontroller
embedded system and microcontroller
SHILPA 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
 
3.TechieNest microcontrollers
3.TechieNest  microcontrollers3.TechieNest  microcontrollers
3.TechieNest microcontrollers
TechieNest Pvt. Ltd .
 
Atmega8u2 mur
Atmega8u2 murAtmega8u2 mur
Atmega8u2 mur
Nickyhoney
 
2502s
2502s2502s
2502s
Andi Gian
 
Atmel 2486-8-bit-avr-microcontroller-atmega8 l-datasheet
Atmel 2486-8-bit-avr-microcontroller-atmega8 l-datasheetAtmel 2486-8-bit-avr-microcontroller-atmega8 l-datasheet
Atmel 2486-8-bit-avr-microcontroller-atmega8 l-datasheet
sang2792
 

Similar to microcontroller basics (20)

Avr report
Avr reportAvr report
Avr report
 
Atmega 32
Atmega 32Atmega 32
Atmega 32
 
Atemega saya
Atemega sayaAtemega saya
Atemega saya
 
Atmega32
Atmega32Atmega32
Atmega32
 
Avr microcontroller
Avr microcontrollerAvr microcontroller
Avr microcontroller
 
Atmega16 datasheet
Atmega16 datasheetAtmega16 datasheet
Atmega16 datasheet
 
Atmega16 Microconntroller Data sheet
Atmega16 Microconntroller Data sheetAtmega16 Microconntroller Data sheet
Atmega16 Microconntroller Data sheet
 
Microcontroller
MicrocontrollerMicrocontroller
Microcontroller
 
A tmega16A Microcontroller Data Sheet
A tmega16A Microcontroller Data SheetA tmega16A Microcontroller Data Sheet
A tmega16A Microcontroller Data Sheet
 
Atmega16
Atmega16Atmega16
Atmega16
 
digital clock atmega16
digital clock atmega16digital clock atmega16
digital clock atmega16
 
Overview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerOverview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontroller
 
A tmega8 basics
A tmega8 basicsA tmega8 basics
A tmega8 basics
 
embedded system and microcontroller
 embedded system and microcontroller embedded system and microcontroller
embedded system and microcontroller
 
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
 
3.TechieNest microcontrollers
3.TechieNest  microcontrollers3.TechieNest  microcontrollers
3.TechieNest microcontrollers
 
Doc2502
Doc2502Doc2502
Doc2502
 
Atmega8u2 mur
Atmega8u2 murAtmega8u2 mur
Atmega8u2 mur
 
2502s
2502s2502s
2502s
 
Atmel 2486-8-bit-avr-microcontroller-atmega8 l-datasheet
Atmel 2486-8-bit-avr-microcontroller-atmega8 l-datasheetAtmel 2486-8-bit-avr-microcontroller-atmega8 l-datasheet
Atmel 2486-8-bit-avr-microcontroller-atmega8 l-datasheet
 

Recently uploaded

road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
addressing modes in computer architecture
addressing modes  in computer architectureaddressing modes  in computer architecture
addressing modes in computer architecture
ShahidSultan24
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
Kamal Acharya
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
Kamal Acharya
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 

Recently uploaded (20)

road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
addressing modes in computer architecture
addressing modes  in computer architectureaddressing modes  in computer architecture
addressing modes in computer architecture
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 

microcontroller basics

  • 1. What is a Microcontroller? A microcontroller (sometimes abbreviated µC or MCU) is a small computer on a single IC containing a processor core, memory, and programmable input/output peripherals. It is a decision making device used widely in embedded systems and all intelligent devices.
  • 2. Basic Block Diagram of Microcontroller
  • 3. Difference between Microcontroller and Microprocessor Microcontroller has I/O ports, Memory, timers etc all integrated on chip itself  In Microprocessors, I/O ports, memory, timer etc are to be connected externally
  • 4. Block Diagram to show the difference
  • 5. What is a 8-bit microcontroller? 8-bit means it can process 8-bit data per clock cycle It has 8-bit data bus It can process 1byte of data at a time
  • 7. How AVR ATmega8 got its name? It was developed by Atmel Corporation AVR implies it belongs to AVR family. ‘8’ in Atmega8 means this microcontroller has 8Kb of flash memory
  • 8. What is AVR?  AVR is a modified Harvard architecture , 8-bit RISC single chip microcontroller. It was developed in the year 1996 by Atmel Corporation.
  • 9. What’s special about AVR? They are fast.  AVR Microcontroller executes most of the instructions in single execution cycle.  AVRs are about 4 times faster than PIC.  They consume less power and can be operated in different power saving modes.
  • 10. 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.
  • 11. Harvard and Von Neumann Architecture
  • 12. Harvard Architecture Harvard architecture has separate data and instruction buses.  This allows transfers to be performed simultaneously on both buses.
  • 13. Von Neumann Architecture A Von Neumann architecture has only one bus which is used for both data transfers and instruction fetch Data transfers and instruction fetches must be scheduled as they cannot be performed at the same time
  • 14. Introduction to Atmega8 ATmega8 is a low-power CMOS 8-bit microcontroller based on the AVR RISC architecture. By executing powerful instructions in a single clock cycle, the ATmega8 achieves throughput approaching 1 MIPS per MHz In order to maximize performance and parallelism, the AVR uses a Harvard architecture.
  • 15. Features Of ATmega8 High-performance, Low-power AVR 8-bit Microcontroller Up to 16 MIPS Throughput at 16 MHz 32 x 8 General Purpose Working Registers Internal Calibrated RC Oscillator External and Internal Interrupt Sources Data retention: 20 years at 85°C/100 years at 25°C
  • 16. Memory Segments 8K Bytes of In-System Self-programmable Flash program memory 512 Bytes EEPROM (Electrically Erasable Programmable Read Only Memory) 1K Byte Internal SRAM (Static Random Access Memory)
  • 17. 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 package .
  • 18. Continued… 6-channel ADC in PDIP package. 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.
  • 19. TYPES OF PACKAGES 28-lead PDIP (Plastic Dual In-line Package) 32-lead TQFP (Thin Quad film Package)
  • 20. How ATmega8 PDIP Package looks like?
  • 21. How ATmega8 TQFP Package looks like?
  • 23. Pin Description VCC: Digital supply voltage 5V. GND: Ground. RESET: A low level on this pin for longer than the minimum pulse length will generate a reset, even if the clock is not running. AREF: The analog reference pin for the A/D Converter.
  • 24. Continued…. AVCC : The supply voltage pin for the A/D Converter, Port C (3..0).It should be externally connected to VCC, even if the ADC is not used. If the ADC is used, it should be connected to VCC through a low-pass filter.
  • 25. PORTS There are 3 ports in ATmega8: Port B, Port C, Port D. Three registers are associated with every port DDRx – Data Direction Register PINx – Port input PORTx- Port output Where x would be either B,C or D.
  • 26. PORT B(PB7-PB0) It is a 8-bit bi-directional I/O port. It has internal pull up resistors(selected for each bit). It can be used either as a input port or as output port ( direction must be specified in programming).
  • 27. PORT C(PC6-PC0) It is a 7-bit bi-directional I/O port. It has internal pull up resistors(selected for each bit). It can be used either as a input port or as output port ( direction must be specified in programming).
  • 28. PORTD(PD7-PD0) It is a 8-bit bi-directional I/O port. It has internal pull up resistors(selected for each bit). It can be used either as a input port or as output port ( direction must be specified in programming).
  • 29. Registers to Communicate with I/O Ports To communicate with the ports of Atmega8, we use three registers:  PINx  PORTx  DDRx Where x would be either B,C or D.
  • 31.
  • 35. DDRx Register It stands for Data Direction Register. It is used to define Port as Input or Output. In order to make Port as Input Port: DDRx=0x00 (In Hexadecimal) DDRx=0b00000000(In Binary) In order to make Port as output Port: DDRx=0xFF (In Hexadecimal) DDRx=0b11111111(In Binary)
  • 36. PORTx Register If DDRx=0xFF(Output port)  Writing logic 1 to PORTx will make output high i.e 5v for that particular pin.  Writing 0 to PORTx will make output low i.e 0v for that particular pin.
  • 37. Continued.. If DDRx=Ox00(Input port):  If corresponding PORTx bit is set to 1, Internal pull up resistors are enabled i.e if we do not connect this pin to anything it still reads as 1.  If corresponding PORTx bit is set to 0, internal pull up resistors are disabled i.e the pin will enter a high impedance state and will become unpredictable.
  • 38. PINx Register It reads data from the port pins. If any/all bits of DDRx is set to 0(input)for a particular pin, we can read data from PINx If any/all bits of DDRx is set to 1(output), then reading PINx register gives the same data which has been output on that particular pin.