8051 Microcontroller Pin Configuration & Programming Model YASH PAL, April 12, 2026April 12, 2026 8051 Microcontroller Pin Configuration & Programming Model – The 8051 microcontroller consists of 40 pins, and the programming model consists of 8-bit and 16-bit registers and 8-bit memory locations.8051 Microcontroller Pin ConfigurationPinout of the 8051 microcontroller packaged in a 40-pin DIP, as shown in the figure below, with the full and abbreviated names of the signals for each pin.8051 DIP pin AssignmentsLet’s discuss these pins in brief.Vcc – Connected to +5V power supply.Vss – Connected to the groundXTAL1 – is the input to the inverting amplifier that forms part of the oscillator circuit. In the case of an external clock, this pin must be connected to ground.XTAL2 – Output of the inverting amplifier that forms a part of the oscillator and input to the internal clock generator. In the case of an external clock, it must be connected to XTAL2.Port 0 – Port 0 is an 8-bit true bi-directional open drain I/O. The low-order address and data bus are also multiplexed with port 0. Port 0 is open-drain and must be pulled high externally through a pull-up resistor.Port 1 – Port 1 is an 8-bit quasi bi-directional I/O. The term quasi-bi-directional port is due to the fact that port 1 pins are internally pulled high with fixed pull-up resistors. One has to configure it either as input or output. Writing a ‘1’ to the port latch causes it to act as input. When configured as input, the port pin is pulled high and well-sourced current if it is made low externally.Port 2 – Port 2 is also an 8-bit quasi-bi-directional I/O port. Port pins are pulled high internally. It is multiplexed with the higher-order address bus.Port 3 – Port 3 is again an 8-bit quasi-bi-directional I/O port. Port pins are pulled high internally. There are other functions multiplexed with the port 3 pins. The alternate functions are listed in the table below. These alternate functions of port 3 pins are related to external interrupts, serial port, timer/counter, and read/write control signals.PinAlternate useSFRP3.0 – RXDSerial data inputSBUFP3.1 – TXDSerial data outputSBUFP3.2 – INT0External interrupt 0TC0N.1P3.3 – INT1External interrupt 1TC0N.3P3.4 – T0External timer 0 inputTM0DP3.5 – T1External timer 1 inputTM0DP3.6 – WRExternal memory write pulse–P3.7 – RDExternal memory read pulse–Alternate function of PortsRST – For resetting the device, the RST pin of 8051 is made high for two machine cycles, while the oscillator is running. A power-on reset circuit is shown in the figure below. These component values are also sufficient to provide a delay, so as to make the RST line high for 24 oscillator periods. To support the manual reset function, if desired, a switch may be added across the 10μF capacitor.8051 connections, oscillator, and reset circuitALE – Address latch enable (ALE) output is used for latching the low address byte during external memory access. ALE is activated periodically with a constant rate of 1/6 oscillator frequency. However, during the external data memory access, one ALE pulse is skipped.PSEN – Program store enable PSEN is the output control signal, activated every six oscillator periods, while fetching the external program memory. It is the strobe to the external program memory. During the internal program execution, it remains high.EA – External access (EA) pin, when held high, executes instructions from the internal program memory till address OFFFH; beyond this address, the instructions are fetched from external program memory. If this pin is low, all the instructions are fetched from the external memory. During normal operation, this pin should not be floated.Programming Model of 8051The programming model of the 8051 microcontroller is shown in the figure below. It is a collection of 8-bit and 16-bit registers and 8-bit memory locations. The software instructions of the 8051 microcontroller, which are incorporated in the design, can operate these registers and memory locations. The programming model is complicated by the number of special function registers. Most of the registers have a specific function and are shown as individual blocks with symbolic names in the figure below. Other registers are grouped in a large block.Each register (except the program counter) has an internal 1-byte address. Some registers are both byte and bit-addressable. Software instructions are generally able to specify a register by its address, its symbolic name, or both.Programming Model of 8051 Microcontroller engineering subjects Microprocessor microprocessor