Microprocessor and Interfacing (8085) - Detailed Notes
1. Microprocessor Basics
A microprocessor is a central processing unit (CPU) integrated onto a single chip. It is capable of performing
arithmetic, logical, and control operations. The 8085 microprocessor is an 8-bit processor, which means it can
process 8 bits of data at a time. It has a 16-bit address bus, enabling it to address 64KB of memory.
Key Components of a Microprocessor:
- Accumulator: A special-purpose register used for storing intermediate results.
- Program Counter (PC): Holds the address of the next instruction to be executed.
- Stack Pointer (SP): Points to the top of the stack in memory.
- Address Bus: Carries the address of memory locations.
- Data Bus: Transfers data between the microprocessor and memory or I/O devices.
2. 8085 Architecture and Pin Diagram
The 8085 microprocessor consists of various functional units, including:
- Arithmetic and Logic Unit (ALU): Performs arithmetic and logical operations.
- General-purpose registers (B, C, D, E, H, L): Used for holding data.
- Accumulator: Used to store operands and results.
- Program Counter (PC) and Stack Pointer (SP): The PC holds the address of the next instruction, while the
SP points to the top of the stack.
Important Pins in 8085:
- ALE (Address Latch Enable): Used to demultiplex the lower byte of the address and data bus.
- TRAP: A non-maskable, highest-priority interrupt.
- INTR: A maskable interrupt request input.
3. Instruction Set & Addressing Modes
The 8085 microprocessor supports a variety of instructions grouped into the following categories:
- Data Transfer Instructions (MOV, MVI, LXI)
- Arithmetic Instructions (ADD, SUB, INR, DCR)
- Logical Instructions (ANA, XRA, CMA)
- Branch Instructions (JMP, CALL, RET)
- Control Instructions (NOP, HLT, DI, EI)
Addressing Modes in 8085:
1. Immediate Addressing Mode: The operand is specified in the instruction itself (e.g., MVI A, 32H).
2. Direct Addressing Mode: The address of the operand is specified in the instruction (e.g., LDA 2050H).
3. Register Addressing Mode: The operand is in a register (e.g., MOV A, B).
4. Register Indirect Mode: The address of the operand is in a register pair (e.g., MOV A, M).
4. Timing Diagrams for Key Instructions
Timing diagrams illustrate the sequence of signals generated by the microprocessor during the execution of
an instruction. For example:
- LDA 2050: The microprocessor fetches the instruction and accesses memory at address 2050 to load data
into the accumulator.
- OUT FFH: The content of the accumulator is sent to the output device at the address specified by port FFH.
5. Interrupt System in 8085
The 8085 microprocessor has a robust interrupt system, which includes five interrupts:
- TRAP: A non-maskable interrupt with the highest priority.
- RST7.5, RST6.5, RST5.5: Maskable, vectored interrupts.
- INTR: A general-purpose interrupt that can be masked.
The interrupts allow the microprocessor to respond to external events, such as input from a peripheral device,
in a timely manner.
6. Sample Assembly Language Programs
- Program to Calculate Factorial of a Number between 0 to 8:
MVI B, 08H ; Load 8 into register B
MOV A, B ; Copy B to Accumulator
LOOP: DCR B ; Decrement B
MUL A, B ; Multiply A by B
JNZ LOOP ; Repeat until B is zero
- Program to Add Two 8-bit Numbers:
MVI A, 32H ; Load 32H into A
MVI B, 15H ; Load 15H into B
ADD B ; Add contents of B to A
HLT ; Halt the program.