ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel

All About 8051 based Microcontroller for Projects

Updated on July 18, 2011

8051 Microcontroller BASICS based Projects

When you start to learn about microcontrollers you need to start from the basic model. The 8051 microcontroller is first of the 8-bit microcontroller designed by Intel. It was optimized for 8-bit math and single bit Boolean operations. Its family MCS-51 includes, 8031, 8051 and 8751 microcontrollers. Each of them varies in their internal memory, timer and interrupts configuration. To quote an application, 8051 microprocessors can be used to drive small motor with very high precision and control; this cannot be done by any manual arrangements. Such accuracy is very essential from laser surgery to rocket launching.There are lots of 8051 Microcontoller Kits for projects availabel online, you can choose and decide to do one of them for better experience.

Difference between 8051 Microcontroller and Microprocessor

  • Microprocessor contains ALU, general purpose registers, stack pointer, program counter, and clock timing circuit and interrupt circuit. But microcontrollers contain the circuitry of microprocessor and in addition it has built-in ROM, RAM, I/O devices, timers and counters.
  • Microcontrollers have separate memory map for data and code. Whereas, microprocessor has single memory map for data and code.
  • The Microprocessor based system requires more hardware but for microcontrollers most of the necessary things are come as built-in.

8051 Microcontroller Pins

The 8051 microcontroller is packaged in a 40-pin DIP. For microcontrollers it is important to notice that many pins are used for more than one function.

Central Processing Unit of 8051 Microcontroller

The CPU of 8051 consists of eight-bit Arithmetic and logic unit with associated registers like A, B, PSW, SP, the sixteen bit program counter and “Data Pointer” (DPTR) registers. Along with these registers it has a set of special function registers.

The 8051’s ALU can perform addition, subtraction, multiplication and division. The logic unit can perform logical operations such as AND, OR and Exclusive-OR, as well as rotate, clear, and complement. The ALU also looks after the branching decisions. An important unique feature of 8051 architecture is that the ALU can also manipulator one bit as eight-bit data types. Individual bits may be set, cleared, complemented, moved, tested, and used in logic computation.

On Chip Data Memory and Program Memory of 8051 microcontroller

The 8051 microcontroller has 128-byte internal RAM. It is accessed using RAM address register. The internal RAM is organized into three distinct areas:

  • Working Registers
  • Bit Addressable
  • General Purpose

The 8051 Microcontroller has 4 Kbyte of internal ROM with address space from 0000H to 0FFFH. It is programmed by manufacturer when the chip is built. This part cannot be erased or altered after fabrication .This is used to store final version of the program.

It is accessed using program address register. The program addresses higher than 0FFFH, which exceed the internal ROM capacity will cause the 8051 automatically fetch code bytes from external program memory. However, code bytes can also be fetched exclusively from an external memory addresses 000H to FFFFH, by connecting the external aces pin to ground.

8051 Microcontroller Input Output Ports

The 8051 Microcontroller has 32 I/O pins configured as four eight-bit parallels ports. All four ports are bidirectional, i.e. each pin will be configured as input or output under software control. Each port consists of a latch, an output driver, and an input buffer.

The output drives of Ports 0 and 2 and the input buffers of Port 0 , are used in access to external memory address, time multiplexed with the data being written or read, and Port 2 outputs the high order byte of the external memory address when the address is 16 bits wide. Otherwise Port 2 gives the contents of special function register P2.All port pins of port 3 are multifunctional. They have other special funcitions.These are the port descriptions of 8051 microcontroller.

8051 Microcontroller Register Set

  • Register A

It is an 8-bit register. It holds a source operand and receives the result of the arithmetic instructions . The accumulator can be the source or destination for logical operations and a number of special data movement instructions.

  • Register B

In addition to accumulator, an 8-bit B-register is available and as a general purpose register when it is not being used for the hardware multiply/divide operation. Apart from these two the 8051 Microcontroller also has other register such as Program Status Word, Stack and Stack Pointer, Data Pointer, Program Counter and special function registers.

8051 Microcontroller Interrupts

An interrupt request is an instance when the microcontroller is requested to suspend its present activities in order to handle and unexpected situation. The 8051 has five interrupts

  • External hardware interrupts 0
  • Timer 0 interrupt
  • External hardware interrupts 1
  • Timer 1 interrupt
  • Serial communication interrupt

Well, this is an overview about the 8051 Microcontroller it has much more in-depth specifications which you could dig up from any related books if you want to go deeper into the world of microcontrollers.

More Microcontroller Resources...


    0 of 8192 characters used
    Post Comment

    • royaldsouza1 profile image

      royaldsouza1 6 years ago

      nice one

    • profile image

      Microcontroller projects 6 years ago

      Thanks for sharing this , very useful to juniors, keep going...

    • profile image

      Tushar 7 years ago

      It is very helpful for the basic cocepts about microcontroller

    • profile image

      anuja 7 years ago

      its good to have abbreviated data...helps to remember important points

    • Sky321 profile image

      Sky321 7 years ago from Canada

      Great hub, there is still lot's of stuff that I don't know.