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

Architecture of 8051 Microcontroller

Architecture of 8051 Microcontroller

Uploaded by

MG Shivanand
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)
77 views

Architecture of 8051 Microcontroller

Architecture of 8051 Microcontroller

Uploaded by

MG Shivanand
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/ 9

4.

1 ARCHITECTURE OF 8051
What is Microcontroller and history of Microcontroller

A microcontroller is a compact computer integrated onto a single chip, designed to control specific tasks
within electronic devices. It consists of a processor (CPU), memory (both temporary RAM and permanent
ROM), and input/output ports for communication with external components like sensors, motors, and
displays. Unlike general-purpose computers, microcontrollers are optimized for embedded systems,
meaning they are embedded inside other devices to manage their operations. These tiny controllers are
found in countless applications, from home appliances to automobiles, where they manage functions based
on input signals.

The history of microcontrollers dates back to the 1960s when integrated circuits (ICs) were first developed,
laying the groundwork for combining different components into a single chip. The first significant step
came in 1971 with Intel’s release of the Intel 4004 microprocessor, though it was a microprocessor rather
than a true microcontroller. The true breakthrough came in 1974 when Texas Instruments introduced the
TMS1000, the first microcontroller, which included a CPU, memory, and I/O control on one chip, initially
used in calculators.

INTRODUCTION TO 8051

The **8051 microcontroller**, introduced by Intel in 1980, is one of the most significant and influential
microcontrollers in the field of embedded systems. It was designed as a highly efficient and versatile device,
intended for controlling a wide range of electronic applications. Over the years, the 8051 became a standard
in the microcontroller industry due to its reliable architecture and widespread use in both academic and
industrial settings. Its architecture set the foundation for many modern microcontrollers, and it has been
adopted by various manufacturers, resulting in a wide range of compatible devices. The 8051 is well-known
for its simplicity, which makes it a great starting point for learning microcontroller programming, while
also being powerful enough for real-world applications. Despite the introduction of more advanced
microcontrollers, the 8051 remains a popular choice in embedded systems education and certain legacy
systems.
Features of 8051:
• 8-bit ALU, Accumulator, 8-bit Registers and 8-bit data bus; hence it isan 8-bit
microcontroller
• 16-bit program counter
• 8-bit Processor Status Word(PSW)
• 8-bit Stack Pointer
• Internal RAM of128bytes
• On chip ROM is4KB
• Special Function Registers (SFRs) of 128bytes
• 32 I/O pins arranged as four 8-bit ports (P0 -P3)
• Two 16-bit timer/counters : T0 andT1
• Two external and three internal vectored interrupts
• Full duplex UART (serialport)

BLOCK DIAGRAM

Figure 4.1.1 8051 Microcontroller Block Diagram


[Source: “The 8051Microcontroller and Embedded Systems: Using Assembly and C” by Mohamed Ali
Mazidi, Janice Gillispie Mazidi, Rolin McKinlay, pg.no.29]
CPU (Central Processing Unit): CPU act as a mind of any processing machine. It synchronizes and
manages all processes that are carried out in microcontroller. User has no power to control the functioning
of CPU. It interprets the program stored in ROM and carries out from storage and then performs it
projected duty. CPU manage the different types of registers available in 8051 microcontrollers.

Interrupts: Interrupts is a sub-routine call that given by the microcontroller when some other program
with high priority is request for acquiring the system buses the n interrupts occur in current running
program.

Memory: For operation Micro-controller required a program. This program guides the microcontroller to
perform the specific tasks. This program installed in microcontroller required some on chip memory for
the storage of the program.

Microcontroller also required memory for storage of data and operands for the short duration. In
microcontroller 8051 there is code or program memory of 4 KB that is it has 4 KB ROM and it also
comprise of data memory (RAM) of 128 bytes.

Bus: Bus is a group of wires which uses as a communication canal or acts as means of data transfer. The
different bus configuration includes 8, 16 or more cables. Therefore, a bus can bear 8 bits, 16 bits all
together.
Oscillator: As the microcontroller is digital circuit therefore it needs timer for their operation. To perform
timer operation inside microcontroller it required externally connected or on-chip oscillator.
Microcontroller is used inside an embedded system for managing the function of devices. Therefore, 8051
uses the two 16-bit counters and timers. For the operation of this timers and counters the oscillator is used
inside microcontroller.

I/O Ports:
The 8051 microcontroller has four I/O ports labelled P0, P1, P2, and P3. Each port is 8 bits wide, which
means each port has 8 pins that can be individually controlled as either input or output. These ports allow
the microcontroller to communicate with external peripherals.

Serial Port:
The 8051 has a serial communication interface, known as the UART (Universal Asynchronous
Receiver/Transmitter). This allows the microcontroller to communicate with other devices using serial
communication protocols, making it ideal for exchanging data with devices like computers, modems, and
other microcontrollers.
• TXD (Transmit Data - P3.1): This pin is used for sending data serially from the 8051 to another
device.
• RXD (Receive Data - P3.0): This pin is used for receiving data serially into the 8051 from another
device.
INTERNAL MEMORY OF 8051
The internal memory of 8051 is of 2 types –
1. Internal ROM (Program Memory)
• 8051 has 4 kB internal Read Only Memory.
• It mainly contains some executable functions and some data which may never change.
• Address range is 0000H to FFFFH.
• EA (bar) is used to allow usage of Internal ROM or not.
2. Internal RAM (Data Memory)
• 8051 has 128 B internal Random Access Memory.
• Data Memory is used for temporarily storing data and intermediate results created and used
during the operation of the microcontroller.
• It mainly contains register banks , Read/write data, bit addressable registers and stack.
• Address range is 0000H to FFFFH.
• PSEN(bar) is used to allow usage of Internal ROM or not.
INTERNAL ARCHITECTURE OF 8051 MICROCONTROLLER

Figure 4.1.4 8051 Architecture Block diagram


[Source: “The 8051Microcontroller and Embedded Systems: Using Assembly and C” by Mohamed Ali
Mazidi, Janice Gillispie Mazidi, Rolin McKinlay , pg.no.29]

The Internal architecture is shown in Figure 4.1.4 and the various Registers andunits are
described below.
Accumulator (Acc):
The accumulator in a microcontroller, is a special register used to store intermediate results during
arithmetic and logic operations. It plays a central role in most calculations, as the results of operations are
usually stored in the accumulator for further processing or output.

B Register:
Used to store one of the operands for multiplication and division, otherwise,scratch pad considered
as an SFR.

Stack Pointer (SP):


8-bit wide register. Incremented before data is stored on to the stack using PUSHor CALL instructions.
Stack defined anywhere on the 128-byte RAM.

Data Pointer (DPTR):


16-bit register contains DPH and DPL Pointer to external RAM address. DPH andDPL allotted separate
addresses in SFR bank

Program Status Word (PSW):


Set of flags contains status information as detailed below in the Figure 4.1.3.

Figure 4.1.3 Bits of PSW Register


[Source: “The 8051Microcontroller and Embedded Systems: Using Assembly and C” by Mohamed Ali
Mazidi, Janice Gillispie Mazidi, Rolin McKinlay , pg.no.52]
Serial Data Buffer:
Internally had TWO independent registers, TRANSMIT buffer (parallel in serialout – PISO) and
RECEIVE buffer (serial in parallel out –SIPO) identified by SBUF and allotted an address in SFR.

Timer Registers:
for Timer0 (16- b i t register – TL0 & TH0) and for Timer1 (16- b i t register – TL1 & TH1) four
addresses allotted in SFR.

Control Registers: Control registers are IP, IE, TMOD, TCON, SCON, and PCON. These registers
contain control and status information for interrupts, timers/counters andserial port. Allotted separate
address in SFR.

Instruction Register: Decodes the opcode and gives information to timing and controlunit.

Timing and Control Unit: This unit derives necessary timing and control signals for internal circuit
and external system bus.

Oscillator: generates basic timing clock signal using crystal oscillator.

EPROM & program address Register: provide on chip EPROM and mechanism to address it. All
versions don’t have EPROM.

Ram & Ram Address Register: provide internal 128 bytes RAM and a mechanism to address internally

ALU: Performs 8 bit arithmetic and logical operations over the operands held by TEMP1and TEMP 2.
User cannot access temporary registers.

SFR Register Bank: set of special function registers address range: 80 H to FF H. Interrupt, serial port
and timer units’ control and perform specific functions under the control of timing and control unit.
8051 PIN CONFIGURATION
The pin diagram of 8051 microcontroller is shown in Figure 4.1.5 and the pindetails are
described below.

Figure 4.1.5 8051 Pin Configuration


[Source: “The 8051Microcontroller and Embedded Systems: Using Assembly and C” by Mohamed Ali
Mazidi, Janice Gillispie Mazidi, Rolin McKinlay , pg.no.94]

Pins 1 to 8 − these pins are known as Port 1. This port doesn’t serve any other functions.It is internally
pulled up, bi-directional I/O port.

Pin 9 − It is a RESET pin, which is used to reset the microcontroller to its initial values.

Pins 10 to 17 − These pins are known as Port 3. This port serves some alternate functionslike interrupts,
timer input, control signals, serial communication signals RxD and TxD,etc.
Figure 4.1.6 Port 3 Alternate Functions
[Source: “The 8051Microcontroller and Embedded Systems: Using Assembly and C” by Mohamed Ali
Mazidi, Janice Gillispie Mazidi, Rolin McKinlay , pg.no.97]

Pins 18 & 19 − These pins are used for interfacing an external crystal to get the systemclock.

Pin 20 − This pin provides the power supply to the circuit.

Pins 21 to 28 − These pins are known as Port 2. It serves as I/O port. Higher order addressbus signals are
also multiplexed using this port.

Pin 29 − This is PSEN pin which stands for Program Store Enable. It is used to read asignal from the
external program memory.

Pin 30 − This is EA pin which stands for External Access input. It is used toenable/disable the external
memory interfacing.

Pin 31 − This is ALE pin which stands for Address Latch Enable. It is used todemultiplex the
address-data signal of port.

Pins 32 to 39 − These pins are known as Port 0. It serves as I/O port. Lower order addressand data bus
signals are multiplexed using this port.

Pin 40 − This pin is used to provide power supply to the circuit.

You might also like