Professional Documents
Culture Documents
8051 Microcontroller Architecture
8051 Microcontroller Architecture
Features of 8051:
The main features of the 8051 microcontroller architecture include the following.
8-bit CPU through two Registers A & B.
4K Bytes – Internal ROM.
128Bytes – Internal RAM from 00H to 7FH.
It is separated into 3-parts
1) 32 Bytes of 4-Register Banks (R0, R1, R2, R3).
2) 16 Bytes of Bit-addressable Memory.
3) 80 Bytes of General-purpose Memory.
There exists Special Function Registers (SFRs) from address 80H to FFH.
These registers control various peripherals such as Serial Port, Timers, all I/O Ports, etc.
Control Registers like PCON, SCON, TMOD, TCON, IE, and IP.
It has 5-Interrupts (External-2 & Internal-3)
Oscillator & CLK Circuit.
16-bit Timers or Counters -2 like T0 & T1.
16-bit Program Counter &16-bit DPTR (Data Pointer).
It consists of four 8-bit I/O ports (P0, P1, P2, and P3).
8-bit Stack Pointer (SP) & 8-bit PSW (Processor Status Word).
Serial Data Tx & Rx for Full-Duplex Operation
Registers:
Registers are used to store data.
The 8051microcontroller has 8-bit registers (D0 to D7).
An accumulator is mainly used to execute arithmetic & logic instructions.
Registers like B, R0 toR7 are used for storing instruction addresses & data.
Data Pointers (DPTR) is a 16-bit register used to store the address of RAM.
Program counter (PC) is a 16-bit register used to store the address of ROM.
a) It is used to store the address of the next instruction to be performed.
Memory
The memories of the 8051 microcontroller consists of a program memory and data memory.
The instructions of the CPU are stored in the Program Memory. It is usually implemented
as Read-Only Memory or ROM.
Data Memory is used for storing values of variables, temporary data, intermediate results,
and other data for the proper operation of the program.
Oscillator:
As the Microcontroller is a digital circuit, it needs a timer for its function.
Thus 8051Microcontroller consists of an on-chip oscillator.
I/O Ports:
To connect Peripherals, we need I/O (input/output) interfacing ports.
IC 8051 consists of 4 input/output ports to connect it with other peripherals.
Timers/Counters:
In Intel 8051, there are two 16-bit timer registers. These registers are known as Timer-0
and Timer-1.
The timer registers can be used in two modes. These modes are Timer mode and the
Counter mode.
The only difference between these two modes is the source for incrementing the timer
registers.
Timer Mode:
In the timer mode, the internal machine cycles are counted. So this register is
incremented in each machine cycle. So when the clock frequency is 12MHz, then the timer
register is incremented in each millisecond.
Counter Mode:
In the counter mode, the external events are counted.
In this mode, the timer register is incremented for each 1 to 0 transition of the external
input pin. This type of transitions is treated as events.
There is a register called TMOD Register. This register can be programmed to
configure these timers or counters.
TMOD Register (Timer Mode Register):
TMOD (Timer Mode) is an 8-bit Register.
It is a SFR with address 89H.
GAT C/T M1 M0 GAT C/T M1 M0
E E
Timer-1 Timer-0
-The upper 4-bits store TR, TF bits of Timer-0,1. (TR=Timer Run bit, TF= Timer Flag bit).
-The Lower 4-bits store IE, IT bits of Timer-0,1.(IE= Interrupt Enable bit, IT= Interrupt Flag
bit).
-Timer Run bit(TR) is used to ON/OFF the Timer.
Ex: SETB TR0 or SETB TCON.4
CLR TR0 CLR TCON.4
Types of Interrupts:
The interrupts of the 8051 microcontrollers are:
TF0 (Timer 0 Overflow Interrupt)
TF1 (Timer 1 Overflow Interrupt)
INT0 (External Hardware Interrupt)
INT1 (External Hardware Interrupt)
RI/TI (Serial Communication Interrupt)
Some of the applications of 8051 is mainly used in daily life & industrial applications also some
of that applications are shown below
Light sensing and controlling devices
Temperature sensing and controlling devices
Fire detections and safety devices
Automobile applications
Defense applications
Some industrial applications of micro controller and its applications
Industrial instrumentation devices
Process control devices
Some of 8051 microcontroller devices are used in measurement applications
Voltmeter applications
Measuring and revolving objects
Current meter objects
Hand held metering system.
6. The cost of the entire system is low. Cost of the entire system is high.
7. Since external components are low, total Due to external components, the entire
power consumption is less and can be power consumption is high. Hence it is
used with devices running on batteries. not suitable to run on batteries.
10. Microcontrollers are based on Harvard Microprocessors are based on the von
architecture where program memory and Neumann model/architecture where
Data memory are separate programs and data are stored in the same
memory module
11. Used mainly in washing machines, MP3 Mainly used in personal computers
players