8051 i/o port circuit
-
Upload
dharmendrawaghjipur007 -
Category
Engineering
-
view
379 -
download
2
Transcript of 8051 i/o port circuit
![Page 1: 8051 i/o port circuit](https://reader034.fdocuments.us/reader034/viewer/2022042600/58a4783e1a28aba34c8b65eb/html5/thumbnails/1.jpg)
OM INSTITUTE OF TECHNOLOGYVanta Vachhoda
Branch : Electrical 5th sem
Subject : MMI
Name Enrollment No. 1. Parmar Dharmendrasinh G. 1310301090292. Khant Mukesh B. 1310301090183. Parmar Ajay R. 131030109027
![Page 2: 8051 i/o port circuit](https://reader034.fdocuments.us/reader034/viewer/2022042600/58a4783e1a28aba34c8b65eb/html5/thumbnails/2.jpg)
8051 i/o port circuits
![Page 3: 8051 i/o port circuit](https://reader034.fdocuments.us/reader034/viewer/2022042600/58a4783e1a28aba34c8b65eb/html5/thumbnails/3.jpg)
Outlines
1. Introduction2. Port ‘0’ circuit3. Port ‘1’ circuit4. Port ‘2’ circuit5. Port ‘3’ circuit
![Page 4: 8051 i/o port circuit](https://reader034.fdocuments.us/reader034/viewer/2022042600/58a4783e1a28aba34c8b65eb/html5/thumbnails/4.jpg)
Introduction :
• Number of 8051 ports : The microcontroller 8051 has four ports P0,P1,P2 & P3.The four ports are require for i/o operations. Out of the 40 pin,32 pins are set aside for the four ports P0,P1,P2&P3.Each port takes 8 pins.
• All the ports are configured as input upon Reset.• When zero is written to a port , it becomes an
output. To configure it as an input port, 1 needs to be sent to the port.
![Page 5: 8051 i/o port circuit](https://reader034.fdocuments.us/reader034/viewer/2022042600/58a4783e1a28aba34c8b65eb/html5/thumbnails/5.jpg)
Port “0”
![Page 6: 8051 i/o port circuit](https://reader034.fdocuments.us/reader034/viewer/2022042600/58a4783e1a28aba34c8b65eb/html5/thumbnails/6.jpg)
Port ‘0’
• Port 0 is multi functioned port of microcontroller 8051.Its SFR address is 80H.It is bit addressable port.
• Function and use : It can be used as simple input / output mode or for generating data and lower order address bus for external memory (AD0 – AD7).
• In order to use the pins of the port 0 as input and output each pin must be connected to 10KΩ pull up resistor as shown in figure.
![Page 7: 8051 i/o port circuit](https://reader034.fdocuments.us/reader034/viewer/2022042600/58a4783e1a28aba34c8b65eb/html5/thumbnails/7.jpg)
![Page 8: 8051 i/o port circuit](https://reader034.fdocuments.us/reader034/viewer/2022042600/58a4783e1a28aba34c8b65eb/html5/thumbnails/8.jpg)
Port 0 as simple input port
• When port 0 is used as an input port, ‘1’ must be written to the corresponding zero latch that will cause both the output transistor to switch off and the pin “floats” in a high impedance state. When configured input port the microcontroller provides two facilities :
• 1. Read logic level on physical pin by asserting read pin signal.
![Page 9: 8051 i/o port circuit](https://reader034.fdocuments.us/reader034/viewer/2022042600/58a4783e1a28aba34c8b65eb/html5/thumbnails/9.jpg)
• 2. Read contents of internal latch by asserting the read latch signal. The latch is read when the instruction is read-modify-write type instruction. A read-modify-write signal is one, wherein the instruction reads the data from the port modifies it and writes to the port.
![Page 10: 8051 i/o port circuit](https://reader034.fdocuments.us/reader034/viewer/2022042600/58a4783e1a28aba34c8b65eb/html5/thumbnails/10.jpg)
Port 0 as simple output
• When port 0 is configured as an output port, the latch pins that are programmed to 0 will cause the lower FET to turn ON and pin is grounded.
• If a ‘1’ is written on to the latch pin the FET will turn off and the pin is pulled HIGH by external pull up resistors.
![Page 11: 8051 i/o port circuit](https://reader034.fdocuments.us/reader034/viewer/2022042600/58a4783e1a28aba34c8b65eb/html5/thumbnails/11.jpg)
Port “1”
![Page 12: 8051 i/o port circuit](https://reader034.fdocuments.us/reader034/viewer/2022042600/58a4783e1a28aba34c8b65eb/html5/thumbnails/12.jpg)
Port ‘1’
• Port 1 is a one bit simple i/o port of microcontroller. Its SFR address is 90H.It does not have any extra / alternate function like port 0.
![Page 13: 8051 i/o port circuit](https://reader034.fdocuments.us/reader034/viewer/2022042600/58a4783e1a28aba34c8b65eb/html5/thumbnails/13.jpg)
Port 1 as simple input port
• When port 1 is used as an input port, ‘1’ must be written to the corresponding port 1 latch bit.This causes the lower FET turn off.The pin and input to pin buffer are pulled to logic HIGH by the internal pull uo load.
• Port is called as ‘quasi-bidirectional’ port as its output is pulled high with pull up resister.
![Page 14: 8051 i/o port circuit](https://reader034.fdocuments.us/reader034/viewer/2022042600/58a4783e1a28aba34c8b65eb/html5/thumbnails/14.jpg)
Port 1 as simple output port
• When port 1 is used as an output port, the latch pins that are programmed to 0, will cause the lower FET turn on, the internal pull up to turn off and input to the circuit is logic 0.
• If ‘1’ is written onto the latch pin then it will drive the input of external circuit high through the pull up.The lower FET turns off.
![Page 15: 8051 i/o port circuit](https://reader034.fdocuments.us/reader034/viewer/2022042600/58a4783e1a28aba34c8b65eb/html5/thumbnails/15.jpg)
Port “2”
![Page 16: 8051 i/o port circuit](https://reader034.fdocuments.us/reader034/viewer/2022042600/58a4783e1a28aba34c8b65eb/html5/thumbnails/16.jpg)
Port ‘2’
• Port 2 of microcontroller 8051 is 8 bit multifuntional port. Its SFR address is A0H. It is bit addressable port.
• Function and use : It can be used as simple input / output or for generating the upper order address bus for the external memory (A8 –A15).
![Page 17: 8051 i/o port circuit](https://reader034.fdocuments.us/reader034/viewer/2022042600/58a4783e1a28aba34c8b65eb/html5/thumbnails/17.jpg)
Port ‘2’as simple input port
• When port 2 is used as an input port,’1’ must be written to the corresponding latch bit. This cause the FET turn off. The pin and input to pin buffer are pulled to logic high by the internal pull up load.
• Port 2 is called as “quasi-bidirectional port” as its output is pull up resistors.
![Page 18: 8051 i/o port circuit](https://reader034.fdocuments.us/reader034/viewer/2022042600/58a4783e1a28aba34c8b65eb/html5/thumbnails/18.jpg)
Port 2 as simple output port
• When port 2 is used as output port, the latch pins that are programmed to 0, will cause the lower FET turn off and input to the circuit logic 0.
• If “1” is written onto the latch pin then it will drive the input of external circuit high through the oull up. The lower FET turns off.
![Page 19: 8051 i/o port circuit](https://reader034.fdocuments.us/reader034/viewer/2022042600/58a4783e1a28aba34c8b65eb/html5/thumbnails/19.jpg)
Port “3”
![Page 20: 8051 i/o port circuit](https://reader034.fdocuments.us/reader034/viewer/2022042600/58a4783e1a28aba34c8b65eb/html5/thumbnails/20.jpg)
Port “3”
• It is 8 bit multifunctional port.• Its SFR address is B0H. It is bit addressable port.• Use : Port 3 is a multifunctional port it can be used as
simple input / output port.• The port 3 pins have three special functions.this
functions are listed in table.
![Page 21: 8051 i/o port circuit](https://reader034.fdocuments.us/reader034/viewer/2022042600/58a4783e1a28aba34c8b65eb/html5/thumbnails/21.jpg)
Alternate functions of port 3 pins
![Page 22: 8051 i/o port circuit](https://reader034.fdocuments.us/reader034/viewer/2022042600/58a4783e1a28aba34c8b65eb/html5/thumbnails/22.jpg)
Port 3 as simple input port
• When port 3 is used as input port, “1” must be written to the corresponding port 3 latch bit.
• This causes the FET turn off. • The pin and input to the pin buffer are to
pulled to logic HIGH by internal pull up load.
![Page 23: 8051 i/o port circuit](https://reader034.fdocuments.us/reader034/viewer/2022042600/58a4783e1a28aba34c8b65eb/html5/thumbnails/23.jpg)
Port 3 as simple output port
• When port 3 is used as output port, the latched pins that are programmed to 0, will cause the lower FET to turn on, the internal pull up to turn off and input to the circuit is logic 0.
• If ‘1’ is written onto the latch pin that it will drive the input external circuit high through the pull up. The lower FET turns off.
![Page 24: 8051 i/o port circuit](https://reader034.fdocuments.us/reader034/viewer/2022042600/58a4783e1a28aba34c8b65eb/html5/thumbnails/24.jpg)
Port 3 as one of the alternate function
• For achieving any one of the output function, another control signal called as “alternate output function” is available on port 3. Depending on the logic level present on line “alternate output function” the FET will turn ON or OFF.
• When the latch bit of port 3 is logic 1, the output is controlled by the control input.
![Page 25: 8051 i/o port circuit](https://reader034.fdocuments.us/reader034/viewer/2022042600/58a4783e1a28aba34c8b65eb/html5/thumbnails/25.jpg)
Port 3 loading and interfacing
• The output buffers of ports 1,2&3 can each drive 4 LS TTL inputs. Port 0 when used in external bus mode output buffer can drive 8 LS TTL inputs.
• In order to drive inputs these ports as port pins require external pull ups to drive any inputs.
![Page 26: 8051 i/o port circuit](https://reader034.fdocuments.us/reader034/viewer/2022042600/58a4783e1a28aba34c8b65eb/html5/thumbnails/26.jpg)