Today we are going to unlock the details on the 8051 series of microcontrollers which is a famous microcontroller in the embedded system industry, about the specification details like pins, how to use these pins, etc. This article first goes with the history of 8051 and then moves towards the architecture, internal blocks like timer, register, counter, etc.

History of 8051 

8051 microcontrollers were designed and developed by Intel in is an 8-bit microcontroller with 4Kb ROM,128Kb RAM, two 16 bit timers, one serial communication port, and four general-purpose input-output ports. Each port has an 8-bit register. The CPU is also an 8-bit processing unit and it can process 8 bits of data at a time. Processing large data must be divided into smaller 8 bits chunks and done processing that’s why 8051 is called an 8-bit microcontroller

Right now there are different versions of 8051 based boards available in the market with different RAM and ROM sizes, but all have the same architecture and instruction sets.

Feature of Intel 8051 Microcontroller

Input /Output pins4 ( Port 0, Port 1, Port 2, Port 3 )
Serial Port1
Interrupt 6
Timers/counters2 (16-bit timers 

8051 Microcontroller pinout diagram 

8051 comes with 3 different packages DIP (dual inline package), QFP (quad flat package), and LLC(a leadless chip carrier).

8051 microcontroller  pinout diagram

Note: commonly available 8051 based microcontrollers have 40 pins but some manufactures try to produce a few with 20 pins.

Pin Configuration and Details of 8051

Here I am going to explain about the pin of 8051 microcontrollers along with some images from the Proteus PCB designer, these images will help you to design individual DIY 8051 PCB boards for your home projects 

1. VCC: pins which we provide input power supply to 8051. Operating voltage of 8051 is 5V more than that it damages the IC and below 4.5 IC will not turn on

2.GND: Connects the Gnd

3.XTAL1 and XTAL2:  8051 have an on-chip crystal oscillator, But it requires an external clock to work effectively.  An external crystal oscillator is connected to XTAL1 and XTAL2 pins and also connects two 30pF  in which one terminal is connected with the crystal oscillator and another terminal with the ground.  The speed at which an 8051 microcontroller processes an instruction depends on the frequency of the crystal oscillator. There is a maximum limit that can be provided to the microcontroller, for more details refer to the datasheet.

4.RST: pin number 9 is a reset pin. It is an active-high pin. and used to reset. If we apply an active high signal to this pin, the 8051 microcontrollers will reset and turn off all their functions.  It will erase all values of registers and it will make all program counter values to zero. 

8051 microcontroller Design Schematics

5.EA Pin number 33 is used to store programs. All families of 8051 microcontrollers come with on-chip ROM to store programs.  For such purposes, EA pins are connected with Vcc. EA stands for external access.

6.PSEN Pin number 29 is an output pin. It stands for “Program store enable”. It is also used for programming.

8051 input-output ports are marked as PORT0,PORT1, PORT2,PORT3, and these are used to interact with environments 

8051 Microcontroller architecture

Block Diagram of 8051 Microcontroller

Block Diagram of 8051 microcontroller


Registers are used to store temporary instructions on a microcontroller. Here in 8051, the microcontroller has an 8-bit register that starts from D0 to D7. Do is the least significant bit and D7 is the highest significant bit.

There are two types of Registers 

1.General Purpose Registers 

2. Special Purpose registers 

Mostly used general-purpose Registers are these 

  • A : Accumulator  Register used  to perform arithmetic and logic operations 
  • B, R0, R1, R2, R3, R4, R5, R6, R7 registers used to store instruction address and data while programming 
  • DPTR known as Data pointers and this is used to access and process data in different addressing modes) It consists of high byte ( DPH) and a low byte (DPL) which is used to hold 16 bit addresses.  We can use it as a base register in indirect jumps, external data transfer and lookup table instructions.
  • PC  Known as Program counter and it has a 16 bit register. 

Timers / Counters

8051 has 2 timers, Timer zero and Timer one. they’ll be used as timers or as event counters. Each Timer 0 and Timer 1 are 16-bit wide. Time of increment depends on the frequency of the oscillator we connected on XTAL1 and XTAL2

General Purpose ports 

8051 has four input/output ports to interact with external devices marked as  Port 0, Port 1, Port 2, Port 3.

To configure any port the port as input port writes 0 to it and to configure any port as an output write 1 to it. When using port 0 as an input or output each pin must be externally pulled up with a 10K ohm resistor because this port 0 has an in-built open-drain connection.

Open drain connection means transistor will switch to ground when it’s active, thus “sinking” current

Data Types

8051 only has an 8-bit data register. Data length is more than 8-bit, it is the responsibility of the programmer to divide data into 8-bit pieces before processing

Addressing modes

The microprocessor receives the data in different ways. The data is usually stored in the register, in the memory and can be used from the immediate value. These different ways of accessing data are called addressing modes. Different microcontrollers have different addressing modes. That depends on the design of the manufacturer. 8051 has 5 addressing modes

  • Indexed addressing mode
  • Register indirect addressing mode
  • Direct addressing mode
  • Register addressing mode
  • Immediate Addressing mode

This article covers some basic questions related to 8051

a.What is microcontroller 8051?

b.Why 8051 is called an 8-bit microcontroller?