Pin Diagram of 8051 Microcontroller with Explanation: A microcontroller is a small and low-cost microcomputer which is basically designed to perform some specific tasks of an embedded system like receiving remote signals or displaying microwave information etc. A microcontroller consists of a processor, a fixed amount of memory (RAM, ROM, EPROM), serial ports and some peripheral devices like Timers, Counters etc. All these components are embedded together on one single chip. In this article, we will discuss the block diagram and pin diagram of 8051 microcontrollers with the explanation.
Block Diagram of 8051 Microcontroller:
Pin Diagram of 8051 Microcontroller:
The pin diagram of 8051 microcontroller consists of 40 pins, where a total of 32 pins are set aside for the 4 ports P0, P1, P2, P3. Each port takes 8 pins. The remaining 8 pins are designed as Vcc, GND, XTAL1, XTAL2, RST, EA, ALE and PSEN. These 8 pins are used by all numbers of 8051 families.
- Vcc: Pin 40 provides the voltage supply to the circuit. This voltage source is +5v usually.
- GND: Pin 20 is set aside for ground connection for the earthing of the circuit.
- XTAL1 & XTAL2: The 8051 has an on-chip oscillator but requires an external clock to run it. Most often a crystal oscillator is connected to inputs XTAL1 (Pin 19) and XTAL2 (Pin 18).
- RST: Pin 9 is the Reset pin which is an input and active high (Normally low). Upon applying a high pulse to this pin, the 8-51 microcontroller will reset and terminate all activities. This pin is often referred to as power or resets button. Activating a power or reset will cause all values in the register to be lost.
- EA: The 8051 family members, all come with on-chip ROM to store programmes.
- PSEN: This is an output pin stands for program code enabled. In 8031 system, an external ROM holds the program code, so this pin is connected to the ROM.
- ALE: Address stands for Address Latch Enable – an output pin which is active High. ALE pin is used for demultiplexing the address and data by connecting to the ground pin of the system.
- Port 0: It occupies a total of 8 pins (32 to 39). It can be used as port input or output. To use the port of Pin 0 as both input or output, each pin must be connected externally to a pull-up register. With external pull-up register, Port 0 is configured as an output port. With register connected to Port 0, in order to make it an input the port must be programmed by writing 1 to all the bits.
- Port 1: It occupies a total of 8 pins (1 to 8). It can be used as input or output. In contrast to Port 0, this port doesn’t need any pull-up register. Since it already has pull-up register externally. Port 1 can be configured as an output upon reset. To make the port 1 as input, it must be programmed as such by writing 1 to all of its bits.
- Port 2: It occupies a total of 8 pins (21 to 28). It can also be used as input and output. just like P1, P2 doesn’t need any pull-up register since it already has registers internally. Port 2 can be configured as an output upon reset. To make it input, it must be programmed as such by writing 1 to all its bit.
- Port 3: It occupies a total of 8 pins (10 to 17) used as input and output. P3 doesn’t need any pull-up register same as P1 and P2. P3 has the additional function of providing some extremely important functions and signals such as interrupts. P3.0 and P3.1 are used for RXD and TXD serial communication signal. P3.2 and P3.3 are set aside for external interrupts. P3.4 and P3.5 are used for timer 0 and 1. Finally, P3.6 and P3.7 are used to provide the write and used signal for external memory connected to the 8051 microcontroller system.
So far we have discussed the pin diagram of 8051 Microcontroller and the block diagram of 8051 Microcontroller in details. We have another article on the difference between microcontroller and microprocessor that you may like.