0% found this document useful (0 votes)
6 views

Microcontroller 8051 Architecture

The 8051 Microcontroller, designed by Intel in the 1980s, is an 8-bit microcontroller based on Harvard Architecture, primarily used in embedded systems. It integrates various on-chip peripherals including CPU, RAM, ROM, and I/O ports, allowing it to function as a microcomputer. The architecture includes components like the ALU, accumulator, program status word, and control registers, facilitating efficient data processing and communication with external devices.

Uploaded by

suchityadav1500
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Microcontroller 8051 Architecture

The 8051 Microcontroller, designed by Intel in the 1980s, is an 8-bit microcontroller based on Harvard Architecture, primarily used in embedded systems. It integrates various on-chip peripherals including CPU, RAM, ROM, and I/O ports, allowing it to function as a microcomputer. The architecture includes components like the ALU, accumulator, program status word, and control registers, facilitating efficient data processing and communication with external devices.

Uploaded by

suchityadav1500
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

8051 Microcontroller Architecture

The 8051 Microcontroller is one of the basic types of microcontroller, designed by Intel in 1980’s. This
microcontroller was based on Harvard Architecture and developed primarily for use in embedded
systems technology. Normally, this microcontroller was developed using NMOS technology, which
requires more power to operate. Therefore, Intel redesigned Microcontroller 8051 using CMOS
technology and their updated versions came with a letter C in their name, for instance an 80C51 it is
an 8 bit microcontroller. These latest Microcontrollers require less power to operate as compared to
their previous versions.

In the process of dealing with the 8051 Microcontroller Architecture, we will see the hardware aspects
of the 8051 microcontroller like I/O PORTS, RAM, ROM, Timers and Serial Port etc.

The difference between a Microprocessor and a Microcontroller is the availability of the on – chip
peripherals like Memory (both RAM and ROM), I/O Ports, Timers / Counters, Communication
Interfaces (like Serial Port), etc. As all the components (and a few other components) are integrated
on a single chip (Integrated Circuit – IC), a Microcontroller can be considered as a Microcomputer (or
a Computer on – chip).

The 8051 Microcontroller is an 8 – bit Microcontroller i.e. it can read, write and process 8 – bit Data.
There are a bunch of manufacturers like Atmel, NXP, TI, who manufacture their own versions of 8051
Microcontroller. Irrespective of the manufacturer, the internal hardware design i.e. the 8051
Microcontroller Architecture remains more or less the same. The following image shows the 8051
Microcontroller Architecture in a block diagram style.

The block diagram of the 8051 Microcontroller Architecture shows that 8051 Microcontroller consists
of a CPU, RAM (SFRs and Data Memory), Flash (EEPROM), I/O Ports and control logic for
communication between the peripherals.

All these different peripherals inside the 8051 Microcontroller will communicate with each other via
the 8 – bit Data Bus, also known as the internal data bus.
CPU (Central Processing Unit)

ALU:

It performs the arithmetic operations such as addition, subtraction, multiplication and division. The
unit can perform logical operations such as AND, OR; and Exclusive-OR, as well as rotate, clear, and
complement. The ALU can also manipulate one bit as well as eight-bit data types. Individual bits may
be set, cleared, complemented, tested, and used in logic computation.

Accumulator:

It is bit addressable. ACC.2 states the bit 2 of ACC register. The accumulator may be referred as
specified in the instruction by its SFR address 0E0H. Accumulator is commonly used for data transfer
and arithmetic instructions.

B Register:

It is used during multiply and divide operations. After multiplication and division, part of the result such
as upper-8-bits of multiplication result and remainder in case of division are stored in B register. It can
also be accessed through its SFR address 0F0H. It is also bit addressable.

Program Status Word (PSW):

The program status word (PSW) register is an 8-bit register. It is also referred to as the flag
register. Although the PSW register is 8 bits wide, only 6 bits of it are used by the 8051.The two
unused bits are user-definable flags. Four of the flags are called conditional flags, meaning that they
indicate some conditions that result after an instruction is executed. These four are CY (carry), AC
(auxiliary carry), P (parity), and OV (overflow).As seen from below figure, the bits PSW.3 and PSW.4
are designated as RS0 and RS1 as register selection bit, respectively, and are used to change the
bank registers. The PSW.5 and PSW.1 bits are general-purpose status flag bits and can be used by
the programmer for any purpose. In other words, they are user definable. See below Figure for the
bits of the PSW register.

CY, the carry flag

• This flag is set whenever there is a carry out from the D7 bit.
• This flag bit is affected after an 8-bit addition or subtraction.
• It can also be set to 1 or 0 directly by an instruction such as “SETB C” and “CLR C” where
“SETB C” stands for “set bit carry” and “CLR C” for “clear carry”.

AC, the auxiliary carry flag

• If there is a carry from D3 to D4 during an ADD or SUB operation, this bit is set; otherwise, it is
cleared.
• This flag is used by instructions that perform BCD (binary coded decimal) arithmetic.

P, the parity flag

• The parity flag reflects the number of 1 s in the A (accumulator) register only.
• If the A register contains an odd number of Is, then P = 1. Therefore, P = 0 if A has an even
number of 1s.

OV, the overflow flag

• This flag is set whenever the result of a signed number operation is too large, causing the high-
order bit to overflow into the sign bit.
• In general, the carry flag is used to detect errors in unsigned arithmetic operations.
• The overflow flag is only used to detect errors in signed arithmetic operations

Stack Pointer (SP):

SP is an 8-bit register. The 8-bit address of the stack top is stored in this register. The stack can be
located anywhere in the on-chip 128-bytes RAM. Initially, the stack pointer is initialized to 07H after
reset operation. Hence the stack begins at location 08H. The stack can be relocated by setting SP to
the upper memory area in 30H to 7FH.

Data Pointer (DPTR):

DPTR is 16-bit register. It consists of a higher byte (DPH) and a lower byte (DPL) of a 16-bit external
data RAM address. It has been given two addresses in the SFR. DPTR is very useful for string
operations and look-up table operations. There is no such instruction in 8051 to decrement the DPTR.

Program Counter (PC):

It is a 16 bit register. PC is used, as address pointer to access program instructions and it is


automatically incremented after every byte of instruction fetch.

Input and Output Port Latches and Drivers

Each latch and corresponding driver of port0-3 is allotted to the corresponding on-chip i/o port. The
addresses of latches are stored in the SFR. Using these addresses, port0-3 can be communicated
with other ICs. The first bit of port has the same address as the register port address of P1 is 90H.
So, the address of P1.0 is 90H and the address of P1.7 is 97H.
I/O Ports or Input / Output Ports provide the microcontroller, a physical connection to the outside
world. Input Ports provide a gateway for passing on the data from the outside world with the help of
sensors.

The data from the input ports is manipulated (depending on the application) and will determine the
data on the output port.

Output Ports allow microcontroller to control external devices (like motors and LEDs). Generally, all
ports in microcontrollers have dual functionality i.e. they can act as both input and output port (not at
the same time though).

Instruction Register (IR) & Timing and Control Unit


The controller will fetch the instructions one by one, starting from the address stored in PC and store
in IR, which decodes the instructions and give information to timing and control unit. Using the
information supplied by the IR unit the control signals necessary for internal and external operations
are generated by the timing and control unit.

The timing and control unit generates ALE, PSEN (active low), RD (active low) and WR (active low).

Timing Registers

There are two 16-bit timing registers in 8051. These can be accessed as lower and upper bytes, for
timing register0, THO & TL0 and timing register1, TH1 & TL1. All timing registers can be accessed by
using the four different addresses allotted to them. The operation of timing registers may be timing or
counting.

Control Registers
Control Registers consist of SFR such as Interrupt Priority (IP), Interrupt Enable (IE), Timer Mode
(TMOD), Timer Control (TCON), Serial Port Control (SCON) and Power Control (PCON). All have
allotted addresses in SFR.

Serial Port Data Buffer

Internally, it consists of two independent registers such as transmit buffer and receive buffer at the
same location. The transmit buffer is PISO register and receive buffer is SIPO register. The serial
data buffer is identified as SBUF. If data is moved to SBUF, it goes to transmit buffer and when data
is moved from SBUF, it receives serial data from the receive buffer.

Program Memory

The instructions of the CPU are stored in the Program Memory. It is usually implemented as Read
Only Memory or ROM, where the Program written in to it will be retained even when the power is
down or the system is reset.

Modern Program Memory Modules are generally made up of EEPROM (Electrically Erasable
Programmable Read – only Memory), which is a type of non – volatile memory.
In this type of memory, the data can be erased and reprogrammed using special programming
signals.

When the microcontroller is powered on or manually reset, the processor executes a set of
instructions from a pre-defined memory location (address) in the Program Memory.

4KB of program instructions can be stored in the internal memory of 8051. The Program Memory can
be increased to 64KB.

Data Memory

Data Memory in a Microcontroller is responsible for storing values of variables, temporary data,
intermediate results and other data for proper operation of the program.

Data Memory is often called as RAM (Random Access Memory), which is a type of volatile memory. It
is generally organized as registers and includes both Special Function Registers (SFRs) and user
accessible memory locations.

The 8051 includes 128Bytes of Data Memory that are accessible directly by the instructions. A 32
Bytes segment of this 128 Bytes memory block is bit addressable by a subset of 8051 instructions
(bit-instructions). The 8051 can address up to 64KB of external Data Memory.

Clock Generator (Oscillator)

A clock signal allows the operations inside the microcontroller and other parts to be synchronous. A
Clock Generator is an integral part of the Microcontroller’s Architecture and the user has to provide an
additional Timing Circuit in the form of a Crystal.

Other Registers

Program Address Register-> It is used to generate addresses of on-chip EPROM internally.

RAM Address Register-> It is used to generate addresses of on-chip RAM internally.

Temporary Registers TMP1 and TMP2-> These are used to hold operands. These cannot be
accessed by user.

Special Function Register (SFR) -> It is a set of registers which can be addressed using their
respective addresses in the range of 80H to FFH.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy