8051 Architecture and pin
configuration
Whereas the data bus carries actual data that is being processed, the control bus carries signals
that report the status of various devices. For example, one line of the bus is used to indicate
whether the CPU is currently reading from or writing to main memory
Important Points
multiplexed address data bus means that the same bus is used to carry data as well as address. when ALE
signal is active this multiplexed bus will contain address and if ALE is not active this bus will contain data.
It is output, active-low pin. This is used to read external
memory.
Central Processing Unit
Arithmetic and Logical Unit (ALU)
ALU performs arithmetic like addition, subtraction, multiplication and Logical Operations like NAND, NOR etc.
Since 8051 is an 8 bit microcontroller, it takes input from two 8 bit registers namely A and B and processes them.
Control Unit
It is used to control all the signals used to process various instructions between different input and output
peripherals.
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.
Interrupts provide a method to postpone or delay the current process, performs a sub-routine task and then
restart the standard program again.
Types of interrupt in 8051 Microcontroller:
Let's see the five sources of interrupts in 8051 Microcontroller:
•Timer 0 overflow interrupt - TF0
•Timer 1 overflow interrupt - TF1
•External hardware interrupt - INT0
•External hardware interrupt - INT1
•Serial communication interrupt - RI/TI
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.
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.
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.
Types of buses in 8051 Microcontroller:
Let's see the two types of bus used in 8051 microcontroller:
•Address Bus: 8051 microcontrollers is consisting of 16 bit address bus. It is generally be used for transferring the
data from Central Processing Unit to Memory.
•Data bus: 8051 microcontroller is consisting of 8 bits data bus. It is generally be used for transferring the data
from one peripherals position to other peripherals.
Timer
The main function of a timer is to make a delay otherwise time gap among two events. This microcontroller
includes two timers where each timer is 16-bit where the system can generate two delays concurrently to
produce the suitable delay. Generally, every microcontroller uses hardware delays where a physical device can
be used through the processor to generate the particular delay which is called a timer.
The delay can be generated through the timer based on the requirement of the processor & transmits the signal
to the processor whenever the particular delay gets generated.
By using this processor, we can also produce a delay based on the requirement of the system. However, this
will guide to remain the processor active all the time because it will not perform any other task in that specific
period. As a result, the existence of a timer within the microcontroller permits the processor to be free for
performing other operations.
The microcontroller also includes a program counter, data pointer, stack & stack pointer, instruction registers
including latches, temporary registers & buffers for the I/O ports.
•In the counter mode of operation they can count the number of high to low transitions of the signal applied to
the timer pins.
•In timer mode of operation they can be independently programmed to work in any one of the four operation
modes. They are called mode-0, mode-1, mode-2 and mode-3.
•In mode-0 the serial port can either receive or transmit at fixed baud rate.
•In mode-2 it can simultaneously transmit and receive at any one of the two selectable baud rate.
•In mode-1 and mode-3 it can work as full duplex serial port with variable baud rate, which is programmed
using timer-1
Registers
Registers in microcontrollers are mainly used to store data and short-term instructions which are mainly
used to process addresses to fetch data. This microcontroller includes 8-bit registers which have 8-bit
start from D0 to D7. Here, D0 to D7 is LSB (least significant bit) and D7 is the most significant bit (MSB).
To make the data process better than 8-bit, then it must be separated into eight different bit parts. It
includes several registers however general-purpose type registers are frequently available to
programmers. There are classified into two types like General purpose & Special purpose. So, most of
the general-purpose registers are listed below.
•An accumulator is mainly used to execute arithmetic & logic instructions.
•Registers like B, R0 toR7 are used for storing instruction addresses & data.
•Data Pointers or DPTR is used to allow & process data in dissimilar addressing modes. This register
includes DPH (high byte) & a DPL (low byte) which is mainly used to hold a 16-bit address. So, it can be
used as a base register within not direct jumps, lookup table instructions & external data transfer.
•Program counter or PC is a 16-bit register used to store the next instruction’s address to be performed
•These registers are 8-bits other than program counter & data pointer registers.