0% found this document useful (0 votes)
9 views14 pages

8051 Microcontroller Architecture Overview

Uploaded by

Sruthi Santhosh
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)
9 views14 pages

8051 Microcontroller Architecture Overview

Uploaded by

Sruthi Santhosh
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

MODULE 4

● To make a complete microcomputer system, only a microprocessor is not sufficient.


To make a complete microcomputer system, adding other peripherals such as ROM,
RAM, decoders, drivers, and a number of I/O devices is necessary. In addition, special-
purpose devices, such as interrupt controllers, programmable timers, programmable I/O
devices, DMA controllers may be added to improve the capability and performance,
and flexibility of a microcomputer system.
● On the other hand, the microcontroller has built-in ROM, RAM, parallel I/O, serial
I/O, counters, and a clock circuit. It has on-chip peripheral devices which makes it
possible to have a single microcomputer system.
● A microcontroller does not require any additional interfacing ICs for operation and it
functions as a standalone system. The operation of a microcontroller is multipurpose.
Features of 8051
1. 4KB on-chip program memory (ROM/EPROM).
2. 128 bytes on-chip data memory.
3. Four register banks.
4. 64KB for each external ROM and external RAM addressability.
5. 32 bidirectional I/O lines organized as four 8-bit ports.
6. Multiple modes, high-speed programmable serial port (UART).
7. 16-bit Timers/Counters.
8. Direct byte and bit addressability.
• In the architecture of 8051 the system bus is connected to all the supporting devices
to CPU.
• The system bus consists of 8 bit data bus, 16 bit address bus and bus control signals.

1) CPU: The CPU is the brain of processing machine. It consists of following:

a. Accumulator: The accumulator register (ACC or A) acts as an operand register, in


case of some instructions. General register to accumulate the results of large
number of instructions. 1 byte value.
b. B Register: This register is used to store one of the operands for multiply and divide
instructions. In addition to this it can be used for temporary storage,

d. Stack Pointer: It is 18 bits wide. It is incremented before data is stored during


PUSH or CALL executions.
e. Data Pointer: 16 bit register that holds the external data memory address of the
data fetched. It consist of high byte (DPH) and low byte (DPL).
f. Program Counter: 2 Byte address that tells 8051 where the next instruction to
execute is found in memory.
g. Instruction Register: This register decodes the opcode of an instruction to be
executed and gives information to the timing and control unit to generate necessary
control signals for the execution of the instruction.
h. Timing and Control Unit: Derives all timing and control signals required for
internal operation of the chip. It has control signals for controlling external system
bus.

2) Input/ output ports (P0-P3): The i/p, o/p port provide a microcontroller a
physical connection to outside world. It provides a gateway for passing data from
the outside with the help of sensors. The output ports allow to control external
devices. (1- input port, 0- output port)

3) Serial Ports: The serial data buffer internally contains two independent registers.
One of them is a transmit buffer, The other is called receive buffer.

4) Timer Registers: Register pairs (TH0, TL0), and (TH1, TL1) are the 16-bit
Counting registers for Timer/Counters 0 and 1, respectively.

5) Control Registers: Special Function Registers IP (Interrupt priority), IE (Interrupt


enable), TMOD (Timer Mode), TCON (Timer Control), SCON (serial Control)
and PCON (power Control) contain control and status bits for the interrupt system,
the Timer/Counters, and the serial port.

6) Register Banks: 4 register banks in total. The 8051 uses 8 "R" registers which are
used in many of its instructions. These "R" registers are numbered from 0 through
7 (R0, R1, R2, R3, R4, R5, R6, and R7). These registers are generally used to
assist in manipulating values and moving data from one memory location to
another.
REGISTER ORGANIZATION IN 8051

• 8051 has two 8-bit registers, registers A and B, which can be used to store operands, as
allowed by the instruction set.
• Internal temporary registers of 8051 are not user accessible. Including these A and B
registers, 8051 has a family of special purpose registers known as, Special Function
Registers (SFRs).
• There are, in total, 21-bit addressable, 8-bit registers.
• ACC (A), B, PSW, PO, P1, P2, P3, IP, IE, TCON and SCON are all 8-bit, bit addressable
registers.
• The remaining registers, namely, SP, DPH, DPL, TMOD, THO, TLO, TH1, TL1, SBUF
and PCON registers are to be addressed as bytes, i.e. they are not bit-addressable.
• The registers DPH and DPL are the higher and lower bytes of a 16-bit register DPTR,
i.e. data pointer, which is used for accessing external data memory.
• The 32, 8-bit registers are divided into four groups of 8 registers each, called register
banks. At a time only one of these four groups, i.e. banks can be accessed.
• The register bank to be accessed can be selected using the RS1 and RSO bits of an internal
register called program status word.
• The registers THO and TLO form a 16-bit counter/timer register with H indicating the
upper byte and L indicating the lower byte of the 16-bit timer register T0.
• Similarly, TH1 and TL1 form the 16-bit count for the timer T1.
• P0, P1, P2, P3: The four port latches are represented by PO, P1, P2 and P3. Any
communication with these ports is established using the SFR addresses to these registers.
• SP: Register SP is a stack pointer register.
• PSW: Register PSW is a flag register and contains status information.
• IP: Register IP can be programmed to control the interrupt priority.
• IE: Register IE can be programmed to control interrupts, i.e. enable or disable the
interrupts.
• TCON: TCON is called timer/ counter control register. Some of the bits of this register
are used to turn the timers on or off. This register also contains interrupt control flags for
external interrupts INT; and INT.
• TMOD: The register TMOD is used for programming the modes of operation of the
timers/counters.
• SCON: The SCON register is a serial port mode control register and is used to control
the operation of the serial port.
• SBUF: The SBUF register acts as a serial data buffer for transmit and receive operations.
• PCON: The PCON register is called power control register. This register contains power
down bit and idle bit which activate the power down mode and idle mode.

MEMORY ADDRESSING IN 8051

● The 8051 has two types of memory and these are Program Memory and Data Memory.
Program Memory (ROM) is used to permanently save the program being executed, while
Data Memory (RAM) is used for temporarily storing data and intermediate results created
and used during the operation of the microcontroller.
● All 8051 microcontrollers have a 16-bit addressing bus and are capable of addressing 64
kb memory.
1. PROGRAM MEMORY:
● Program Memory (ROM) is used for the permanent saving of the program
(CODE) being executed. The memory is read-only. It is further divided into internal (on-
chip) and external ROM.
● 8051 can address 4 kb of on-chip program memory from 0000H to 0FFFH.
● It can address 64 kb of external program memory from 0000H to FFFFH.
● Address mapping from 0000H to 0FFFH overlaps for internal and external
memory. They are distinguished using PSEN and EA.

2. DATA MEMORY:
● 8051 supports 64 kb of external data memory from 0000H to FFFFH. This memory can
be accessed under the control of the register DPTR.
● RD’, WR’, CS’ signals are used while accessing external data memory.

● Internal data memory consists of two parts.


○ Lower 128 bytes from 00H to 7FH
○ Upper 128 bytes from 80H to FFH

● Lower 128 bytes from 00H to 7FH:


○ Direct and indirect addressing modes possible
○ This memory space is divided into
1. register banks (00H-1FH)
2. bit-addressable RAM (20H-2FH)
3. general-purpose RAM (scratch-pad) (30H-7FH).
8051-INSTRUCTION SET
INTERRUPTS OF 8051

You might also like