Unit-3 - 8085 Microprocessor
Unit-3 - 8085 Microprocessor
(MPI)
GTU # 3160712
Unit-3:
8085
Microprocessor Positive Vibes:MPI is the interesting, easiest and scoring subject.
Subject Overview
▪ 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
Introduction to 8085
Introduction to 8085
8085 is pronounced as "eighty-eighty-five" microprocessor.
It is an 8-bit microprocessor designed by Intel in 1977 using NMOS technology.
B (8) C (8)
D (8) E (8)
H (8) L (8)
16
8
Bidirectional Unidirectional
B (8) C (8)
D (8) E (8)
H (8) L (8)
B (8) C (8)
D (8) E (8)
H (8) L (8)
16
8
Unidirectional
Bidirectional
B (8) C (8)
D (8) E (8)
H (8) L (8)
16
8
Bidirectional Unidirectional
B (8) C (8)
D (8) E (8)
H (8) L (8)
16
8
Bidirectional Unidirectional
Control Bus
Address Bus
Data Bus
System Bus
Memory Input
D7
Data Bus
D0
Control Bus
Memory Input
D7
Data Bus
D0
Control Bus
Memory Input
D7
Data Bus
D0
Control Bus
• It has 40 pins.
• Requires +5V single power
supply.
S1 S0 Mode
0 0 HLT
0 1 WRITE
1 0 READ
1 1 OPCODE FETCH
I0/M RD WR Operation
0 0 0 HLT
0 0 1 MEMR
0 1 0 MEMW
0 1 1 Opcode
Fetch
1 0 0 HLT
1 0 1 IOR
1 1 0 IOW
1 1 1 NOP
3 37
RESET CLK
OUT OUT
8085 Architecture/Block Diagram
INTA RST6.5 TRAP
INTR RST5.5 RST7.5 SID SOD
8-Bit Internal Data Bus Positive Vibes:MPI is the interesting, easiest and scoring subject.
8085 Block Diagram
Instruction
Accumulator (8) Temp. Reg. (8) Multiplexer
Reg. (8)
W (8) Z (8)
Temp. Reg. Temp. Reg.
Instruction B (8) C (8)
Decoder and Reg. Reg.
Flag (5) D (8) E (8)
Register Select
Machine
Flip-Flops Reg. Reg.
Cycle
Encoding H (8) L (8)
Reg. Reg.
Arithmetic Stack Pointer (16)
Logic Unit
Power +5 V (ALU) (8) Program Counter (16)
Supply GND
Increment/Decrement
Address Latch (16)
X1 CLK
X2
Timing and Control Reset
GEN
Control Status DMA Address Buffer (8) Data/Address Buffer (8)
8-Bit Internal Data Bus Positive Vibes:MPI is the interesting, easiest and scoring subject.
Register Select
Machine
Flip-Flops Reg. Reg.
Cycle
information present
H (8) Lin(8)the
Encoding
InstructionReg.
register. Reg.
Arithmetic Stack Pointer (16)
Logic Unit
(ALU) (8) Program Counter (16)
Increment/Decrement
Address Latch (16)
X1 CLK
Timing and Control Reset
GEN
• Performs
Control Computing
Status Functions.
DMA Address Buffer (8) Data/Address Buffer (8)
• Accumulator, Temporary Register
CLK RD WR S0 S1 HLDA RESET OUT
OUT
and Flag Registers
ALE
are part of ALU. A15 - A8 AD7 – AD0
HOLD RESET IN Address
READY Address/Data
Bus Bus
INTA RST6.5 TRAP
INTR RST5.5 RST7.5 SID SOD
A multiplexer pulls out the right group of bits,
Interrupt Control depending onI/O
Serial the instruction.
Control
8-Bit Internal Data Bus Positive Vibes:MPI is the interesting, easiest and scoring subject.
Instruction
Accumulator (8) Temp. Reg. (8) Multiplexer
Reg. (8)
W (8) Z (8)
• • Two
Eachadditional
register can 8-bit register,
hold which holds the
8-bit data. Temp. Reg. Temp. Reg.
• temporary data can
These registers during
workexecution
in pair toofhold
Instructionsome
16- B (8) C (8)
instructions.
bit data and their
Decoder Reg. Reg.
Flag pairing
(5) combination
and is like
Register Select
D (8) E (8)
• They are& used
B-C, D-E internally, so they
H-L. Flip-Flops Machineare not Reg. Reg.
available to the programmer. Cycle H (8) L (8)
It increments the program counter Encoding as Reg. Reg.
instructions
It execute,
is a 16-bit register works increments
Arithmetic like stack, which andis Stack Pointer (16)
16-bit registertheused
decrements stackto store
Logic pointer
Unit theas memory
needed, address
and
always incremented/decremented by 2 during
location
supports ofthe
the16-bit
next(ALU)
instruction
increment
(8) toand
be executed.
decrement
Program Counter (16)
push & pop operations. Increment/Decrement
instructions. Address Latch (16)
X1• The
CLK content stored in the SP and PC is
Timing and Control
loaded
GEN into
Control the Address
Status DMA Buffer and
Reset
Address Buffer Data/Address Buffer
Data/Address Buffer. (8) (8)
The memory
• CLK RD WR and SI/O0 S1chips HLDA
are connected
RESET OUT
A15 - A8 AD7 – AD0
toREADY
OUT these buses that can HOLD
ALE exchange the data.
RESET IN Address Address/Data
Bus Bus
INTA RST6.5 TRAP
INTR RST5.5 RST7.5 SID SOD
8-Bit Internal Data Bus Positive Vibes:MPI is the interesting, easiest and scoring subject.
Instruction
Accumulator (8) Temp. Reg. (8) Multiplexer
Reg. (8)
W (8) Z (8)
Temp. Reg. Temp. Reg.
Instruction B (8) C (8)
Decoder and Reg. Reg.
Flag (5) D (8) E (8)
Register Select
Machine
Flip-Flops Reg. Reg.
Cycle
Encoding H (8) L (8)
Reg. Reg.
This unit synchronizes all the microprocessor operations with
Arithmetic
the clock
Stack Pointer (16)
and generates control signal necessary for communication between
Logic Unit
Read/write
Input either
signal
microprocessor
Perform & to/from
(ALU) (8) memory
to synchronize
peripheral.
synchronization with or peripherals.
microprocessor
peripheral Program Counter (16)
Frequency Control Signals Address Latch Enable control signal
device. with peripheral device.
Shows read/write DMA status signal memory or Increment/Decrement
controlto/from I/O.
Address Latch (16)
X1 CLK
Timing and Control Reset Signal to RESET microprocessor and other
X2 GEN
Control Status DMA devices connected
Address Buffer (8) to it. Buffer (8)
Data/Address
8-Bit Internal Data Bus Positive Vibes:MPI is the interesting, easiest and scoring subject.
Instruction
Accumulator (8) Temp. Reg. (8) Multiplexer
Reg. (8)
W (8) Z (8)
Temp. Reg. Temp. Reg.
Instruction B (8) C (8)
Decoder and Reg. Reg.
Flag (5) D (8) E (8)
Register Select
Machine
Flip-Flops Reg. Reg.
Cycle
Encoding H (8) L (8)
Reg. Reg.
Arithmetic Stack Pointer (16)
Logic Unit
(ALU) (8) Program Counter (16)
Increment/Decrement
Address Latch (16)
X1 CLK
X2
Timing and Control Reset
GEN
Control Status DMA Address Buffer (8) Data/Address Buffer (8)
8-Bit Internal Data Bus Positive Vibes:MPI is the interesting, easiest and scoring subject.
Register Select
Machine
Flip-Flops Reg. Reg.
Cycle
Encoding H (8) L (8)
Reg. Reg.
Arithmetic Stack Pointer (16)
Logic Unit
%
(ALU) (8) Program Counter (16)
Increment/Decrement
Address Latch (16)
X1 CLK
X2
Timing and Control Reset
GEN
Control Status DMA Address Buffer (8) Data/Address Buffer (8)
8-Bit Internal Data Bus Positive Vibes:MPI is the interesting, easiest and scoring subject.
Instruction
Accumulator (8) Temp. Reg. (8) Multiplexer
Reg. (8)
W (8) Z (8)
Temp. Reg. Temp. Reg.
Instruction B (8) C (8)
Decoder and Reg. Reg.
Flag (5) D (8) E (8)
Register Select
Machine
Flip-Flops Reg. Reg.
Cycle
Encoding H (8) L (8)
Reg. Reg.
Arithmetic Stack Pointer (16)
Logic Unit
Power +5 V (ALU) (8) Program Counter (16)
Supply GND
Increment/Decrement
Address Latch (16)
X1 CLK
X2
Timing and Control Reset
GEN
Control Status DMA Address Buffer (8) Data/Address Buffer (8)
CLK
Clock Period
The basic microprocessor operation such as reading a byte from I/O port or writing a byte to
memory.
Opcode Fetch Memory Read I/O Write
T1 T2 T3 T4 T1 T2 T3 T1 T2 T3
CLK
Instruction Cycle
T1 T2 T3 T4
CLK
Machine Cycle
Instruction Cycle
Demultiplexing Address and Data
Bus AD0-AD7
Demultiplexing AD0-AD7
A15 0 A
0 A15
1Positive
14
A Vibes:MPIHigh-Order
is the interesting, easiest and scoring subject.
0 A13
8085 Microprocessor
0 A12 Address Bus
11
0 A
0 A10
A8 0 A9
8
ALE Enable G ALE=1
AD7 0 A7
0 A6 Address Bus
0 A5
0 A4 Low-Order
1 A3
0 A2 Address Bus
1 A1
AD0 1 A0
0 ALE= 0
1 D7 Data Bus
0 D 6
0 D5
1 D4 Data Bus
1 D3
1 D2
1 D1
D0
Demultiplexing AD0-AD7
The dual-purpose of the AD0-AD7 pins is achieved through multiplexing.
In simple words, multiplexing allows us to use the pins of a microprocessor for more than one
function.
Advantage: Since each pin can serve multiple purposes, the total number of pins can be
reduced.
IC 74LS373
IC 74LS373 is an IC with 20 pins.
it is a memory unit to hold one bit of data.
IC 74LS373
A15
Timing Diagram: Opcode Fetch
ALE
IO/M
RD
A15
High order memory address
A8
AD7 Low order
Data from memory
AD0 M/m addr. 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
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
Internal Decoder
data lines=8
then
Address NXM 1. Number of memory locations =
Input Memory N=213 = 8192
2. Word length M= 8 bit
A0 Therefore, N X M= 8192 X 8
Output Buffer
RD
Data Output
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
EPROM chip size = 4kB & RAM chip size = 2kB
smaller chip size RAM = 2kB = 211
Thus neglect lower 11 address lines (A0 to A10), and consider A11 to A15 for Decoding.
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.
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
EPROM Chip-2:
Starting Address =1FFFH + 1 = 2000H
Chip Size = 1FFFH
Ending Address = 2000+1FFFH = 3FFFH
Y7
EPROM
CHIP-1
WR D0
RD -
D7
D0 – D7 A0 - A12
OE RAM
Exercise: Memory Interface Example
1. Draw the interfacing of a 4KB EPROM having a starting address 2000h and two 2KB static
RAMs having starting addresses 4000h and 8000h, respectively, with 8085 microprocessor.
2. Design an 8085 microprocessor system such that it should contain 16KB of EPROM and 4KB
of RAM with starting addresses 0000H and 4000H respectively. Use two 8KB of EPROMs
(2764) and two 2KB of RAMs (6116) for this system.
EPROM
CHIP
WR D0
RD -
D7
D0 – D7 A0 - A12
Y0 00100 OE
To EPROM
Y1 RAM-1
00101
A15
Y2 To RAM-1
A14 5:32 01000
A13 Decoder
Y3 To RAM-2
A12 10000
D0 – D7 A0 - A12
A11
OE RAM-2
Exercise: Example 2
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 Positive Vibes:MPI is the interesting, easiest and scoring subject.
Address 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0000 H
EPROM1 End
Address 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1
1FFF H
Start
Address 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
2000 H
EPROM2 End
Address 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1
3FFF H
Start
Address 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
4000 H
RAM 1 End
Address 0 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1
47FF H
Start
Address 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0
4800 H
RAM 2 End
Address 0 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1
4FFF H
Exercise: Example 2
Step-5: A0 - A10
RD OE
IO/M EPROM-1
D0 Vibes:MPI is the interesting, easiest and scoring subject.
Positive
-
D7
WR
RD A0 - A10
OE
D0 EPROM-2
-
D7
Y0 00011
EPROM-1
Y 00100
1
D0 – D7 A0 - A10
A15 OE
RAM-1
A14 5:32 EPROM-2
Y2 00101
A13 Decoder
A12 Y3 01000 To RAM-1
A11
A0 - A10
Y4 10000 To RAM-2
D0 – D7
OE RAM-2
Generating Control Signals
Generating Control Signals
I0/M RD WR Operation
0 0 0 Invalid
0 0 1 MEMR
IO/M 0
MEMR
RD 0
8085
WR 1
0 0 0 Invalid
0 0 1 MEMR
0 1 0 MEMW
IO/M 0
MEMR
RD 1
8085
WR 0 MEMW
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
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
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
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
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
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