1 of 11

Unit 3

Microprocessor and Interfacing

Microprocessor and Its Interfacing: Organization of 8085 – Addressing Modes – Instruction Set – Simple Programs involving Logical - Branch/Call - Sorting - Evaluating Arithmetic Expressions and String Manipulation Instructions - A/D and D/A Converters.

2 of 11

  • Microprocessor is an electronic circuit that functions as the central processing unit (CPU) of a computer, providing computational control. Microprocessors are also used in other advanced electronic systems, such as computer printers, automobiles, and jet airliners.
  • Typical microprocessors incorporate arithmetic and logic functional units as well as the associated control logic, instruction processing circuitry, 2 and a portion of the memory hierarchy.

3 of 11

4 of 11

Arithmetic and Logic Unit

The ALU performs the actual numerical and logical operations such as Addition (ADD), Subtraction (SUB), AND, OR etc. It uses data from memory and from Accumulator to perform operations. The results of the arithmetic and logical operations are stored in the accumulator

Registers

The 8085 includes six registers, one accumulator and one flag register, as shown in Fig. 3. In addition, it has two 16-bit registers: stack pointer and program counter. The 8085 has six general-purpose registers to store 8-bit data; these are identified as B, C, D, E, H and L. they can be combined as register pairs - BC, DE and HL

5 of 11

Accumulator

The accumulator is an 8-bit register that is a part of ALU. This register is used to store 8-bit data and to perform arithmetic and logical operations. The result of an operation is stored in the accumulator. The accumulator is also identified as register A.

Flag register

The ALU includes five flip-flops, which are set or reset after an operation according to data condition of the result in the accumulator and other registers. They are called Zero (Z), Carry (CY), Sign (S), Parity (P) and Auxiliary Carry (AC) flags. Their bit positions in the flag register are shown in Fig. 4. The microprocessor uses these flags to test data conditions.

6 of 11

PIN Diagram of 8085 Microprocessor

All the signals are classified into six groups:

Address bus

  • Data bus
  • Control & status signals
  • Power supply and frequency signals
  • Externally initiated signals
  • Serial I/O signals

7 of 11

Address and Data Buses:

  • A8 – A15 (output, 3-state): Most significant eight bits of memory addresses and the eight bits of the I/O addresses. These lines enter into tri-state high impedance state during HOLD and HALT modes.
  • AD0 – AD7 (input/output, 3-state): Lower significant bits of memory addresses and the eight bits of the I/O addresses during first clock cycle. Behaves as data bus during third and fourth clock cycle. These lines enter into tri-state high impedance state during HOLD and HALT modes.

Control & Status Signals:

  • ALE: Address latch enable
  • RD : Read control signal.
  • WR : Write control signal.
  • IO/M , S1 and S0 : Status signals. Power

Supply & Clock Frequency:

  • Vcc: +5 V power supply
  • Vss: Ground reference
  • X1, X2: A crystal having frequency of 6 MHz is connected at these two pins
  • CLK: Clock output

8 of 11

Externally Initiated and Interrupt Signals:

  • RESET IN : When the signal on this pin is low, the PC is set to 0, the buses are tri-stated and the processor is reset.
  • RESET OUT: This signal indicates that the processor is being reset. The signal can be used to reset other devices.
  • READY: When this signal is low, the processor waits for an integral number of clock cycles until it goes high.
  • HOLD: This signal indicates that a peripheral like DMA (direct memory access) controller is requesting the use of address and data bus.
  • HLDA: This signal acknowledges the HOLD request.
  • INTR: Interrupt request is a general-purpose interrupt.
  • INTA : This is used to acknowledge an interrupt.
  • RST 7.5, RST 6.5, RST 5,5 – restart interrupt: These are vectored interrupts and have highest priority than INTR interrupt.
  • TRAP: This is a non-maskable interrupt and has the highest priority.

Serial I/O Signals:

  • SID: Serial input signal. Bit on this line is loaded to D7 bit of register A using RIM instruction.
  • SOD: Serial output signal. Output SOD is set or reset by using SIM instruction.

9 of 11

Addressing Modes

  • Immediate addressing - In this mode, the operand given in the instruction - a byte or word – transfers to the destination register or memory location.
  • Memory direct addressing- Memory direct addressing moves a byte or word between a memory location and register. The memory location address is given in the instruction.
  • Register direct addressing- Register direct addressing transfer a copy of a byte or word from source register to destination register.
  • Indirect addressing- Indirect addressing transfers a byte or word between a register and a memory location
  • Implicit addressing- In this addressing mode the data itself specifies the data to be operated upon.

10 of 11

INSTRUCTION EXECUTION AND TIMING DIAGRAM:

  • Each instruction in 8085 microprocessor consists of two part- operation code (opcode) and operand. The opcode is a command such as ADD and the operand is an object to be operated on, such as a byte or the content of a register.
  • Instruction Cycle: The time taken by the processor to complete the execution of an instruction. An instruction cycle consists of one to six machine cycles.
  • Machine Cycle: The time required to complete one operation; accessing either the memory or I/O device. A machine cycle consists of three to six T-states.
  • T-State: Time corresponding to one clock period. It is the basic unit to calculate execution of instructions or programs in a processor.

11 of 11

To execute a program, 8085 performs various operations as:

  • Opcode fetch
  • Operand fetch
  • Memory read/write
  • I/O read/write

External communication functions are:

  • Memory read/write
  • I/O read/write
  • Interrupt request acknowledge