Microcontrollers like 8051 are the soul and heart of an embedded system. They are the component of an embedded system which fetch the instructions and execute them. Microcontrollers take the inputs for a system, and process the outputs. This chapter is designed to make you introduced to 8051 Microcontroller and it's properties like pin configurations and how it works.
In year 1980, Intel introduced a powerful 8051 microntroller of 8-bits. They are the second generation of 8 bits microntrollers. The 8051 microntrollers are used for a variety of applications involving calculations and controlling. The 8051 microntroller are use for industrial controls as well as induction in home electronics, wearables and IOT (Internet Of Things) supported devices.
The 8051 Microcontroller is a general purpose Microcontroller. Though it is more than 50 years old, the 8051 microcontroller is still heavily used in a number of electronic and electrical devices. Moreover various industries such as automobile, mobile communications, defense, aeronautics, and even healthcare, would be inefficient without this small but powerful component. So now you must be wondering, what are the qualities of the 8051 Microcontroller that makes it so irresistible to these gadgets and industries.
The 8051 microntroller is very popular because of it's properties and functionalites. 8051 microntroller is easy to integrate into any electronic device, it's affordable at low price, it requires just a little power to operate, it has an easy instruction set, lastly it has a simple architecture.
Block diagram of 8051 microntroller.
Pin configurations of 8051 microntroller.
The 8051 Microcontroller is a 40-pin Plastic Dual Inline Package (PDIP). The functions of the pins of this Microcontroller are as follows :
Port 0 –
The Port 0 or P0 is a General Purpose I/O Port. Consequently, it consists of 8 pins starting from pin 32 to pin 39. However, this port can also be utilized as a multiplexed Address and Data bus (from AD0 to AD7).
Port 1 –
The Port 1 or P1, is also an 8-bit port starting from pin 1 to pin 8. Although similar to the P0, the P1 is also a General Purpose I/O Port, however, unlike the other three ports, P1 does not serve any dual purpose. Hence the sole purpose of P1 is for interfacing.
Port 2 –
The pins from 21 to 28 belong to the Port 2, or P2. Now when there is no presence of an external memory, the P2 act as a General Purpose I/O Port. However, in the presence of external memory, P2 acts as an Address Bus, starting from A8 to A15.
Port 3 –
Though the Port 3 or P3 usually acts as a normal I/O Port, it can provide some other functions as well. The pin numbers are from 10 to 17. The other functions are below.
- Pin10 – RXD
- Pin11 – TXD
- Pin12 – INT0 complement
- Pin13 – INT1
- Pin14 – T0
- Pin15 – T1
- Pin16 – WR
- Pin17 – RD complement
Additionally, the other pins are as follows –
- Pin20 – GND (Ground)
- Pin40 – VCC (Supply)
- Pin9 – RST (Reset)
- Pin18 – XTAL1 (Oscillator)
- Pin19 – XTAL2 (Oscillator)
- Pin29 – PSEN (Program Store Enable)
- Pin30 – ALE (Address Latch Enable)
- Pin31 – EA (External Access)
Feutures of 8051 microntroller.
The 8051 microcontroller is an 8-bit Microcontroller. what does this imply? This signifies that the width of the data bus is 8-bits. The data bus is utilized to carry data from specific operations. Consequently, the CPU can process 8 bits of data at one time.
Memory.
A Microcontroller needs program memory to store program/instructions to perform defined tasks. This memory is termed as ROM. Furthermore the Microcontroller also requires data memory to store the operands/data on a temporary basis. This memory is known as RAM. The 8051 Microcontroller is built with 4 Kb on-chip Read Only Memory (ROM) and 128 bytes Random Access Memory (RAM).
Address Bus.
A bus of the Microcontroller can be defined as a group of wire which can act as a medium for the transfer of data. There are two buses present in the 8051 Microcontroller. While we are already aware of the Data Bus, let us know about the Address Bus of the 8051 Microcontroller. The address bus, which is used to address memory locations, is 16-bit wide. Furthermore, the address bus can also be used to transfer data from the CPU (Central Processing Unit) to the memory. Hence, for obvious reasons the address bus is unidirectional.
Interrupts.
The most powerful attribute of the 8051 Microcontroller is the concept of Interrupts. The interrupt is a mechanism to –
- Temporarily suspend the ongoing program,
- Pass the control to a subroutine,
- Execute the subroutine,
- Resume the ongoing/main program.
Interrupts can be of various types, such as, Software and Hardware interrupts, Non-maskable and maskable interrupts, etc. Now the 8051 Microcontroller incorporates five interrupts. These are :
- INT0 – External Hardware Interrupt.
- TF0 – Timer 0 Overflow Interrupt.
- INT1 – External Hardware Interrupt.
- TF1 – Timer 1 Overflow Interrupt.
- R1/T1 – Serial communication Interrupt.
Input/Output Ports.
The 8051 Microcontroller needs to be connected to the peripheral devices in order to control their operations. The I/O Ports are responsible for the connection of the Microcontroller to its peripheral devices. There are total Four 8-bit Input/Output Ports present in this Microcontroller.
Additionally, these are some important features of 8051 microcontroller given as follows :
- Two 16-bit Timers and Counters.
- A Data Pointer and a Program Counter of 16-bit each.
- 128 User defined Flags.
- Four Register banks.
- 31 General Purpose Registers which are of 8-bit each