Unit 1 Part 1 High
Unit 1 Part 1 High
UNIT
Introduction to Microprocessor
SYLLABUS
Introduction to Microprocessor: Microprocessor architecture and its operations, Memory, Input
& output devices, the 8085 MPU- architecture, Pins and signals, Timing Diagrams, Logic devices for
interfacing, Memory interfacing, Interfacing output displays, Interfacing input devices, Memory
mapped I/O.
The 8085 microprocessor is typically programmed using assembly language, which provides low-
level control over its operations. Programmers write code in assembly language and then
assemble it into machine code for execution. It has historical significance in the world of
computing and served as a stepping stone for the development of more advanced
microprocessors and microcontrollers.
1.1.1 Microcomputer:
The microcomputer is a programmable digital device, designed with registers, flip-flops and
timing elements. It is designed for general-purpose computing tasks and can be used for various
applications.
1.1.2. Microprocessor:
A microprocessor is a specific component within a microcomputer, and it serves as the central
processing unit (CPU) of the system.
Page | 2
Microprocessor & Microcontroller Unit-1: Introduction to Microprocessor
Reset IN: When the reset pin is activated by an external key, all the internal operations are
suspended and the program counter is cleared i.e. PC = 0000 H. Now, the program execution
will begin from the address 0000 H.
Interrupt: The microprocessor can be interrupted from the execution of instructions and
asked to execute some other instructions called an Interrupt Service Routine (ISR). The
microprocessor resumes it operation after completing the Interrupt service routine.
Ready: It is used by the microprocessor to sense whether a peripheral is ready to transfer data
or not.
If Ready = 1, the peripheral is ready.
If Ready = 0, the microprocessor waits till it goes high.
Hold: When the HOLD pin is activated by an external signal, the microprocessor relinquishes
control of buses and allows the external peripheral to use them. For example: The HOLD signal
is used in Direct Memory Access (DMA) data transfer.
The 8085 microprocessor performs operation using three sets of communication lines called
buses:
1 The Address : The 8085 microprocessor uses a 16-bit address bus to access
bus memory locations. This provides a maximum addressable memory
space of 64 KB (kilobytes). This address bus is used for memory
addressing, allowing the microprocessor to fetch. The 8085 MPU
with its 16-bit address lines is capable of addressing 216 = 65.536
memory location (64 Kb) instructions and data from memory and
to write data to memory.
2 The data bus : The 8085 microprocessor has an 8-bit bi-directional data bus. Data
bus can transfer data in 8-bit chunks or one byte between the
microprocessor and memory, input/output (I/O) devices, and
other components.
3 The control bus : • The control bus is comprised of various single lines that carry
synchronization signals. The control bus is not a group of lines
like Address bus or data bus, but individual lines that provide a
pulse to indicate an MPU operation.
Page | 3
Microprocessor & Microcontroller Unit-1: Introduction to Microprocessor
Page | 4
Microprocessor & Microcontroller Unit-1: Introduction to Microprocessor
Page | 5
Microprocessor & Microcontroller Unit-1: Introduction to Microprocessor
Accumulator
• Accumulator is an 8-bit register which can hold 8-bit data.
• Accumulator is a special register used for temporary data storage and manipulation
during arithmetic and logical operations.
• It also stores the result of the operation carried out by the Arithmetic and Logic unit.
STACK:
The stack is a region of memory used for storing data temporarily during program execution.
Page | 6
Microprocessor & Microcontroller Unit-1: Introduction to Microprocessor
Temporary register:
Temporary register is an 8-bit register. This register acts as a temporary memory during the
arithmetic and logical operations. This temporary register can only be accessed by the
microprocessor and it is completely inaccessible to programmers.
D7 D6 D5 D4 D3 D2 D1 D0
𝐒 𝐙 𝐀𝐂 𝐏 𝐂𝐘
Figure 1.7: 8085 microprocessor Flags
The five bits indicate the five-status flag and three bits are undefined. The combinations of these
8-bits are called Program Status Word (PSW). The 5 flags bits are Carry (CY), Zero (Z), Sign (S),
Parity (P) and Auxiliary Carry (AC)
CARRY (CY):
• After performing arithmetic & logic operation if there is a carryout from the MSB (D 7 i.e.
7th bit) then CY = 1, otherwise CY = 0.
• If there is a borrow from subtraction or comparison, the carry flag CY=1; otherwise CY=0.
ZERO FLAG:
After performing arithmetic & logic operation if the result in the accumulator is zero, then Z=1
and if the result in the accumulator is non-zero then Z=0.
SIGN FLAG:
After performing arithmetic & logic operation if the most significant bit (MSB) of the result in
accumulator is 1 i.e. MSB=1, then S=1; otherwise S=0. (if MSB=1, then S=1 & if MSB=0, then S=0).
Page | 7
Microprocessor & Microcontroller Unit-1: Introduction to Microprocessor
REGISTER ARRAY
Two additional registers, called temporary registers 𝐖 and 𝐙, are included in the register array
and they are used internally by 8085 microprocessor. These registers are not available to the
programmer. These registers are used to hold 8-bit data during the execution of some
instructions.
ADDRESS BUS:
• The address bus is a set of physical lines that carry the memory address information. It
specifies the location in memory or a peripheral device where data needs to be read from
or written to.
• In 8085 microprocessor address bus is 16-bit A0 to A15.
• The lower address lines are multiplexed address and data lines i.e. AD0 to AD7 and
higher address line are A8 to A15.
• The address bus is unidirectional. The width of the address bus determines the range of
memory addresses that can be accessed, allowing access to 64 KB of memory locations
(i.e. 216 = 64 KB).
DATA BUS:
• The data bus is set of physical lines that carry the actual data being transferred between
the microprocessor and memory or peripheral devices.
• In 8085 microprocessor data bus is 8-bit bidirectional allowing it to transfer 8-bits of
data at a time.
NUMERICAL ON FLAGs
1. Determine the flag bits in the 8085 microprocessor after adding 80H and 60H.
SOLUTION:
CY D7 D6 D5 D4 D3 D2 D1 D0
80 0 1 0 0 0 0 0 0 0
+ 60 + 0 1 1 0 0 0 0 0
E0 1 1 1 0 0 0 0 0
Page | 8
Microprocessor & Microcontroller Unit-1: Introduction to Microprocessor
So, after adding 80H and 60H, the flag values are:
D7 D6 D5 D4 D3 D2 D1 D0
𝐒 𝐙 𝐀𝐂 𝐏 𝐂𝐘
1 0 0 0 0
2. Determine the flag bits in the 8085 microprocessor after adding CB H and E9 H.
SOLUTION:
CY D7 D6 D5 D4 D3 D2 D1 D0
1 1 1 1 1
CB 1 1 0 0 1 0 1 1
+ E9 + 1 1 1 0 1 0 0 1
1B4 1 1 0 1 1 0 1 0 0
Page | 9
Microprocessor & Microcontroller Unit-1: Introduction to Microprocessor
Figure 1.8 (a): Pin diagram of 8085 Figure 1.8 (b): Functional Pin diagram
Page | 10
Microprocessor & Microcontroller Unit-1: Introduction to Microprocessor
SID is the serial input data pin. It is used for receiving serial data
from external devices or peripherals and transferring it to the
microprocessor. Data is received bit by bit through this pin.
In the 8085 microprocessor, interrupts are mechanisms used to
temporarily pause the normal program execution and handle
specific events or requests from external devices. The 8085
microprocessor has five interrupt signals that can be used to
interrupt program execution. These interrupt signals are:
TRAP or TRAP Interrupt:
• TRAP is a non-maskable interrupt (NMI) that is generated by
an external device, such as a power failure or a hardware
malfunction.
• When TRAP is triggered, the microprocessor jumps to a
specific memory location address 0024 to execute a
predefined routine.
• The TRAP interrupt has the highest priority and cannot be
disabled.
RST 7.5:
• The RST 7.5 interrupt is a maskable interrupt that is
generated by a software instruction. RST 7.5 can be enabled
or disabled by the microprocessor.
• When RST 7.5 is triggered, the microprocessor jumps to a
specific memory location address 002C to execute a
predefined routine.
(INTERRUPTS) • It has the second highest priority.
RST 5.5:
• The RST 5.5 interrupt is a maskable interrupt that is
generated by a software instruction. RST 5.5 can be enabled
or disabled by the microprocessor.
• When RST 5.5 is triggered, the microprocessor jumps to a
specific memory location address 003C to execute a
predefined routine.
• It has the fourth highest priority.
Page | 11
Microprocessor & Microcontroller Unit-1: Introduction to Microprocessor
SUMMARY OF INTERRUPTS
Address
Maskable or Non-
Interrupt Priority order or
Maskable
Location
1 (Highest Non-maskable
TRAP 0024
priority) (NMI)
RST 7.5 2 Maskable 003C
RST 6.5 3 Maskable 0034
RST 5.5 4 Maskable 002C
5 (Lowest No
INTR Maskable
priority) specific
AD0 to AD7:
• AD0 to AD7 are multiplexed address and data lines that form
the lower byte of the 16-bit Address/Data bus. AD0 – AD7 are
8-bit bi-directional and serve as both A0 – A7 and D0 – D7
simultaneously.
12- • They are used to send both address and data between the
AD0-AD7
19 microprocessor and memory or peripheral devices
• During the execution of the instruction, these lines carry the
address bits during the early part, then during the late parts
of the execution, they carry the 8 data bits.
A8 to A15:
• A8-A15 are a set of eight unidirectional lines that form the
21-
A8-A15 upper part of the 16-bit Address bus.
28
• They are used to transmit the most significant bits of the
memory address during memory read and write operations.
Page | 12
Microprocessor & Microcontroller Unit-1: Introduction to Microprocessor
• When ̅̅̅̅̅̅̅̅̅
𝐑𝐄𝐒𝐄𝐓 ̅̅̅𝐈𝐍 = 𝟎, the microprocessor enters a reset state.
36 ̅̅̅̅̅̅̅̅̅ 𝐈𝐍
𝐑𝐄𝐒𝐄𝐓 ̅̅̅ • During this state, all registers and flags are cleared, and the
program counter (PC=00) is typically set to its initial value.
• CLK OUT in the 8085 microprocessor is an output signal that
37 CLK (OUT) carries the microprocessor's clock frequency. This signal can be
used as the system clock for other devices.
HLDA (Hold Acknowledge):
• HLDA is a signal used to acknowledge a HOLD request.
38 HLDA • It indicates that the HOLD request has been received.
• The microprocessor takes over the buses after the removal of
the HOLD request when HLDA goes low.
HOLD (Hold Request):
• It indicates that another device is requesting the use of the
address and data bus.
• After receiving a HOLD request, the microprocessor
39 HOLD
relinquishes (hands over) the use of the buses as soon as the
current machine cycle is completed.
• The microprocessor regains the buses after the removal of the
HOLD signal.
40 VCC +5V DC supply
Note:
In the 8085 microprocessor, "HOLD" and "HLDA" (Hold Acknowledge) are control
signals used to manage external requests for control of the system bus.
0 0 0 Halt
0 0 1 Memory WRITE
0 1 0 Memory READ
Page | 13
Microprocessor & Microcontroller Unit-1: Introduction to Microprocessor
1 0 1 IO WRITE
1 1 0 IO READ
0 1 1 Op code fetch
1 1 1 Interrupt acknowledge
Page | 14