Unit V Pin Diagram of 8085 Microprocessor
Unit V Pin Diagram of 8085 Microprocessor
6. TRAP, RST7.5, RST 6.5, RST 5.5: These are the interrupts when an interrupt comes
microprocessor executes the next instruction from a fixed location in the memory.
7. INTR: It is called interrupt request. It is of the lowest priority. The INTR is enabled or
disabled. It gets disabled by reset or immediately after an interrupt is accepted.
8. INTA: This is active low signal and it is known as interrupt acknowledge. When an
interrupt request is accepted then the microprocessor sends interrupt acknowledge
INTA.
9. AD0 AD7 : Multiplexed Address /Data Bus: These signals are Bi-directional. These
are time multiplexed address and data bus. During 1st clock cycle, it acts as a least
significant 8 bits of memory address. For 2nd and 3rd clock cycle, it acts as a data bus.
10. A8 to A15 : These are unidirectional signals which carry the most significant bit i.e. 8
bits of the memory address.
11. ALE(Address Latch Enable):This is an O/P signal used to demultiplex the
address/data bus. In other words ALE is used to separate AD0 ---AD7 are addresses and
when it is low it indicates that the contents on AD0 AD 7 is data.
12. S1 and S0: These are two output status signals generated by microprocessor. These
indicates type of operation performed by microprocessor.
13. IO/M : Input Output/Memory : It is an O/P control signal. These signal tells whether
the operation is related to memory or to I/o device. In other words IO/M separated
memory and I/O devices. If the signal on this pin is low then microprocessor is
performing memory related operation and if signal on this pin is high then
microprocessor will perform I/O perform I/O related operation.
14. Read(RD): It is an active low output control signal. When the signal on this pin is low
it indicates that cpu read the data form selected memory or I/O location.
15. Write(WR): It is an active low O/P control signal. When the signal on this pin is slow
it indicates that the CPU will write data in the selected memory or I/O location.
16. Ready: It is an active high input control signal with the help of this pin
microprocessor checks he readiness of I/O device for data transfer. i.e. whether the
I/O signal is ready to receive or send data. If the signal on this pin is high, CPU will
perform data transfer but if the signal on this pin is low then it will wait till the signal
goes high.
17. Hold and HLDA: Hold is an active high input signal and HLDA is an active high
output signal. Signal at hold pin indicates that another device is requesting for the use
of address, data and control to other device. HLDA is hold acknowledgement. It
indicates microprocessor has received the hold request and will transfer the control of
address, data and control bus in the next clock cycle.
18. Vcc: It is used to provide +5v power supply.
19. GND or Vss: This pin always connected to ground. I.e. ve charge.
All of the three flip flop set and reset according to the stored result in the accumulator.
1.Sign- If D7 of the result is 1 then sign flag is set otherwise reset. As we know that a number
on the D7 always desides the sign of the number.
if D7 is 1: the number is negative.
if D7 is 0: the number is positive.
2.Zeros(Z)-If the result stored in an accumulator is zero then this flip flop is set otherwise it
is reset.
3.Auxiliary carry(AC)-If any carry goes from D3 to D4 in the output then it is set otherwise
it is reset.
4.Parity(P)-If the no of 1's is even in the output stored in the accumulator then it is set
otherwise it is reset for the odd.
5.Carry(C)-If the result stored in an accumulator generates a carry in its final output then it
Serial Input Output Control-There are two pins in this unit. This unit is used for serial data
communication.
Interrupt Unit-There are 6 interrupt pins in this unit. Generally an external hardware is
connected to these pins. These pins provide interrupt signal sent by external hardware to
microprocessor and microprocessor sends acknowledgement for receiving the interrupt
signal. Generally INTA is used for acknowledgement.
--------------------------------------------------------------------------------------------------------ADDRESSING MODES:
The various ways of specifying data (or operands) for instructions are called as addressing
modes.
The 8085 addressing modes are classified into following types:
1. Immediate addressing mode
2. Direct addressing mode
3. Register addressing mode
4. Register indirect addressing mode
5. Implicit addressing mode
Immediate Addressing mode
In this mode operand is a part of the instruction itself is known as Immediate Addressing
mode. If the immediate data is 8-bit, the instruction will be of two bytes. If the immediate
data is 16 bit, the instruction is of 3 bytes.
Ex: (1). ADI DATA : Add immediate the data to the contents of the accumulator.
(2).LXIH 8500H ; Load immediate the H-L pair with the operand 8500H
(3). MVI 08H
In this mode the operands are microprocessor registers only. i.e. the operation is performed
within various registers of the microprocessor.
Ex: (1). MOV A, B: Move the contents of B register to A register.
(2). SUB D:
: Move the contents of the memory location pointed by the H-L pair to
accumulator
Implicit Addressing mode
The mode of instruction which do not specify the operand in the instruction but it is
implicated, is known as implicit addressing mode. i.e., the operand is supposed to be present
generally in accumulator.
Ex: (1).CMA: complement the contents of Accumulator
(2).CMC: Complement carry
(3). RLC: Rotate Accumulator left by one bit
(4). RRC: Rotate Accumulator right by one bit
(5). STC: Set carry.
------------------------------------------------------------------------------------------------------------INSTRUCTIONS
An instruction is a binary pattern designed inside a microprocessor to perform a specific
function. Each instruction is represented by 8 bit binary value.
Types of instruction set:
1)
Instructions, which are used to transfer data from one register to another register, from
memory to register or register to memory, come under this group. Examples are: MOV, MVI,
LXI, LDA, STA etc. When an instruction of data transfer group is executed, data is
transferred from the source to the destination without altering the contents of the source. For
example, when MOV A, B is executed the content of the register B is copied into the register
A, and the content of register B remains unaltered. Similarly, when LDA 2500 is executed the
content of the memory location 2500 is loaded into the accumulator. But the content of the
memory location 2500 remains unaltered.
EXAMPLES:
1. MOV r1, r2 (Move Data; Move the content of the one register to another). [r1] <-- [r2]
2. MOV r, m (Move the content of memory register). r <-- [M]
2) Arithmatic instructions:
The instructions of this group perform arithmetic operations such as addition, subtraction;
increment or decrement of the content of a register or memory.
Examples:
1). ADD r. (Add register to accumulator) [A] <-- [A] + [r].
2) .ADD M. (Add memory to accumulator) [A] <-- [A] + [[H-L]].
3).ADC r. (Add register with carry to accumulator). [A] <-- [A] + [r] + [CS].
4). ADC M. (Add memory with carry to accumulator) [A] <-- [A] + [[H-L]] [CS].
5) .ADI data (Add immediate data to accumulator) [A] <-- [A] + data.
6) .ACI data (Add with carry immediate data to accumulator). [A] <-- [A] + data + [CS].
7).DAD rp. (Add register paid to H-L pair). [H-L] <-- [H-L] + [rp].
3) Logical instructions:
The Instructions under this group perform logical operation such as AND, OR, compare,
rotate etc.
Examples:
1). ANA r. (AND register with accumulator) [A] <-- [A] ^ [r].
2).ANA M. (AND memory with accumulator). [A] <-- [A] ^ [[H-L]].
3).ANI data. (AND immediate data with accumulator) [A] <-- [A] ^ data.
4).ORA r. (OR register with accumulator) [A] <-- [A] v [r].
4) Branching Instructions:
This group includes the instructions for conditional and unconditional jump, subroutine call
and return, and restart.
Examples:
1. MP addr (label). (Unconditional jump: jump to the instruction specified by the
address). [PC] <-- Label.
2. Conditional Jump addr (label): After the execution of the conditional jump instruction
the program jumps to the instruction specified by the address (label) if the specified
condition is fulfilled. The program proceeds further in the normal sequence if the
specified condition is not fulfilled. If the condition is true and program jumps to the
specified label, the execution of a conditional jump takes 3 machine cycles: 10 states.
If condition is not true, only 2 machine cycles; 7 states are required for the execution
of the instruction.
1. JZ addr (label). (Jump if the result is zero)
2. JNZ addr (label) (Jump if the result is not zero)
3. JC addr (label). (Jump if there is a carry)
4. JNC addr (label). (Jump if there is no carry)
5. JP addr (label). (Jump if the result is plus)
6. JM addr (label). (Jump if the result is minus)
7. JPE addr (label) (Jump if even parity)
5). Stack,I/O and Machine control instructions:
1. N port-address. (Input to accumulator from I/O port) [A] <-- [Port]
2. OUT port-address (Output from accumulator to I/O port) [Port] <-- [A]
3. PUSH rp (Push the content of register pair to stack)
4. PUSH PSW (PUSH Processor Status Word)
5. POP rp (Pop the content of register pair, which was saved, from the stack)
6. POP PSW (Pop Processor Status Word)
7. HLT (Halt)
SIMPLE PROGRAMS
PROGRAM:
MVI C, 00
'Initialize C register to 00
LDA 4150
MOV B, A
LDA 4151
ADD B
JNC LOOP
'Jump on no carry.
INR C
MOV A, C
STA 4153
HLT
SUB B
JNC LOOP Jump on no carry.
CMA
INR A
INR C
STA 4153
HLT
TIMING DIAGRAM:
The P operates with reference to clock signal.The rise and fall of the pulse of the clock gives
one clock cycle.
Each clock cycle is called a T state and a collection of several T states gives a machine cycle.
AD0-AD7 are used to fetch OP-code and store the lower byte of Program Counter.
A8-A15 store the higher byte of the Program Counter while IO/M will be low since
it is memory related operation.
AD0-AD7 are used to fetch data from CPU and store the lower byte of address.
A8-A15 store the higher byte of the address while IO/M will be low since it is
memory related operation.
The basic PLD architecture involves combining arbitrary numbers of input lines (or their
inverse) with a logical AND to form product terms. A number of independent product terms
(usually up to 8) are then added together (logical OR) to produce a single output line. This is
shown graphically in the figure below.
The logic algorithm is defined by choosing which input lines are connected to which product
terms in the programmable array. While this architecture may seem rather limiting, in a 16V8
there are 8 independent product terms for each output line, and each product term can include
all 16 available input lines. These chips can typically handle all but the most extremely
complex algorithms, provided there are enough input and output lines available.
A PLC is a Programmable Logic Controller is a complete product (made by several
manufacturers) intended to accept inputs from switches (and sometimes analog sources) and
control various devices. These systems are used as part of industrial control systems, and
normally deal with 24 volt input and output signal levels. They are usually programmed using
ladder logic