SlideShare a Scribd company logo
Unit -II
Introduction to Microcontrollers:
• Overview of 8051 Microcontroller, Architecture, I/O Ports,
• Memory Organization,
• Addressing Modes and Instruction set of 8051.
8051 Real Time Control:
• Programming Timer Interrupts,
• Programming External Hardware Interrupts, Programming
the Serial Communication Interrupts,
• Programming 8051 Timers and Counters
Port
• Term "port" refers to a group of pins on a microcontroller
which can be accessed simultaneously, or on which we can set
the desired combination of zeros and ones, or read from them
an existing status.
• Physically, port is a register inside a microcontroller which is
connected by wires to the pins of a microcontroller.
• All port pins can be designated as input or output, according
to the needs of a device that's being developed.
Important Pins (IO Ports)
• One of the most useful features = 4 I/O ports (P0 - P3)
Port 0 :-P0 = (P0.0 - P0.7)
– 8-bit R/W - General Purpose I/O
– low byte address and data bus for external memory
• Port 1 :- P1= (P1.0 - P1.7)
– Only 8-bit R/W - General Purpose I/O
• Port 2 :- P2 = (P2.0 - P2.7)
– 8-bit R/W - General Purpose I/O
– high byte address for external memory
• Port 3:- P3 = (P3.0 - P3.7)
– General Purpose I/O
– Timers(T0,T1) – ext. int (INT0, INT1) – Serial (TXD, RXD)-
RD,WR
Each port can be used as input or output (bi-direction)
Port 3 Alternate Functions
Port1 Hardware Structure of I/O Pin
D Q
Clk Q
Vcc
Internal
Pull-Up
Read latch
Read pin
Write to latch
Internal CPU
bus
M1
P1.X
pin
P1.X
B1
B2
Hardware Structure of I/O Pin
• Each pin of I/O ports
– Internally connected to CPU bus
– A D latch store the value of this pin
• Write to latch=1:write data into the D latch
– 2 Tri-state buffer:
• B1: controlled by “Read pin”
– Read pin=1:really read the data present at the pin
• B2: controlled by “Read latch”
– Read latch=1:read value from internal latch
– A transistor M1 gate
• Gate=0: open
• Gate=1: close
Writing “1” to Output Pin P1.X
D Q
Clk Q
Vcc
Internal
Pull-Up
Read latch
Read pin
Write to latch
Internal CPU
bus
M1
P1.X
pin
P1.X
2. output pin is
Vcc
1. write a 1 to the pin
1
0 output 1
B1
B2
Writing “0” to Output Pin P1.X
D Q
Clk Q
Vcc
Internal
Pull-Up
Read latch
Read pin
Write to latch
Internal CPU
bus
M1
P1.X
pin
P1.X
2. output pin is
ground
1. write a 0 to the pin
0
1 output 0
B1
B2
Reading “High” at Input Pin
D Q
Clk Q
Vcc
Internal
Pull-Up
Read latch
Read pin
Write to latch
Internal CPU bus
M1
P1.X pin
P1.X
2. MOV A,P1
external pin=High
1. write a 1 to the pin MOV
P1,#0FFH
1
0
3. Read pin=1 Read latch=0
1
B1
B2
Reading “Low” at Input Pin
D Q
Clk Q
Vcc
Internal
Pull-Up
Read latch
Read pin
Write to latch
Internal CPU bus
M1
P1.X pin
P1.X
8051 IC
2. MOV A,P1
external pin=Low
1. write a 1 to the pin
MOV P1,#0FFH
1
0
3. Read pin=1 Read latch=0
0
B1
B2
Unit2.2 8051
Unit2.2 8051
Unit2.2 8051
Unit2.2 8051
Unit2.2 8051
Unit2.2 8051
Unit2.2 8051
Unit2.2 8051
Unit2.2 8051
Unit2.2 8051

More Related Content

What's hot

IC 8253 - Microprocessor
IC 8253 - Microprocessor IC 8253 - Microprocessor
IC 8253 - Microprocessor
Vatsal N Shah
 
8051 Microcontroller
8051 Microcontroller8051 Microcontroller
8051 Microcontroller
Adarsh College, Hingoli
 
Prerequriment of microcontroller
Prerequriment of microcontrollerPrerequriment of microcontroller
Prerequriment of microcontroller
Kshitij Wagle
 
Architecture of 8051 microcontroller))
Architecture of 8051 microcontroller))Architecture of 8051 microcontroller))
Architecture of 8051 microcontroller))
Ganesh Ram
 
8155 Basic Concepts
8155 Basic Concepts8155 Basic Concepts
8155 Basic Concepts
Srinath Kalikivayi
 
Week 1.2 pin diagram
Week 1.2   pin diagramWeek 1.2   pin diagram
Week 1.2 pin diagram
baraniselva
 
Interfacing 8255
Interfacing 8255Interfacing 8255
Interfacing 8255
Anuja Bhakuni
 
Operation of 8255A
Operation of 8255AOperation of 8255A
Operation of 8255A
Anuj Yadav
 
8051 Microcontroller I/O ports
8051 Microcontroller I/O ports8051 Microcontroller I/O ports
8051 Microcontroller I/O ports
anishgoel
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller
nitugatkal
 
Introduction to 8085 Microprocessors
Introduction to 8085 MicroprocessorsIntroduction to 8085 Microprocessors
Introduction to 8085 Microprocessors
Veerakumar S
 
4th yr dmumicrocontroller1
4th yr dmumicrocontroller14th yr dmumicrocontroller1
4th yr dmumicrocontroller1
haymanotyehuala
 
8051 i/o port circuit
8051 i/o port circuit8051 i/o port circuit
8051 i/o port circuit
dharmendrawaghjipur007
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontroller
Sandeep Kamath
 
Week 1.3 architecture
Week 1.3   architectureWeek 1.3   architecture
Week 1.3 architecture
baraniselva
 
Pin diagram 8085 microprocessor(For College Seminars)
Pin diagram 8085 microprocessor(For College Seminars)Pin diagram 8085 microprocessor(For College Seminars)
Pin diagram 8085 microprocessor(For College Seminars)
Naman Joshi
 
8051 full ppt
8051 full ppt8051 full ppt
Interfacing of 8255 IC By Er. Swapnil Kaware.
Interfacing of 8255 IC By Er. Swapnil Kaware.Interfacing of 8255 IC By Er. Swapnil Kaware.
Interfacing of 8255 IC By Er. Swapnil Kaware.
Prof. Swapnil V. Kaware
 
8051 Microcontroller
8051 Microcontroller8051 Microcontroller
8051 Microcontroller
Jai Sudhan
 

What's hot (19)

IC 8253 - Microprocessor
IC 8253 - Microprocessor IC 8253 - Microprocessor
IC 8253 - Microprocessor
 
8051 Microcontroller
8051 Microcontroller8051 Microcontroller
8051 Microcontroller
 
Prerequriment of microcontroller
Prerequriment of microcontrollerPrerequriment of microcontroller
Prerequriment of microcontroller
 
Architecture of 8051 microcontroller))
Architecture of 8051 microcontroller))Architecture of 8051 microcontroller))
Architecture of 8051 microcontroller))
 
8155 Basic Concepts
8155 Basic Concepts8155 Basic Concepts
8155 Basic Concepts
 
Week 1.2 pin diagram
Week 1.2   pin diagramWeek 1.2   pin diagram
Week 1.2 pin diagram
 
Interfacing 8255
Interfacing 8255Interfacing 8255
Interfacing 8255
 
Operation of 8255A
Operation of 8255AOperation of 8255A
Operation of 8255A
 
8051 Microcontroller I/O ports
8051 Microcontroller I/O ports8051 Microcontroller I/O ports
8051 Microcontroller I/O ports
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller
 
Introduction to 8085 Microprocessors
Introduction to 8085 MicroprocessorsIntroduction to 8085 Microprocessors
Introduction to 8085 Microprocessors
 
4th yr dmumicrocontroller1
4th yr dmumicrocontroller14th yr dmumicrocontroller1
4th yr dmumicrocontroller1
 
8051 i/o port circuit
8051 i/o port circuit8051 i/o port circuit
8051 i/o port circuit
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontroller
 
Week 1.3 architecture
Week 1.3   architectureWeek 1.3   architecture
Week 1.3 architecture
 
Pin diagram 8085 microprocessor(For College Seminars)
Pin diagram 8085 microprocessor(For College Seminars)Pin diagram 8085 microprocessor(For College Seminars)
Pin diagram 8085 microprocessor(For College Seminars)
 
8051 full ppt
8051 full ppt8051 full ppt
8051 full ppt
 
Interfacing of 8255 IC By Er. Swapnil Kaware.
Interfacing of 8255 IC By Er. Swapnil Kaware.Interfacing of 8255 IC By Er. Swapnil Kaware.
Interfacing of 8255 IC By Er. Swapnil Kaware.
 
8051 Microcontroller
8051 Microcontroller8051 Microcontroller
8051 Microcontroller
 

Similar to Unit2.2 8051

8051 Microcontroller
8051 Microcontroller8051 Microcontroller
8051 Microcontroller
thokalpv
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
Sadiq Rahim
 
Microcontroller 8051 By Mitesh kumar
Microcontroller 8051 By Mitesh kumarMicrocontroller 8051 By Mitesh kumar
Microcontroller 8051 By Mitesh kumar
Mitesh Kumar
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
Mukesh Kashyap
 
Microcontroller 8051 gs
Microcontroller 8051 gsMicrocontroller 8051 gs
Microcontroller 8051 gs
Moorthy Peesapati
 
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
 
EMBEDDED SYSTEMS AND IOT lab manual for enginnering students
EMBEDDED SYSTEMS AND IOT lab manual for enginnering studentsEMBEDDED SYSTEMS AND IOT lab manual for enginnering students
EMBEDDED SYSTEMS AND IOT lab manual for enginnering students
eceprinter6
 
Live B tech Projects & Industrial Training @Technogroovy
Live B tech Projects & Industrial Training @Technogroovy Live B tech Projects & Industrial Training @Technogroovy
Live B tech Projects & Industrial Training @Technogroovy
Technogroovy India
 
unit-2.pptx
unit-2.pptxunit-2.pptx
unit-2.pptx
KanchanThory
 
8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )
8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )
8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )
Tarun Khaneja
 
8051
80518051
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
Rashmi
 
Micro lec note2
Micro lec note2Micro lec note2
Micro lec note2
Jaimon Jacob
 
Micro lec note2 (1)
Micro lec note2 (1)Micro lec note2 (1)
Micro lec note2 (1)
pooja jaiswal
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontroller
Jhemi22
 
8051 Microcontroller
8051 Microcontroller8051 Microcontroller
8051 Microcontroller
Avijeet Negel
 
Avr report
Avr reportAvr report
Avr report
NITISH KUMAR
 
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
mkazree
 
8051.pptx
8051.pptx8051.pptx
Micro lec note2
Micro lec note2Micro lec note2
Micro lec note2
KHATANA360
 

Similar to Unit2.2 8051 (20)

8051 Microcontroller
8051 Microcontroller8051 Microcontroller
8051 Microcontroller
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
 
Microcontroller 8051 By Mitesh kumar
Microcontroller 8051 By Mitesh kumarMicrocontroller 8051 By Mitesh kumar
Microcontroller 8051 By Mitesh kumar
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
 
Microcontroller 8051 gs
Microcontroller 8051 gsMicrocontroller 8051 gs
Microcontroller 8051 gs
 
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)
 
EMBEDDED SYSTEMS AND IOT lab manual for enginnering students
EMBEDDED SYSTEMS AND IOT lab manual for enginnering studentsEMBEDDED SYSTEMS AND IOT lab manual for enginnering students
EMBEDDED SYSTEMS AND IOT lab manual for enginnering students
 
Live B tech Projects & Industrial Training @Technogroovy
Live B tech Projects & Industrial Training @Technogroovy Live B tech Projects & Industrial Training @Technogroovy
Live B tech Projects & Industrial Training @Technogroovy
 
unit-2.pptx
unit-2.pptxunit-2.pptx
unit-2.pptx
 
8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )
8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )
8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )
 
8051
80518051
8051
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
 
Micro lec note2
Micro lec note2Micro lec note2
Micro lec note2
 
Micro lec note2 (1)
Micro lec note2 (1)Micro lec note2 (1)
Micro lec note2 (1)
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontroller
 
8051 Microcontroller
8051 Microcontroller8051 Microcontroller
8051 Microcontroller
 
Avr report
Avr reportAvr report
Avr report
 
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
 
8051.pptx
8051.pptx8051.pptx
8051.pptx
 
Micro lec note2
Micro lec note2Micro lec note2
Micro lec note2
 

Recently uploaded

22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.pptUnit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
KrishnaveniKrishnara1
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
Engine Lubrication performance System.pdf
Engine Lubrication performance System.pdfEngine Lubrication performance System.pdf
Engine Lubrication performance System.pdf
mamamaam477
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
ecqow
 
Certificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi AhmedCertificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi Ahmed
Mahmoud Morsy
 
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURSCompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
RamonNovais6
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
shadow0702a
 
Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...
bijceesjournal
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
gerogepatton
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
171ticu
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
Textile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdfTextile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdf
NazakatAliKhoso2
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
BRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdfBRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdf
LAXMAREDDY22
 

Recently uploaded (20)

22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.pptUnit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
Engine Lubrication performance System.pdf
Engine Lubrication performance System.pdfEngine Lubrication performance System.pdf
Engine Lubrication performance System.pdf
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
 
Certificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi AhmedCertificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi Ahmed
 
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURSCompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
 
Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
Textile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdfTextile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdf
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
BRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdfBRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdf
 

Unit2.2 8051

  • 1. Unit -II Introduction to Microcontrollers: • Overview of 8051 Microcontroller, Architecture, I/O Ports, • Memory Organization, • Addressing Modes and Instruction set of 8051. 8051 Real Time Control: • Programming Timer Interrupts, • Programming External Hardware Interrupts, Programming the Serial Communication Interrupts, • Programming 8051 Timers and Counters
  • 2.
  • 3.
  • 4. Port • Term "port" refers to a group of pins on a microcontroller which can be accessed simultaneously, or on which we can set the desired combination of zeros and ones, or read from them an existing status. • Physically, port is a register inside a microcontroller which is connected by wires to the pins of a microcontroller. • All port pins can be designated as input or output, according to the needs of a device that's being developed.
  • 5. Important Pins (IO Ports) • One of the most useful features = 4 I/O ports (P0 - P3) Port 0 :-P0 = (P0.0 - P0.7) – 8-bit R/W - General Purpose I/O – low byte address and data bus for external memory • Port 1 :- P1= (P1.0 - P1.7) – Only 8-bit R/W - General Purpose I/O • Port 2 :- P2 = (P2.0 - P2.7) – 8-bit R/W - General Purpose I/O – high byte address for external memory • Port 3:- P3 = (P3.0 - P3.7) – General Purpose I/O – Timers(T0,T1) – ext. int (INT0, INT1) – Serial (TXD, RXD)- RD,WR Each port can be used as input or output (bi-direction)
  • 6. Port 3 Alternate Functions
  • 7.
  • 8. Port1 Hardware Structure of I/O Pin D Q Clk Q Vcc Internal Pull-Up Read latch Read pin Write to latch Internal CPU bus M1 P1.X pin P1.X B1 B2
  • 9. Hardware Structure of I/O Pin • Each pin of I/O ports – Internally connected to CPU bus – A D latch store the value of this pin • Write to latch=1:write data into the D latch – 2 Tri-state buffer: • B1: controlled by “Read pin” – Read pin=1:really read the data present at the pin • B2: controlled by “Read latch” – Read latch=1:read value from internal latch – A transistor M1 gate • Gate=0: open • Gate=1: close
  • 10. Writing “1” to Output Pin P1.X D Q Clk Q Vcc Internal Pull-Up Read latch Read pin Write to latch Internal CPU bus M1 P1.X pin P1.X 2. output pin is Vcc 1. write a 1 to the pin 1 0 output 1 B1 B2
  • 11. Writing “0” to Output Pin P1.X D Q Clk Q Vcc Internal Pull-Up Read latch Read pin Write to latch Internal CPU bus M1 P1.X pin P1.X 2. output pin is ground 1. write a 0 to the pin 0 1 output 0 B1 B2
  • 12.
  • 13.
  • 14. Reading “High” at Input Pin D Q Clk Q Vcc Internal Pull-Up Read latch Read pin Write to latch Internal CPU bus M1 P1.X pin P1.X 2. MOV A,P1 external pin=High 1. write a 1 to the pin MOV P1,#0FFH 1 0 3. Read pin=1 Read latch=0 1 B1 B2
  • 15. Reading “Low” at Input Pin D Q Clk Q Vcc Internal Pull-Up Read latch Read pin Write to latch Internal CPU bus M1 P1.X pin P1.X 8051 IC 2. MOV A,P1 external pin=Low 1. write a 1 to the pin MOV P1,#0FFH 1 0 3. Read pin=1 Read latch=0 0 B1 B2