Introduction to 8051 microcontroller
In this tutorial, you will clearly get to know about one of the important microcontroller 8051 and an introduction to 8051 microcontroller. It is one of the most powerful microcontrollers which is widely used in many applications. Here is a complete basic to the programming of 8051. The important function of any processor/controller is to execute a program. A program is a set of instructions. And those programs or instructions should be stored in a memory( RAM/ROM ). Click here for introduction to processors
|Random access memory
|Read only memory
|Data retention is dependent on power
|Data retention is independent of power
|Non – volatile memory
|Generally less in size( few KBs to MBs, now in GBs )
|Larger in size ( MBs to GBs, now few TBs )
|Also known as data memory ( stores present data )
|Also known as program memory.
Buses in 8051 Microcontroller:
As the name describes it is something that carries or transports. On the type of material carried, buses are of three types:
- Address bus
- Data bus
- Control bus
This bus provides the address of the selected location for data transfer.
This bus transfers the data, whether to send or receive data , this is decided by Control bus.
The above diagram is the overall block diagram of a computer.
- It requires a processor for logical and other operations.
- RAM for temporary data storage.
- ROM for permanent data storage.
- Input ports to take data ( e.g. keyboard ).
- Output ports for data output ( e.g. projector ).
As a part of introduction to 8051 microcontroller , Till now we have discussed a computer peripheral, which does computing for high end uses. Let us consider a washing machine that has a fixed program that runs by clicking a button ( input port ). So for such applications, huge computing is not required at all. Input and output ports get decreased. For less computing, a very small RAM is required. As a result, all these things ( processor, memory, I/O ports ) decreases.
As a result everything can be implemented on a single board. This board is a microcontroller. But there is an additional component here Timer. It is block diagram of 8051 microcontroller.
The purpose of using a timer is to produce delay. In simple terms timers are for timing applications. There are two types of timers . Read in detail about timers in 8051 by clicking here
- Hardware delay
- Software delay
In this type, an external chip ( timer ) is used by interfacing it with the processor. Processor sends a signal to it , when to start and when it is completed, the timer sends the signal back to it.
Here we don’t need any external chip. Here loops are for timing application, here this duty is performed by the processor.
There are also ways that enable power saving modes in 8051. Read here
As observed, It clearly shows software delay timers are better than hardware delay timers. Even though hardware delay timers are used everywhere instead of software delay timers. Because whenever a hardware timer is performing its duty, the processor is free to do other works, whereas, in software delay, the processor isn’t free to perform other works.
Suppose if software delays are used in applications ( washing machines ), the processor runs only a timer, which means the washing machine will run only a timer and once it’s completed it gives back the same unwashed clothes, as the processor was busy in performing delay actions only. This shows the importance of hardware delay timers.
Microprocessors are for high end applications ( computing ) and microprocessors are for appliances ( washing machine, remote, microwave oven…… ). 8051 microcontroller has 2 timers.
Serial and parallel communication :
Serial communication means sending bit by bit through a single channel. Parallel communication means sending data parallelly from multiple channels. Hence serial communication costs less, but parallel communication is faster. So for longer distances serial communication is preferred, and for shorter distances parallel communication.
Read this blog to understand architecture of 8051
- 8051 consists of an 8bit processor which means it can process 8bit data, it also can process 16bit or higher bit data, but then comes the issue of striking or hanging of devices.
- And 8051 contains 2 timers of 16 bit that can count from 0000 to FFFF ( hexadecimal code ), which is equivalent to 65,535.
- It’s ROM is 4096 bytes, which seems to be less but large enough for its applications.
- It has 4 I/O ports each consisting of 8 lines which are bit addressable ( bit addressable means each line of each port can be addressed individually ).
- 8051 has 1 serial port for serial communication.
- 8051 runs on 5V.
- 12Mhz operating frequency.
Hope you loved this interesting tutorial about introduction of 8051 microcontroller. Please feel free to ask your doubts, comment box is always open below. In the upcoming tutorial pin diagram of 8051 would be explained.
Also learn introduction to atmega328p