SlideShare a Scribd company logo
Microcontroller 8051

Input/output Pins, Ports & Circuits



                   Rohith.P.N
                   IV th Sem ECE ‘B’ Sec
• As we know Microprocessor doesn't have inbuilt
  Input/output ports.
• It must add an additional chip to interface with the
  external circuitry/devices.

• This disadvantage is overcome by the Microcontroller
  8051.
• MC 8051 has inbuilt I/O ports/circuits.
• This helps the MC 8051 to connect with the external
  devices/memory etc..
Pin Description of the 8051
         P1.0   1           40   Vcc
         P1.1   2           39   P0.0(AD0)
         P1.2   3           38   P0.1(AD1)
         P1.3
         P1.4
                4
                5
                     8051   37
                            36
                                 P0.2(AD2)
                                 P0.3(AD3)
         P1.5   6           35   P0.4(AD4)
         P1.6   7           34   P0.5(AD5)
         P1.7   8           33   P0.6(AD6)
          RST   9           32   P0.7(AD7)
  (RXD)P3.0     10          31   EA/VPP
  (TXD)P3.1     11          30   ALE/PROG
 (INT0)P3.2     12          29   PSEN
 (INT1)P3.3     13          28   P2.7(A15)
     (T0)P3.4   14          27   P2.6(A14)
     (T1)P3.5   15          26   P2.5(A13)
   (WR)P3.6     16          25   P2.4(A12)
    (RD)P3.7    17          24   P2.3(A11)
       XTAL2    18          23   P2.2(A10)
       XTAL1    19          22   P2.1(A9)
         GND    20          21   P2.0(A8)
Pin details of MC 8051
The Microcontroller 8051 has 40 Pins.

I/O Port 0   Pins 32-37
I/O Port 1   Pins 1-8
I/O Port 2   Pins 21-28
I/O Port 3   Pins 10-17

Pin 40 - Vcc
Pin 20 - Gnd
Pin 19 & 18 – XTAL1 & XTAL2
Pin 9 – Reset
Pin 31 – EA (External Access)
Pin 29 – PSEN ( Program Store Enable)
Pin 30 – ALE (Address Latch Enable)
• Vcc(pin 40):
  – Vcc provides supply voltage to the chip.
  – The voltage source is +5V.
• GND(pin 20):ground
• XTAL1 and XTAL2(pins 19,18)
• RST(pin 9):reset
   – It is an input pin and is active high(normally low).
       • The high pulse must be high at least 2 machine cycles.
   – It is a power-on reset.
       • Upon applying a high pulse to RST, the
         microcontroller will reset and all values in registers
         will be lost.
       • Reset values of some 8051 registers
RESET Value of Some 8051 Registers:


Register                Reset Value
PC                      0000
ACC                     0000
B                       0000
PSW                     0000
SP                      0007
DPTR                    0000
RAM are all zero.
• /EA(pin 31):external access
   – There is no on-chip ROM in 8031 and 8032 .
   – The /EA pin is connected to GND to indicate the code is
     stored externally.
   – /PSEN & ALE are used for external ROM.
   – For 8051, /EA pin is connected to Vcc.
   – “/” means active low.
• /PSEN(pin 29):program store enable
   – This is an output pin and is connected to the OE pin of the
     ROM.
• ALE(pin 30):address latch enable
   – It is an output pin and is active high.
   – 8051 port 0 provides both address and data.
   – The ALE pin is used for de-multiplexing the address
     and data by connecting to the G pin of the 74LS373
     latch.
• I/O port pins
   – The four ports P0, P1, P2, and P3.
   – Each port uses 8 pins.
   – All I/O pins are bi-directional.
• The 8051 has four I/O ports
   – Port 0 (pins 32-39):P0(P0.0~P0.7)
   – Port 1(pins 1-8) :P1(P1.0~P1.7)
   – Port 2(pins 21-28):P2(P2.0~P2.7)
   – Port 3(pins 10-17):P3(P3.0~P3.7)
   – Each port has 8 pins.
      • Named P0.X (X=0,1,...,7), P1.X, P2.X, P3.X
      • Ex:P0.0 is the bit 0(LSB)of P0
      • Ex:P0.7 is the bit 7(MSB)of P0
      • These 8 bits form a byte.
• Each port can be used as input or output (bi-direction).
Port
Pin Circuit
Port 0 :-
• When used as input,a ‘1’ must be written to
  corresponding port latch
• Used as an output,’0’ must be be programmed
• Logic ‘1’ in address bit will turn Upper FET on & lower FET
  off
• After address has formed & latched into External circuitry
  by ALE pulse,the External Bus is turned ON
• Port 0 now reads data from External Memory
• Port 0 pins can be accessed by address P0.0,P0.1,….,P0.7
• It can also be addressed as AD0,AD1,…….AD7
Port 0 with Pull-Up Resistors
Port 1 :-

• Port 1 pins have no Dual functions
• If used as input a ‘1’ is written to latch which
  turns upper FET on
• Used as output,lower FET is On & the Pullup is Off
• Output latch is directly connected to gate of
  Lower FET
• Port 1 can be accessed as P1.0,P1.1,. . . . .P1.7
Port 2 :-
• It can be used as i/p or o/p which is similar in operation of
   Port 1
• The alternate use of port 2 is to supply a high-order
   address byte in conjunction with port 0 low-order byte to
   address external memory
• Port 2 latches remain stable when External Memory is
   addressed
• They do not have to be turned around (Set to 1)
  For Data i/p as in Port 0
• It can be accessed as P2.0,P2.1,. . . . . ,P2.7
Port 3 :-
• It is similar to port 1,but has alternate Uses
• Each pin may be individually Programmed as I/O
  or for alternate Functions as shown
       Pin         Alternate Use                 SFR
       P3.0-RXD    Serial data input             SBUF
       P3.1-TXD    Serial data Output            SBUF
       P3.2-INT0   External interrupt 0          TCON.1
       P3.3-INT1   External interrupt 1          TCON.3
       P3.4-T0     External timer 0 input        TMOD
       P3.5-T1     External timer 1 input        TMOD
       P3.6-WR     External Memory Write Pulse    -
       P3.7-RD     External Memory Read Pulse     -
Writing “1” to Output Pin P1.X

      Read latch                              Vcc
                                TB2
                                                    Load(L1)   2. output pin is
1. write a 1 to the pin                                              Vcc
                                      1                            P1.X
     Internal CPU         D     Q
          bus              P1.X                                     pin
                                          0                     output 1
     Write to latch       Clk   Q                   M1




                                    TB1
       Read pin

                                              8051 IC
Writing “0” to Output Pin P1.X

      Read latch                              Vcc
                                TB2
                                                    Load(L1)   2. output pin is
1. write a 0 to the pin                                            ground
                                      0                            P1.X
     Internal CPU         D     Q
          bus              P1.X                                     pin
                                          1                     output 0
     Write to latch       Clk   Q                   M1




                                    TB1
       Read pin

                                              8051 IC
Reading “High” at Input Pin

        Read latch                                   Vcc                 2. MOV A,P1
                                           TB2                         external pin=High
1.   write a 1 to the pin MOV                               Load(L1)
             P1,#0FFH

                                                 1                1        P1.X pin
     Internal CPU bus           D      Q
                                    P1.X
                                                 0         M1
       Write to latch           Clk    Q




                                           TB1
          Read pin
3. Read pin=1 Read latch=0
      Write to latch=1
                                                       8051 IC
Reading “Low” at Input Pin

           Read latch                                 Vcc                2. MOV A,P1
                                            TB2
   1.     write a 1 to the pin                               Load(L1)   external pin=Low
         MOV P1,#0FFH
                                                  1                0        P1.X pin
        Internal CPU bus         D      Q
                                     P1.X
                                                  0         M1
         Write to latch          Clk    Q




                                            TB1
          Read pin
3. Read pin=1 Read latch=0
      Write to latch=1
                                                        8051 IC

More Related Content

What's hot

Interfacing adc
Interfacing adcInterfacing adc
Interfacing adc
PRADEEP
 
Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)
Aarav Soni
 
8051 block diagram
8051 block diagram8051 block diagram
8051 block diagram
DominicHendry
 
8051 MICROCONTROLLER
8051 MICROCONTROLLER 8051 MICROCONTROLLER
8051 MICROCONTROLLER
THANDAIAH PRABU
 
Memory organization of 8051
Memory organization of 8051Memory organization of 8051
Memory organization of 8051
Muthu Manickam
 
8051 ch9-950217
8051 ch9-9502178051 ch9-950217
8051 ch9-950217
Gopal Krishna Murthy C R
 
I o ports and timers of 8051
I o ports and timers of 8051I o ports and timers of 8051
I o ports and timers of 8051
SARITHA REDDY
 
8051 interfacing
8051 interfacing8051 interfacing
8051 interfacing
KanchanPatil34
 
8051 Microcontroller
8051 Microcontroller8051 Microcontroller
8051 Microcontroller
thokalpv
 
Arm7 Interfacing examples
Arm7   Interfacing examples Arm7   Interfacing examples
Arm7 Interfacing examples
Dr.YNM
 
IC 555 timer and its applications
IC 555 timer and its applications IC 555 timer and its applications
IC 555 timer and its applications
Jay Baria
 
Digital electronics logic families
Digital electronics logic familiesDigital electronics logic families
Digital electronics logic families
BLESSINAR0
 
Intel 8051 Programming in C
Intel 8051 Programming in CIntel 8051 Programming in C
Intel 8051 Programming in C
Sudhanshu Janwadkar
 
register file structure of PIC controller
register file structure of PIC controllerregister file structure of PIC controller
register file structure of PIC controller
Nirbhay Singh
 
Sensor interfacing in 8051
Sensor interfacing in 8051Sensor interfacing in 8051
Sensor interfacing in 8051
Irfan Ahmad
 
Interrupts in 8051
Interrupts in 8051Interrupts in 8051
Interrupts in 8051
Sudhanshu Janwadkar
 
8051 interrupts
8051 interrupts8051 interrupts
8051 interrupts
Shreyans Pathak
 
Micro controller 8051 Interrupts
Micro controller 8051 InterruptsMicro controller 8051 Interrupts
Micro controller 8051 Interrupts
dharmesh nakum
 
Multiplexers & Demultiplexers
Multiplexers & DemultiplexersMultiplexers & Demultiplexers
Multiplexers & Demultiplexers
Jayanshu Gundaniya
 
Types of flip flops ppt
Types of flip flops pptTypes of flip flops ppt
Types of flip flops ppt
Viraj Shah
 

What's hot (20)

Interfacing adc
Interfacing adcInterfacing adc
Interfacing adc
 
Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)
 
8051 block diagram
8051 block diagram8051 block diagram
8051 block diagram
 
8051 MICROCONTROLLER
8051 MICROCONTROLLER 8051 MICROCONTROLLER
8051 MICROCONTROLLER
 
Memory organization of 8051
Memory organization of 8051Memory organization of 8051
Memory organization of 8051
 
8051 ch9-950217
8051 ch9-9502178051 ch9-950217
8051 ch9-950217
 
I o ports and timers of 8051
I o ports and timers of 8051I o ports and timers of 8051
I o ports and timers of 8051
 
8051 interfacing
8051 interfacing8051 interfacing
8051 interfacing
 
8051 Microcontroller
8051 Microcontroller8051 Microcontroller
8051 Microcontroller
 
Arm7 Interfacing examples
Arm7   Interfacing examples Arm7   Interfacing examples
Arm7 Interfacing examples
 
IC 555 timer and its applications
IC 555 timer and its applications IC 555 timer and its applications
IC 555 timer and its applications
 
Digital electronics logic families
Digital electronics logic familiesDigital electronics logic families
Digital electronics logic families
 
Intel 8051 Programming in C
Intel 8051 Programming in CIntel 8051 Programming in C
Intel 8051 Programming in C
 
register file structure of PIC controller
register file structure of PIC controllerregister file structure of PIC controller
register file structure of PIC controller
 
Sensor interfacing in 8051
Sensor interfacing in 8051Sensor interfacing in 8051
Sensor interfacing in 8051
 
Interrupts in 8051
Interrupts in 8051Interrupts in 8051
Interrupts in 8051
 
8051 interrupts
8051 interrupts8051 interrupts
8051 interrupts
 
Micro controller 8051 Interrupts
Micro controller 8051 InterruptsMicro controller 8051 Interrupts
Micro controller 8051 Interrupts
 
Multiplexers & Demultiplexers
Multiplexers & DemultiplexersMultiplexers & Demultiplexers
Multiplexers & Demultiplexers
 
Types of flip flops ppt
Types of flip flops pptTypes of flip flops ppt
Types of flip flops ppt
 

Viewers also liked

I/O Ports
I/O Ports I/O Ports
I/O Ports
Islam Samir
 
8051 Microcontroller Notes
8051 Microcontroller Notes8051 Microcontroller Notes
8051 Microcontroller Notes
Dr.YNM
 
8051 Timers / Counters
8051 Timers / Counters8051 Timers / Counters
8051 Timers / Counters
Patricio Lima
 
8051 i/o port circuit
8051 i/o port circuit8051 i/o port circuit
8051 i/o port circuit
dharmendrawaghjipur007
 
8051 Timers and Counters
8051 Timers and Counters8051 Timers and Counters
8051 Timers and Counters
Shreyans Pathak
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
Mukesh Kashyap
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051
SARITHA REDDY
 
Input output ports and connectors
Input output ports and connectorsInput output ports and connectors
Input output ports and connectors
bhardwaj1992
 
8051 timer counter
8051 timer counter8051 timer counter
8051 timer counter
ankit3991
 
Architecture of 8051 microcontroller))
Architecture of 8051 microcontroller))Architecture of 8051 microcontroller))
Architecture of 8051 microcontroller))
Ganesh Ram
 
Getting started with pic microcontrollers
Getting started with pic microcontrollersGetting started with pic microcontrollers
Getting started with pic microcontrollers
Pantech ProLabs India Pvt Ltd
 
PIC-MICROCONTROLLER TUTORIALS FOR BEGINNERS
PIC-MICROCONTROLLER TUTORIALS FOR BEGINNERSPIC-MICROCONTROLLER TUTORIALS FOR BEGINNERS
PIC-MICROCONTROLLER TUTORIALS FOR BEGINNERS
VISHNU KP
 
Ports and connectors
Ports and connectorsPorts and connectors
Ports and connectors
chrispaul8676
 
PIC 16F877A by PARTHIBAN. S.
PIC 16F877A   by PARTHIBAN. S.PIC 16F877A   by PARTHIBAN. S.
PIC 16F877A by PARTHIBAN. S.
parthi_arjun
 
Ch3 ppt
Ch3 pptCh3 ppt
Ch3 ppt
wasz123
 
MPU-6050_RF24L01
MPU-6050_RF24L01MPU-6050_RF24L01
MPU-6050_RF24L01
Daniel Titello
 
Wireless transmission of voice signal using nRF24L01 module
Wireless transmission of voice signal using nRF24L01 moduleWireless transmission of voice signal using nRF24L01 module
Wireless transmission of voice signal using nRF24L01 module
Sunil Kumar Shesma
 
Communication systems Projects for Final Year Students
Communication systems Projects for Final Year StudentsCommunication systems Projects for Final Year Students
Communication systems Projects for Final Year Students
Manoj Subramanian
 
Ch09
Ch09Ch09
Embedded systems and its ports
Embedded systems and its portsEmbedded systems and its ports
Embedded systems and its ports
nitin kumar
 

Viewers also liked (20)

I/O Ports
I/O Ports I/O Ports
I/O Ports
 
8051 Microcontroller Notes
8051 Microcontroller Notes8051 Microcontroller Notes
8051 Microcontroller Notes
 
8051 Timers / Counters
8051 Timers / Counters8051 Timers / Counters
8051 Timers / Counters
 
8051 i/o port circuit
8051 i/o port circuit8051 i/o port circuit
8051 i/o port circuit
 
8051 Timers and Counters
8051 Timers and Counters8051 Timers and Counters
8051 Timers and Counters
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051
 
Input output ports and connectors
Input output ports and connectorsInput output ports and connectors
Input output ports and connectors
 
8051 timer counter
8051 timer counter8051 timer counter
8051 timer counter
 
Architecture of 8051 microcontroller))
Architecture of 8051 microcontroller))Architecture of 8051 microcontroller))
Architecture of 8051 microcontroller))
 
Getting started with pic microcontrollers
Getting started with pic microcontrollersGetting started with pic microcontrollers
Getting started with pic microcontrollers
 
PIC-MICROCONTROLLER TUTORIALS FOR BEGINNERS
PIC-MICROCONTROLLER TUTORIALS FOR BEGINNERSPIC-MICROCONTROLLER TUTORIALS FOR BEGINNERS
PIC-MICROCONTROLLER TUTORIALS FOR BEGINNERS
 
Ports and connectors
Ports and connectorsPorts and connectors
Ports and connectors
 
PIC 16F877A by PARTHIBAN. S.
PIC 16F877A   by PARTHIBAN. S.PIC 16F877A   by PARTHIBAN. S.
PIC 16F877A by PARTHIBAN. S.
 
Ch3 ppt
Ch3 pptCh3 ppt
Ch3 ppt
 
MPU-6050_RF24L01
MPU-6050_RF24L01MPU-6050_RF24L01
MPU-6050_RF24L01
 
Wireless transmission of voice signal using nRF24L01 module
Wireless transmission of voice signal using nRF24L01 moduleWireless transmission of voice signal using nRF24L01 module
Wireless transmission of voice signal using nRF24L01 module
 
Communication systems Projects for Final Year Students
Communication systems Projects for Final Year StudentsCommunication systems Projects for Final Year Students
Communication systems Projects for Final Year Students
 
Ch09
Ch09Ch09
Ch09
 
Embedded systems and its ports
Embedded systems and its portsEmbedded systems and its ports
Embedded systems and its ports
 

Similar to I o ports.ppt

8051 ports
8051 ports8051 ports
8051 ports
Ananthu R Krishnan
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
Moeez Shem
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
Rashmi
 
8051 full ppt
8051 full ppt8051 full ppt
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
Sadiq Rahim
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller
Gaurav Verma
 
8051microcontroller
8051microcontroller 8051microcontroller
8051microcontroller
manish080
 
8051 microcontrollers ch3
8051 microcontrollers ch38051 microcontrollers ch3
8051 microcontrollers ch3
mariomarion102030
 
Class7
Class7Class7
8051_microcontroller_unit4 Presentation.pdf
8051_microcontroller_unit4 Presentation.pdf8051_microcontroller_unit4 Presentation.pdf
8051_microcontroller_unit4 Presentation.pdf
tchandoo1
 
itft-Microcontriller 8051
itft-Microcontriller 8051itft-Microcontriller 8051
itft-Microcontriller 8051
Shifali Sharma
 
Microcontroller 8051 third
Microcontroller 8051  thirdMicrocontroller 8051  third
Microcontroller 8051 third
Hisham Mat Hussin
 
Datasheet8951
Datasheet8951Datasheet8951
Datasheet8951
Tabuu99
 
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
 
Microcontroller 8051 gs
Microcontroller 8051 gsMicrocontroller 8051 gs
Microcontroller 8051 gs
Moorthy Peesapati
 
AT89C52 Data sheet
AT89C52 Data sheetAT89C52 Data sheet
AT89C52 Data sheet
Microtech Solutions
 
Embedded Systems
Embedded SystemsEmbedded Systems
Embedded Systems
Akshat Rohatgi
 
At89 c51
At89 c51At89 c51
At89 c51
Tarun Sharma
 
dspAt89 s52
dspAt89 s52dspAt89 s52
dspAt89 s52
Mahesh Madapati
 

Similar to I o ports.ppt (20)

8051 ports
8051 ports8051 ports
8051 ports
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
 
8051 full ppt
8051 full ppt8051 full ppt
8051 full ppt
 
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
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller
 
8051microcontroller
8051microcontroller 8051microcontroller
8051microcontroller
 
8051 microcontrollers ch3
8051 microcontrollers ch38051 microcontrollers ch3
8051 microcontrollers ch3
 
Class7
Class7Class7
Class7
 
8051_microcontroller_unit4 Presentation.pdf
8051_microcontroller_unit4 Presentation.pdf8051_microcontroller_unit4 Presentation.pdf
8051_microcontroller_unit4 Presentation.pdf
 
itft-Microcontriller 8051
itft-Microcontriller 8051itft-Microcontriller 8051
itft-Microcontriller 8051
 
Microcontroller 8051 third
Microcontroller 8051  thirdMicrocontroller 8051  third
Microcontroller 8051 third
 
Datasheet8951
Datasheet8951Datasheet8951
Datasheet8951
 
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 )
 
Microcontroller 8051 gs
Microcontroller 8051 gsMicrocontroller 8051 gs
Microcontroller 8051 gs
 
AT89C52 Data sheet
AT89C52 Data sheetAT89C52 Data sheet
AT89C52 Data sheet
 
Embedded Systems
Embedded SystemsEmbedded Systems
Embedded Systems
 
At89 c51
At89 c51At89 c51
At89 c51
 
dspAt89 s52
dspAt89 s52dspAt89 s52
dspAt89 s52
 

Recently uploaded

A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
Nguyen Thanh Tu Collection
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
TechSoup
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
HajraNaeem15
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 

Recently uploaded (20)

A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 

I o ports.ppt

  • 1. Microcontroller 8051 Input/output Pins, Ports & Circuits Rohith.P.N IV th Sem ECE ‘B’ Sec
  • 2. • As we know Microprocessor doesn't have inbuilt Input/output ports. • It must add an additional chip to interface with the external circuitry/devices. • This disadvantage is overcome by the Microcontroller 8051. • MC 8051 has inbuilt I/O ports/circuits. • This helps the MC 8051 to connect with the external devices/memory etc..
  • 3. Pin Description of the 8051 P1.0 1 40 Vcc P1.1 2 39 P0.0(AD0) P1.2 3 38 P0.1(AD1) P1.3 P1.4 4 5 8051 37 36 P0.2(AD2) P0.3(AD3) P1.5 6 35 P0.4(AD4) P1.6 7 34 P0.5(AD5) P1.7 8 33 P0.6(AD6) RST 9 32 P0.7(AD7) (RXD)P3.0 10 31 EA/VPP (TXD)P3.1 11 30 ALE/PROG (INT0)P3.2 12 29 PSEN (INT1)P3.3 13 28 P2.7(A15) (T0)P3.4 14 27 P2.6(A14) (T1)P3.5 15 26 P2.5(A13) (WR)P3.6 16 25 P2.4(A12) (RD)P3.7 17 24 P2.3(A11) XTAL2 18 23 P2.2(A10) XTAL1 19 22 P2.1(A9) GND 20 21 P2.0(A8)
  • 4. Pin details of MC 8051 The Microcontroller 8051 has 40 Pins. I/O Port 0 Pins 32-37 I/O Port 1 Pins 1-8 I/O Port 2 Pins 21-28 I/O Port 3 Pins 10-17 Pin 40 - Vcc Pin 20 - Gnd Pin 19 & 18 – XTAL1 & XTAL2 Pin 9 – Reset Pin 31 – EA (External Access) Pin 29 – PSEN ( Program Store Enable) Pin 30 – ALE (Address Latch Enable)
  • 5. • Vcc(pin 40): – Vcc provides supply voltage to the chip. – The voltage source is +5V. • GND(pin 20):ground • XTAL1 and XTAL2(pins 19,18)
  • 6. • RST(pin 9):reset – It is an input pin and is active high(normally low). • The high pulse must be high at least 2 machine cycles. – It is a power-on reset. • Upon applying a high pulse to RST, the microcontroller will reset and all values in registers will be lost. • Reset values of some 8051 registers
  • 7. RESET Value of Some 8051 Registers: Register Reset Value PC 0000 ACC 0000 B 0000 PSW 0000 SP 0007 DPTR 0000 RAM are all zero.
  • 8. • /EA(pin 31):external access – There is no on-chip ROM in 8031 and 8032 . – The /EA pin is connected to GND to indicate the code is stored externally. – /PSEN & ALE are used for external ROM. – For 8051, /EA pin is connected to Vcc. – “/” means active low. • /PSEN(pin 29):program store enable – This is an output pin and is connected to the OE pin of the ROM.
  • 9. • ALE(pin 30):address latch enable – It is an output pin and is active high. – 8051 port 0 provides both address and data. – The ALE pin is used for de-multiplexing the address and data by connecting to the G pin of the 74LS373 latch. • I/O port pins – The four ports P0, P1, P2, and P3. – Each port uses 8 pins. – All I/O pins are bi-directional.
  • 10. • The 8051 has four I/O ports – Port 0 (pins 32-39):P0(P0.0~P0.7) – Port 1(pins 1-8) :P1(P1.0~P1.7) – Port 2(pins 21-28):P2(P2.0~P2.7) – Port 3(pins 10-17):P3(P3.0~P3.7) – Each port has 8 pins. • Named P0.X (X=0,1,...,7), P1.X, P2.X, P3.X • Ex:P0.0 is the bit 0(LSB)of P0 • Ex:P0.7 is the bit 7(MSB)of P0 • These 8 bits form a byte. • Each port can be used as input or output (bi-direction).
  • 12. Port 0 :- • When used as input,a ‘1’ must be written to corresponding port latch • Used as an output,’0’ must be be programmed • Logic ‘1’ in address bit will turn Upper FET on & lower FET off • After address has formed & latched into External circuitry by ALE pulse,the External Bus is turned ON • Port 0 now reads data from External Memory • Port 0 pins can be accessed by address P0.0,P0.1,….,P0.7 • It can also be addressed as AD0,AD1,…….AD7
  • 13. Port 0 with Pull-Up Resistors
  • 14. Port 1 :- • Port 1 pins have no Dual functions • If used as input a ‘1’ is written to latch which turns upper FET on • Used as output,lower FET is On & the Pullup is Off • Output latch is directly connected to gate of Lower FET • Port 1 can be accessed as P1.0,P1.1,. . . . .P1.7
  • 15. Port 2 :- • It can be used as i/p or o/p which is similar in operation of Port 1 • The alternate use of port 2 is to supply a high-order address byte in conjunction with port 0 low-order byte to address external memory • Port 2 latches remain stable when External Memory is addressed • They do not have to be turned around (Set to 1) For Data i/p as in Port 0 • It can be accessed as P2.0,P2.1,. . . . . ,P2.7
  • 16. Port 3 :- • It is similar to port 1,but has alternate Uses • Each pin may be individually Programmed as I/O or for alternate Functions as shown Pin Alternate Use SFR P3.0-RXD Serial data input SBUF P3.1-TXD Serial data Output SBUF P3.2-INT0 External interrupt 0 TCON.1 P3.3-INT1 External interrupt 1 TCON.3 P3.4-T0 External timer 0 input TMOD P3.5-T1 External timer 1 input TMOD P3.6-WR External Memory Write Pulse - P3.7-RD External Memory Read Pulse -
  • 17. Writing “1” to Output Pin P1.X Read latch Vcc TB2 Load(L1) 2. output pin is 1. write a 1 to the pin Vcc 1 P1.X Internal CPU D Q bus P1.X pin 0 output 1 Write to latch Clk Q M1 TB1 Read pin 8051 IC
  • 18. Writing “0” to Output Pin P1.X Read latch Vcc TB2 Load(L1) 2. output pin is 1. write a 0 to the pin ground 0 P1.X Internal CPU D Q bus P1.X pin 1 output 0 Write to latch Clk Q M1 TB1 Read pin 8051 IC
  • 19. Reading “High” at Input Pin Read latch Vcc 2. MOV A,P1 TB2 external pin=High 1. write a 1 to the pin MOV Load(L1) P1,#0FFH 1 1 P1.X pin Internal CPU bus D Q P1.X 0 M1 Write to latch Clk Q TB1 Read pin 3. Read pin=1 Read latch=0 Write to latch=1 8051 IC
  • 20. Reading “Low” at Input Pin Read latch Vcc 2. MOV A,P1 TB2 1. write a 1 to the pin Load(L1) external pin=Low MOV P1,#0FFH 1 0 P1.X pin Internal CPU bus D Q P1.X 0 M1 Write to latch Clk Q TB1 Read pin 3. Read pin=1 Read latch=0 Write to latch=1 8051 IC