7.8051_IO Ports - The 8051 Microcontroller and Embedded...

This preview shows page 1 - 9 out of 30 pages.

1 The 8051 Microcontroller and Embedded Systems CHAPTER 4 I/O PORT PROGRAMMING
Image of page 1

Subscribe to view the full document.

2 OBJECTIVES List the 4 ports of the 8051 Describe the dual role of port 0 in providing both data and addresses Code Assembly language to use the ports for input or output Explain the dual role of port 0 and port 2 Code 8051 instructions for I/O handling Code I/O bit-manipulation programs for the 8051
Image of page 2
3 SECTION 4.1: 8051 I/O PROGRAMMING I/O port pins and their functions Figure 4 1 8051 Pin Diagram
Image of page 3

Subscribe to view the full document.

4 SECTION 4.1: 8051 I/O PROGRAMMING All the ports upon RESET are configured as inputs, ready to be used as input ports. When the first 0 is written to a port, it becomes an output. To reconfigure it as an input, a 1 must be sent to the port. To use any of these ports as an input port, it must be programmed.
Image of page 4
5 SECTION 4.1: 8051 I/O PROGRAMMING Port 0 Figure 4–2 Port 0 with Pull-Up Resistors
Image of page 5

Subscribe to view the full document.

6 Port 0 It can be used for input or output. To use the pins of port 0 as both input and output each pin must be connected externally to a 10 Kohm pull-up resistor. This is due to the fact that P0 is an open drain, unlike P 1, P2, and P3
Image of page 6
7 Port 0 as input With resistors connected to port 0, in order to make it an input, the port must be programmed by writing 1 to all the bits.
Image of page 7

Subscribe to view the full document.

8 Dual role of port 0 Port 0 is also designated as AD0 - AD7, allowing it to be used for both address and data.
Image of page 8
Image of page 9

{[ snackBarMessage ]}

Get FREE access by uploading your study materials

Upload your study materials now and get free access to over 25 million documents.

Upload now for FREE access Or pay now for instant access
Christopher Reinemann
"Before using Course Hero my grade was at 78%. By the end of the semester my grade was at 90%. I could not have done it without all the class material I found."
— Christopher R., University of Rhode Island '15, Course Hero Intern

Ask a question for free

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern