8051 is a single chip microcontroller designed by Intel in 1980 for use in embedded systems. Here single chip refers to all the components including processor, RAM, ROM, Input Output ports and Timers are all embedded on a single Integrated Circuit. It’s an 8-bit microcontroller means CPU can only work on 8-bit data at a time.
CPU: It’s the Brain of 8051 microcontroller. It does various arithmetic and logical calculations based on the Program it read from its memory.
ROM: It’s a memory in which program is saved. It’s non-volatile memory i.e. its data is not lost when power is turned off.
RAM: It’s also a memory used by microcontroller to save temporary data. It’s a volatile memory i.e. its data is lost when power is turned off.
Timer: It’s a peripheral of microcontroller which is used for timing calculations it can be programmed.
Input-Outputs ports: There are four input output ports in 8051 microcontroller which are used to interact with real world.
Serial Com Port: It’s a communication port which can be used to communicate with other microcontroller and even our personal computers and laptops.
Program: It’s a set of Instruction which is burnt on the ROM i.e. its Memory. Usually programming is done in ‘C’-Language which is converted into instructions which can be read by CPU of microcontroller i.e. hex code by a compiler.
8051 Microcontroller Architecture
The 8051 microcontroller architecture diagram is shown in above image. It is based on Harvard architecture means its CODE memory and DATA memory are physically separate memory areas. It’s an 8-bit microcontroller i.e. it has 8 bit Arithmetic and logic unit. All of its registers are of 8 bits except Program counter and DPTR.
- It has 8 bits of:
- Data Bus
- General Purpose Registers (R0-R7)
- Program status Word (PSW)
- stack pointer
- Special function Registers (Accumulator, Register B)
Note: PSW and stack pointer are also SFR.
- It has 16 bits of
- Program counter (PC)
- Data pointer (DPTR)
- It has on chip ROM of 4KB (0000H – 0FFFH).
- RAM – 128 Bytes.
- SFR Memory – 128 Bytes.
- 32 I/O pins arranged as four 8-bit ports (P0 -P3)
- Two 16-bit timer/counters: T0 andT1
- Full duplex UART (serial port)
- Interrupt controller Controlling 6 interrupts:
- Reset
- External Hardware Interrupt 0(INT0)
- Timer 0 Interrupt (TF0)
- External Hardware Interrupt 1(INT1)
- Timer 0 Interrupt (TF1)
- Serial COM Interrupt (RI and TI)
- Data Bus: It has 8 bits of data bus hence 8 bits of data can be transferred at a time
- Address Bus: It has 16 bits of data bus hence it can address up to 64KB of Memory. It can be calculated as there are 16 bits which can either store ‘1’ or ‘0’. Hence total number of combinations are 2 ^ 16 = 65536. And one location can store one byte of data hence 65536 x 1 Byte = 64 x 1024 x 1 Byte = 64 Kilo byte = 64KB.
8051 Microcontroller Features
- It has 8-bit Central processing unit means CPU can only work on 8-bit data at a time.
- It has 4 Kilo Bytes of programmable space referred to as Read Only Memory (ROM).
- It has 128 Bytes of Random-Access Memory, its used for temporary saving of Data.
- Two independent timers, which can be programmed as timers as well as counters.
- 32 Input output pins which are divided into 4 ports which when act as an output control the external circuit by changing signals both to 5V or 0V and as an input read the input signals within its input range.
- 6 interrupt sources i.e. there are 6 ways to directly interrupt the CPU. When interrupt is occurred then CPU stops running its current code jumps to a special routine executes its code and then restarts its normal running code. All this functioning is controlled by an interrupt controller.
- One serial port which can be used to communicate with other microcontroller and even our personal computers and laptops.
- Address bus is 16-bit unidirectional.
- Data bus is 8-bit bidirectional.
- It has a 16-bit program counter and data pointer.
8051 Microcontroller Pin Diagram
8051 microcontrollers have four 8-bit I/O ports P0, P1, P2 and P3
Each uses 8 pins:
- All the ports upon RESET are configured as input.
- When the first 0 is written to a port, it becomes an output port.
- To reconfigure it again as an input, a 1 must be sent to that port.
- To use any of these ports as an input/output port, it must be programmed.
External configuration before using Port 0
It can be used for input or output; each pin must be externally connected to a 10K pull-up resistor, because P0 is an open drain, unlike P1, P2, and P3 Open drain is a term used for MOS chips in the same way that open collector is used for TTL chips.
8051 Microcontroller Applications
8051 Microcontroller is used in many embedded systems and applications. Some of the applications of 8051 Microcontroller are given below:
- Consumer Appliances
- Communication Systems
- Aeronautical and Space
- Robotics
- Automobiles
- Medical Equipment
- Defense Systems
- Light sensing and controlling device
FAQ’S
What is a 8051 microcontroller?
The 8051 microcontroller is a popular and widely used 8-bit microcontroller. It is packed with 128Kb of RAM, 4Kb of ROM, 4 ports, 2 timers and 1 serial port all on a single chip.
How many pins are there in 8051 microcontroller?
8051 microcontroller has a 40-pin dual in-line package (DIP) configuration. This means it has 40 physical pins that can be connected to external components or devices.
What are the ports 3 pins of 8051?
Port 3 (P3) in the 8051 microcontroller consists of eight pins: P3.0 (RXD) and P3.1 (TXD) for serial communication, P3.2 (INT0) and P3.3 (INT1) for external interrupts, P3.4 (T0) and P3.5 (T1) for external timers/counters, and P3.6 (WR) and P3.7 (RD) for controlling external memory or peripherals. These pins serve various functions such as serial data transfer, interrupt handling, timer input, and interfacing with external devices, providing flexibility and expandability to the microcontroller system.