Professional Documents
Culture Documents
Microprocessor and
Interfacing
Course Code : 3160712
8085 Microprocessor
4
Topics
Looping to be covered
Introduction to 8085
8085 Programming Model
Bus Organization of 8085
8085 pin diagram
8085 Architecture/Block Diagram
T-States, Machine and Instruction Cycle
Demultiplexing Address and Data Bus AD0-AD7
Timing Diagram
Memory Interfacing
Generating Control Signals
5
Topic : 1
Introduction to 8085
Introduction to 8085
6
8085 is pronounced as "eighty-eighty-five" microprocessor.
It is an 8-bit microprocessor designed by Intel in 1977 using NMOS technology.
Introduction to 8085
7
Topic : 2
B (8) C (8)
D (8) E (8)
H (8) L (8)
16
8
Bidirectional Unidirectional
8085 Programming Model
11
B (8) C (8)
D (8) E (8)
H (8) L (8)
8085 Programming Model
12
B (8) C (8)
D (8) E (8)
H (8) L (8)
16
8
Bidirectional Unidirectional
8085 Programming Model
13
:Undefined
P -Parity Flag
S -Sign Flag Set (1) if result has even no. of 1’s &
Set (1) if 7th bit of result is Reset(0) if result has odd no. of 1’s
1;
otherwise reset (0)
CY -Carry Flag
Set (1) if arithmetic
AC -Auxiliary Carry Flag operation results in
Set (1) when carry bit is carry;
Z -Zero Flag generated by 3rd bit & otherwise reset(0)
Set (1) when result is zero; passed to bit 4th bit.
otherwise reset(0)
0 1 0 1 0
+ 0 11 11 0 1 0 0 1
1 00 00 11 0 0 10 01 11 0
AC+= 10 1 1 0 1 0 0 1
1 0 0 1 0 0 1 1
8085 Programming Model
15
B (8) C (8)
D (8) E (8)
H (8) L (8)
16
8
Bidirectional Unidirectional
8085 Programming Model
16
Stack Pointer(SP)
Used as memory pointer.
Points to the memory location in R/W memory,
called Stack.
Beginning of stack is defined by loading a 16-bit
address in the stack pointer.
Program Counter(PC)
Microprocessor uses PC register to sequence the
execution of instructions.
Its function is to point to memory address from
which next byte is to be fetched.
When a byte is being fetched, PC is incremented
by 1 to point next memory location.
17
Topic : 3
Control Bus
Address Bus
Data Bus
System Bus
Bus Organization of 8085
19
A15
Address Bus
A0
Memory Input
D7
Data Bus
D0
Control Bus
Address Bus
20
Group of 16 unidirectional lines generally identified as A0 to A15.
i.e. bits flow from microprocessor to peripheral devices.
16 address lines are capable of addressing 65536 memory locations. So, 8085 has
64K memory locations.
Data Bus
21
Topic : 4
• 8-bit microprocessor.
• Capable of addressing
64K of memory.
• It has 40 pins.
• Requires +5V single
power supply.
8085 Pin Diagram
25
Address Bus
ALE
This is positive going pulse generated every
time the 8085 begins an operation (machine
cycle).
It indicates that the bits on AD7-AD0 are
address bits.
This signal is used primarily to latch the low-
address from multiplexed bus & generate a
separate set of address lines A7-A0.
8085 Pin Diagram
30
RD(Read)
This is a read control signal (active low)
This signal indicates that the selected I/O or
Memory device is to be read & data is
available on data bus.
8085 Pin Diagram
31
WR (Write)
This is a write control signal (active low)
This signal indicates that the selected I/O
or Memory device is to be write & data is
available on data bus.
8085 Pin Diagram
32
IO/M
This is a status signal used to differentiate
I/O and memory operation.
When signal is
High I/O operation
Low Memory operation
This signal is combined with RD and WR to
generate I/O & memory control signals.
8085 Pin Diagram
33
S1 & S0
These status signals can identify various
operations.
8085 Pin Diagram
34
X1, X2
Pin 1 & 2, Crystal Oscillator is connected
at these two pins.
The frequency is internally divided by
two;
therefore, to operate a system at 3 MHz,
the crystal should have a frequency of 6
MHz.
8085 Pin Diagram
36
Topic : 5
Address/Data buffer
8085 Architecture Diagram
48
Registers
Registers
Registers
Accumulator :
It is an 8-bit register used to perform arithmetic, logical, I/O & LOAD/STORE
operations.
It is connected to internal data bus & ALU.
8085 Architecture Diagram
51
Registers
Flag Register :
It is an 8-bit register having five 1-bit flip-flops, which holds either 0 or 1 depending
upon the result stored in the accumulator.
These are the set of 5 flip-flops,
(1) Sign Flag (S) (2) Zero Flag(Z)
(3) Auxiliary Carry (AC) (4) Parity Flag (P)
(5) Carry Flag (C)
8085 Architecture Diagram
52
Flag Registers
Registers
Program Counter :
Registers
Stack Pointer :
It is also a 16-bit register works like stack, which is always
incremented/decremented by 2 during push & pop operations.
Instruction Register :
It is an 8-bit register.
When an instruction is fetched from memory then it is stored in the
Instruction register.
8085 Architecture Diagram
57
As the name suggests, it performs arithmetic and logical operations like Addition,
Subtraction, AND, OR, etc. on 8-bit data.
Address Buffer
Address/Data Buffer
Interrupt Control
The interrupt control block has five interrupt inputs RST 5.5, RST 6.5, RST 7.5,
TRAP and INTR and one acknowledge signal INTA.
It controls the interrupt activity of 8085 microprocessor
8085 Architecture Diagram
60
The 8085's serial I/O control provides two lines, SOD and SID for serial
communication.
The Serial Output Data (SOD) line is used to send data serially and Serial
Input Data (SID) line is used to receive data serially.
8085 Architecture Diagram
61
The control circuitry in the processor 8085 is responsible for all the
operations.
The control circuitry and hence the operations in 8085 are synchronized with
the help of clock signal.
Along with the control of fetching and decoding operations and generating
appropriate signals for instruction execution, control circuitry also generates
signals required to interface external devices to the processor, 8085.
62
Topic : 6
CLK
Clock Period
T-States, Machine Cycle and Instruction Cycle
65
Machine Cycle
m/m Read
“Machine Cycle is defined as time required by the microprocessor to complete an
operation.“ m/m Read
CLK
67
Topic : 7
8085 Microprocessor
A12
0 A11 Order
0 A10 Address
Demultiplexing AD0-AD7
0 A9
0 Bus
A8 A8
ALE Enable G ALE=1
AD7 0 A7
0 A6 Address Bus
0 A5
0 A4 Low-
1 A3
0 A2 Order
1 A1 Address
AD0 1 A0
Bus
0 ALE= 0
1 D7 Data Bus
0 D 6
0 D5
1 D4 Data
1 D3 Bus
1 D2
1 D1
D0
Demultiplexing AD0-AD7
IC 74LS373
IC 74LS373 is an IC with 20 pins. IC 74LS373
Topic : 8
Timing Diagram
Opcode Fetch
Timing Diagram : Opcode Fetch
CLK
A15
High order memory address Unspecified
A8
AD7 Low order
Opcode
M/m addr.
AD0
ALE
IO/M
RD
Memory read cycle
Timing Diagram : Memory Read Cycle
CLK
A15
High order memory address
A8
AD7 Low order Data from
AD0 M/m addr. memory S1 S0 Mode
0 0 HLT
0 1 WRITE
1 0 READ
ALE
IO/M
S0 IO/M=0, S1=1 , S0=0
S1
RD
Memory write cycle
Timing Diagram : Memory Write Cycle
CLK
A15
High order memory address
A8
AD7 Low order Data from
AD0 M/m addr. Microprocessor S1 S0 Mode
0 0 HLT
0 1 WRITE
1 0 READ
ALE
IO/M
S1 IO/M=0, S0=1 , S1=0
S0
WR
74
Topic : 9
Memory Interfacing
Memory Structure
Data
Output
Memory Structure
Memory Interfacing
It is not always necessary to use full 64K address space. The total
memory size depends upon the application.
When both are used then total 64K address will be shared by both.
Step-4: Memory A A A A A A A A A A A A A A A A
Map 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Start
Address 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
EPROM 0000 H
4k End
Address
0FFF H 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1
Start
Address
RAM 1000 H 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
2k End
Address
0 0 0 1 0 1 1 1 1 1 1 1 1 1 1 1
17FF H
A A A A A A A A A A A A A A A A
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Start
Address 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0000 H
EPROM
End
Address
0FFF H 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1
EPROM
• Required Address Lines: A11 to A15.
• Now, EPROM has two Possibilities, either 00000 b or 00001 b.
• Therefore, it requires Y0 and Y1 outputs of decoder.
Memory Interfacing : Example-1
A A A A A A A A A A A A A A A A
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Start
Address 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0000 H
EPROM
End
Address
0FFF H 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1
Start
Address
1000 H 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
RAM
End
Address
17FF H 0 0 0 1 0 1 1 1 1 1 1 1 1 1 1 1
A0 - A10
WR OE
RD
EPROM
D0
-
Y0 00000 D7
To EPROM
A15 Y1
00001
A14
Y2 To RAM D0 – D7 A0 - A10
A13 5:32 00010
Decoder
A12 OE RAM
A11
85
Topic : 10
I0/M RD WR Operation
0 0 0 Invalid
0 0 1 MEMR
IO/ M 0
MEMR
RD 0
8085
WR 1
Generating Control Signals
I0/M RD WR Operation
0 0 0 Invalid
0 0 1 MEMR
0 1 0 MEMW
IO/ M 0
MEMR
RD 1
8085
WR 0 MEMW
Generating Control Signals
I0/M RD WR Operation
0 0 0 Invalid
0 0 1 MEMR
0 1 0 MEMW
0 1 1 NOP
IO/M 0
MEMR
RD 1
8085
WR 1 MEMW
Generating Control Signals
I0/M RD WR Operation
0 0 1 MEMR
0 1 0 MEMW
0 1 1 NOP
1 0 0 Invalid
IO/M 1
MEMR
RD 0
8085
WR 0 MEMW
Generating Control Signals
I0/M RD WR Operation
0 0 1 MEMR
0 1 0 MEMW
0 1 1 NOP
1 0 1 IOR
IO/M 1
MEMR
RD 0
8085
WR 1 MEMW
IOR
Generating Control Signals
I0/M RD WR Operation
0 0 1 MEMR
0 1 0 MEMW
0 1 1 NOP
1 0 1 IOR
1 1 0 IOW
IO/M 1
MEMR
RD 1
8085
WR 0 MEMW
IOR
IOW
Generating Control Signals
I0/M RD WR Operation
0 0 1 MEMR
0 1 0 MEMW
0 1 1 NOP
1 0 1 IOR
1 1 0 IOW
1 1 1 NOP
IO/M 1
MEMR
RD 1
8085
WR 1 MEMW
IOR
IOW
Generating Control Signals
I0/M RD WR Operation
0 0 0 HLT
0 0 1 MEMR
0 1 0 MEMW
0 1 1 NOP
1 0 0 HLT
1 0 1 IOR
1 1 0 IOW
1 1 1 NOP
THANK YOU