The 8051 microcontroller is a widely used microcontroller that has a simple architecture and is easy to program. The 8051 microcontroller has 40 pins that are used for various functions, including input/output (I/O) ports, timers/counters, interrupts, and communication interfaces. In this article, we will discuss the 8051 pin diagram and its functions.
8051 Pin Diagram:
The 8051 microcontroller has 40 pins, which are labeled as P0.0 to P3.7, and ALE, PSEN, EA, XTAL1, XTAL2, RST, VCC, and GND. The pin diagram of the 8051 microcontroller is shown below.
P3.7|1 40|VCC
P3.6|2 39|P0.0
P3.5|3 38|P0.1
P3.4|4 37|P0.2
P3.3|5 36|P0.3
P3.2|6 35|P0.4
P3.1|7 34|P0.5
P3.0|8 33|P0.6
RXD |9 32|P0.7
TXD |10 31|EA
INT0|11 30|RST
INT1|12 29|PSEN
T0 |13 28|ALE
T1 |14 27|XTAL1
WR |15 26|XTAL2
RD |16 25|GND
P2.7|17 24|P2.0
P2.6|18 23|P2.1
P2.5|19 22|P2.2
P2.4|20 21|P2.3
|________|
Functions of each Pin:
Functions of each Pin:
P0.0 to P0.7 (pins 39 to 32):
P0 is an 8-bit bi-directional I/O port. These pins can be used for input or output. P0.0 to P0.7 can be used to interface with external devices such as sensors, switches, and other peripherals.
P1.0 to P1.7 (pins 1 to 8):
P1 is another 8-bit bi-directional I/O port. These pins can be used for input or output. P1.0 to P1.7 can be used to interface with external devices such as sensors, switches, and other peripherals.
P2.0 to P2.7 (pins 24 to 17):
P2 is an 8-bit bi-directional I/O port. These pins can be used for input or output. P2.0 to P2.7 can be used to interface with external devices such as sensors, switches, and other peripherals.
P3.0 to P3.7 (pins 8 to 1):
P3 is an 8-bit bi-directional I/O port. These pins can be used for input or output. P3.0 to P3.7 can be used to interface with external devices such as sensors, switches, and other peripherals.
ALE (Address Latch Enable) (pin 28):
ALE is used to latch the address of the instruction being executed by the CPU. ALE goes high for one machine cycle during the execution of each instruction.
PSEN (Program Store Enable) (pin 29):
PSEN is used to indicate that the