SlideShare a Scribd company logo
1 of 174
EE8551
Microprocessors and
Microcontrollers
DEPARTMENTS: EEE {semester 05}
Regulation : 2017
Presented by L.Padmanaban,AP/ECE
PEC
1
After completing the subject you will gain knowledge
and will be eligible for the following post in an
organization
Electronics Engineer
IOT Engineer
Embedded system Engineer
Embedded Trainer
Embedded Developer
Field Sales Executive
Telecom Engineer Etc..
To impart knowledge on the following Topics
Architecture of µP8085 & µC 8051
Adresing modes & instruction set of 8085 & 8051.
Need & use of Interrupt structure 8085 & 8051.
Simple applications development with
programming 8085 & 8051
Ability to acquire knowledge in Addressing modes
& instruction set of 8085 & 8051.
Ability to explain the architecture of
Microprocessor and Microcontroller.
Ability to write the assembly language programme.
Sl. No. Subject Description Level of
Study
1 Digital
Logic
Circuits
Data and number
system, Boolean
algebra,
Combinational and
Sequential circuits
3rd
Semester
Syllabus
6
7
Microprocessor
• Microprocessor (µP) is the “brain” of a computer
that has been implemented on one
semiconductor chip.
• The word comes from the combination micro and
processor.
• Processor means a device that processes
whatever(binary numbers, 0’s and 1’s)
To process means to manipulate. It describes all
manipulation.
Micro - > extremely small
8
Definition of a Microprocessor.
The microprocessor is a
programmable device that takes in numbers,
performs on them arithmetic or logical
operations according to the program stored in
memory and then produces other numbers as
a result.
9
Microprocessor ?
A microprocessor is multi
programmable clock driven register
based semiconductor device that is
used to fetch , process & execute a
data within fraction of seconds.
10
Applications
• Calculators
• Accounting system
• Games machine
• Instrumentation
• Traffic light Control
• Multi user, multi-function environments
• Military applications
• Communication systems
11
MICROPROCESSOR HISTORY
DIFFERENT PROCESSORS AVAILABLE
Socket
Processor
Pinless
Processor
Slot
Processor
ProcessorSl
ot
12
13
Development of Intel Microprocessors
• 8086 - 1979
• 286 - 1982
• 386 - 1985
• 486 - 1989
• Pentium - 1993
• Pentium Pro - 1995
• Pentium MMX -1997
• Pentium II - 1997
• Pentium II Celeron - 1998
• Pentium II Zeon - 1998
• Pentium III - 1999
• Pentium III Zeon - 1999
• Pentium IV - 2000
• Pentium IV Zeon - 2001
14
GENERATION OF PROCESSORS
Processor Bits Speed
8080 8 2 MHz
8086 16 4.5 – 10
MHz
8088 16 4.5 – 10
MHz
80286 16 10 – 20
MHz
80386 32 20 – 40
MHz
80486 32 40 – 133
MHz
15
GENERATION OF PROCESSORS
Processor Bits Speed
Pentium 32 60 – 233
MHz
Pentium
Pro
32 150 – 200
MHz
Pentium II,
Celeron ,
Xeon
32 233 – 450
MHz
Pentium
III, Celeron
, Xeon
32 450 MHz –
1.4 GHz
Pentium IV,
Celeron ,
Xeon
32 1.3 GHz –
3.8 GHz
Itanium 64 800 MHz –
3.0 GHz
Intel 4004
 Introduced in 1971.
 It was the first microprocessor
by Intel.
 It was a 4-bit µP.
 Its clock speed was 740KHz.
 It had 2,300 transistors.
 It could execute around
60,000 instructions per
second.
16
Intel 4040
Introduced in 1971.
It was also 4-bit µP.
17
18
8-bit
Microprocessors
Intel 8008
Introduced in 1972.
It was first 8-bit µP.
Its clock speed was
500 KHz.
Could execute
50,000 instructions
per second.
19
Intel 8080
Introduced in 1974.
It was also 8-bit µP.
Its clock speed was
2 MHz.
It had 6,000
transistors.
20
Intel 8085
Introduced in 1976.
It was also 8-bit µP.
Its clock speed was 3 MHz.
Its data bus is 8-bit and address
bus is 16-bit.
It had 6,500 transistors.
Could execute 7,69,230
instructions per second.
It could access 64 KB of memory.
It had 246 instructions.
21
22
16-bit
Microprocessors
INTEL 8086
 Introduced in 1978.
 It was first 16-bit µP.
 Its clock speed is 4.77 MHz, 8 MHz
and 10 MHz, depending on the
version.
 Its data bus is 16-bit and address
bus is 20-bit.
 It had 29,000 transistors.
 Could execute 2.5 million
instructions per second.
 It could access 1 MB of memory.
 It had 22,000 instructions.
 It had Multiply and Divide
instructions.
INTEL 8088
 Introduced in 1979.
 It was also 16-bit µP.
 It was created as a
cheaper version of
Intel’s 8086.
 It was a 16-bit processor
with an 8-bit external
bus.
20
INTEL 80186 & 80188
 Introduced in 1982.
 They were 16-bit µPs.
 Clock speed was 6 MHz.
 80188 was a cheaper
version of 80186 with an
8-bit external data bus.
INTEL 80286
 Introduced in 1982.
 It was 16-bit µP.
 Its clock speed was 8
MHz.
 Its data bus is 16-bit
and address bus is 24-
bit.
 It could address 16 MB
of memory.
 It had 1,34,000
transistors.
22
32-BIT
MICROPROCESSORS
INTEL 80386
 Introduced in 1986.
 It was first 32-bit µP.
 Its data bus is 32-bit and
address bus is 32- bit.
 It could address 4 GB of
memory.
 It had 2,75,000
transistors.
 Its clock speed varied
from 16 MHz to 33 MHz
depending upon the
various versions.
24
INTEL 80486
 Introduced in 1989.
 It was also 32-bit µP.
 It had 1.2 million
transistors.
 Its clock speed varied
from 16 MHz to 100
MHz depending upon
the various versions.
 8 KB of cache memory
was introduced.
29
INTEL PENTIUM
 Introduced in 1993.
 It was also 32-bit µP.
 It was originally named
80586.
 Its clock speed was 66
MHz.
 Its data bus is 32-bit
and address bus is 32-
bit.
30
INTEL PENTIUM PRO
 Introduced in 1995.
 It was also 32-bit µP.
 It had 21 million
transistors.
 Cache memory:
 8 KB for instructions.
 8 KB for data.
31
INTEL PENTIUM II
 Introduced in 1997.
 It was also 32-bit µP.
 Its clock speed was 233
MHz to 500 MHz.
 Could execute 333
million instructions per
second.
32
INTEL PENTIUM II XEON
 Introduced in 1998.
 It was also 32-bit µP.
 It was designed for
servers.
 Its clock speed was 400
MHz to 450 MHz.
33
INTEL PENTIUM III
 Introduced in 1999.
 It was also 32-bit µP.
 Its clock speed varied
from 500 MHz to 1.4
GHz.
 It had 9.5 million
transistors.
INTEL PENTIUM IV
 Introduced in 2000.
 It was also 32-bit µP.
 Its clock speed was from
1.3 GHz to 3.8 GHz.
 It had 42 million
transistors.
INTEL DUAL CORE
 Introduced in 2006.
 It is 32-bit or 64-bit µP.
64-BIT
MICROPROCESSORS
Intel Core 2 Intel Core i3
INTEL CORE I5 INTEL CORE I7
Basic Terms
• Bit: A digit of the binary number { 0 or 1 }
• Nibble: 4 bit Byte: 8 bit word: 16 bit
• Double word: 32 bit
• Data: binary number/code operated by an
instruction
• Address: Identification number for memory
locations
• Clock: square wave used to synchronize various
devices in µP
• Memory Capacity = 2^n ,
n->no. of address lines
41
BUS CONCEPT
• BUS: Group of conducting lines that carries data ,
address & control signals.
CLASSIFICATION OF BUSES:
1. DATA BUS: group of conducting lines that carries
data.
2. ADDRESS BUS: group of conducting lines that
carries address.
3. CONTROL BUS: group of conducting lines that
carries control signals {RD, WR etc}
CPU BUS: group of conducting lines that directly
connected to µP
SYSTEM BUS: group of conducting lines that carries
data , address & control signals in aµP system 42
TRISTATE LOGIC
3 logic levels are:
•High State (logic 1)
•Low state (logic 0)
•High Impedance state
High Impedance: output is not being driven to any defined
logic level by the output circuit.
43
Basic Microprocessors System
Input
Devices
s
Proce sing
Data into
Information
Output
Devices
Control
Unit
Secondary Storage Devices
Arithmetic-
Logic
Unit
Primary Storage Unit
Central Processing Unit
Keyboard,
Mouse etc
Monitor
Printer
Disks, Tapes, Optical Disks
40
UNIT
45
1
8085
PROCESSOR
46
8085
PIN DIAGRAM &
ARCHITECTURE
PIN CONFIGURATION
4
Pin 1 and Pin 2 (Input)
These are also
called Crystal Input
Pins.
8085 can generate
clock signals
internally.
To generate clock
signals internally,
8085 requires
external inputs from
X1& X2 pins
RESET IN and RESET OUT
4
Pin 36 (Input) and Pin 3
(Output)
RESET IN:
◦ It is used to reset the
microprocessor.
◦ It is active low signal.
◦ When the signal on this pin is low
for at least 3 clocking cycles, it
forces the microprocessor to reset
itself.
RESET IN and RESET OUT
4
Pin 36 (Input) and Pin 3
(Output)
Resetting the
microprocessor means:
◦ Clearing the PC and IR.
◦ Disabling all interrupts (except
TRAP).
◦ Disabling the SOD pin.
◦ All the buses (data, address,
control) are tri- stated.
◦ Gives HIGH output to RESET OUT
pin.
RESET IN and RESET OUT
4
Pin 36 (Input) and Pin 3
(Output)
RESET OUT:
◦ It is used to reset the peripheral devices and
other ICs on the circuit.
◦ It is an output signal.
◦ It is an active high signal.
◦ The output on this pin goes high whenever
RESET IN is given low signal.
◦ The output remains high as long as RESET IN
is kept low.
SID and SOD
Pin 4 (Input) and Pin 5
(Output)
SID (Serial Input Data):
o It takes 1 bit input from serial port
of 8085.
o Stores the bit at the 8th position
(MSB) of the Accumulator.
o RIM (Read Interrupt Mask)
instruction is used to transfer the
bit.
52
SID and SOD
Pin 4 (Input) and Pin 5
(Output)
SOD (Serial Output Data):
o It takes 1 bit from Accumulator to
serial port of 8085.
o Takes the bit from the 8th position
(MSB) of the Accumulator.
o SIM (Set Interrupt Mask) instruction is
used to transfer the bit.
53
Interrupt Pins
54
 Interrupt:
• It means interrupting the normal execution of the
microprocessor.
• When microprocessor receives interrupt signal, it
discontinues whatever it was executing.
• It starts executing new program indicated by the interrupt
signal.
• Interrupt signals are generated by external peripheral
devices.
• After execution of the new program, microprocessor goes
back to the previous program.
Sequence of Steps Whenever There
is an Interrupt
55
 Microprocessor completes execution of
current instruction of the program.
 PC contents are stored in stack.
 PC is loaded with address of the new
program.
 After executing the new program, the
microprocessor returns back to the previous
program.
 It goes to the previous program by reading the
top value of stack.
Five Hardware Interrupts in 8085
56
 TRAP
 RST
7.5
 RST
6.5
 RST
5.5
Classification of
Interrupts
57
 Maskable and Non-Maskable
 Vectored and Non-Vectored
 EdgeTriggered and Level
Triggered
 Priority Based Interrupts
Maskable
Interrupts
58
 Maskable interrupts are those
interrupts which can be enabled or
disabled.
 Enabling and Disabling is done by
software instructions.
Maskable
Interrupts
59
 List of Maskable
Interrupts:
• RST 7.5
• RST 6.5
• RST 5.5
• INTR
Non-Maskable Interrupts
60
 The interrupts which are always in
enabled mode are called non-
maskable interrupts.
 These interrupts can never be
disabled by any software
instruction.
 TRAP is a non-maskable interrupt.
Vectored Interrupts
61
 The interrupts which have fixed
memory location for transfer of
control from normal execution.
 Each vectored interrupt points to the
particular location in memory.
Vectored Interrupts
62
 List of vectored
interrupts:
• RST 7.5
• RST 6.5
• RST 5.5
• TRAP
Vectored Interrupts
63
 The addresses to which program
control goes:
 Absolute address is calculated by
multiplying the RST value with
0008 H.
Name Vectored Address
RST 7.5 003C H (7.5 x 0008 H)
RST 6.5 0034 H (6.5 x 0008 H)
RST 5.5 002C H (5.5 x 0008 H)
TRAP 0024 H (4.5 x 0008 H)
Non-Vectored Interrupts
64
 The interrupts which don't have
fixed memory location for transfer
of control from normal execution.
 The address of the memory location
is sent along with the interrupt.
 INTR is a non-vectored interrupt.
Edge TriggeredInterrupts
65
 The interrupts which are triggered
at leading or trailing edge are
called edge triggered interrupts.
 RST 7.5 is an edge triggered
interrupt.
 It is triggered during the leading
(positive) edge.
Level TriggeredInterrupts
66
 The interrupts which are triggered at
high or low level are called level
triggered interrupts.
 RST 6.5
 RST 5.5
 INTR
 TRAP is edge and level triggered
interrupt.
Priority Based Interrupts
67
 Whenever there exists a
simultaneous request at two or more
pins then the pin with higher priority
is selected by the microprocessor.
 Priority is considered only when there
are simultaneous requests.
Priority Based Interrupts
68
 Priority of
interrupts:
Interrupt Priority
TRAP 1
RST 7.5 2
RST 6.5 3
RST 5.5 4
INTR 5
TRAP
Pin 6 (Input)
It is an non-maskable interrupt.
It has the highest priority.
It cannot be disabled.
It is both edge and level triggered.
It means TRAP signal must go from
low to high.
And must remain high for a certain
period of time.
TRAP is usually used for power
failure and emergency shutoff.
69
RST 7.5
Pin 7 (Input)
It is a maskable interrupt.
It has the second highest
priority.
It is positive edge
triggered only.
The internal flip-flop is
triggered by the rising
edge.
The flip-flop remains high
until it is cleared by RESET
IN.
70
RST 6.5
Pin 8 (Input)
It is a maskable
interrupt.
It has the third highest
priority.
It is level triggered only.
The pin has to be held
high for a specific period
of time.
RST 6.5 can be
enabled by EI
instruction.
It can be disabled by DI
instruction. 71
RST 5.5
Pin 9
(Input)
 It is a maskable
interrupt.
 It has the fourth
highest priority.
 It is also level
triggered.
 The pin has to be held
high for a specific
period of time.
 This interrupt is very
similar to RST 6.5.
72
INTR
Pin 10 (Input)
It is a maskable
interrupt.
It has the lowest
priority.
It is also level triggered.
It is a general purpose
interrupt.
By general purpose we
mean that it can be used
to vector
microprocessor to any
specific subroutine 73
INTA
Pin 11 (Output)
It stands for interrupt
acknowledge.
It is an out going signal.
It is an active low signal.
Low output on this pin
indicates that
microprocessor has
acknowledged the INTR
request.
74
Address and Data
Pins
75
 Address Bus:
• The address bus is used to send
address to memory.
• It selects one of the many locations in
memory.
• Its size is 16-bit.
Address and Data
Pins
76
 Data Bus:
• It is used to transfer data
between microprocessor and
memory.
• Data bus is of 8-bit.
AD0 –AD7
Pin 19-12 (Bidirectional)
These pins serve the dual purpose of
transmitting lower order address and data
byte.
During 1st clock cycle, these pins act as
lower half of address.
In remaining clock cycles, these pins act as
data bus.
The separation of lower order address and
data is done by address latch.
77
A8 –A15
Pin 21-28 (Unidirectional)
These pins carry the higher
order of address bus.
The address is sent from
microprocessor to memory.
These 8 pins are switched to
high impedance state during
HOLD and RESET mode.
78
A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0
0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0
0 0 2 C
D7 D6 D5 D4 D3 D2 D1 D0
0 0 1 0 1 1 0 1
2 D
ALE
Pin 30 (Output)
It is used to enable Address
Latch.
It indicates whether bus
functions as address bus or
data bus.
If ALE = 1 then
◦ Bus functions as address bus.
If ALE = 0 then
◦ Bus functions as data bus.
80
S0 and S1
Pin 29 (Output) and Pin 33
(Output)
S0 and S1 are called Status Pins.
They tell the current operation
which is in progress in 8085.
S0 S1 Operation
0 0 Halt
0 1 Write
1 0 Read
1 1 Opcode Fetch
81
IO/M
7
Pin 34 (Output)
This pin tells whether
I/O or memory
operation is being
performed.
If IO/M = 1 then
◦ I/O operation is being performed.
If IO/M = 0 then
◦ Memory operation is being performed.
IO/M
Pin 34 (Output)
The operation being performed is
indicated by S0 and S1.
If S0 = 0 and S1 = 1 then
◦ It indicates WRITE operation.
If IO/M = 0 then
◦ It indicates Memory operation.
Combining these two we get Memory
Write
Operation.
83
Table Showing IO/M, S0, S1 and
Corresponding Operations
Operations IO/M S0 S1
Opcode Fetch 0 1 1
Memory Read 0 1 0
Memory Write 0 0 1
I/O Read 1 1 0
I/OWrite 1 0 1
InterruptAck. 1 1 1
Halt High Impedance 0 0
84
RD
Pin 32 (Output)
RD stands for Read.
It is an active low signal.
It is a control signal used for
Read operation either from
memory or from Input device.
A low signal indicates that
data on the data bus must be
placed either from selected
memory location or from input
device.
85
WR
Pin 31 (Output)
WR stands for Write.
It is also active low signal.
It is a control signal used for
Write operation either into
memory or into output device.
A low signal indicates that data
on the data bus must be written
into selected memory location
or into output device.
86
READY
Pin 35 (Input)
This pin is used to
synchronize slower
peripheral devices with fast
microprocessor.
A low value causes the
microprocessor to enter into
wait state.
The microprocessor
remains in wait state until
the input at this pin goes
high.
87
HOLD
Pin 38 (Input)
HOLD pin is used to request the
microprocessor for DMA transfer.
A high signal on this pin is a
request to microprocessor to
relinquish the hold on buses.
This request is sent by DMA
controller.
Intel 8257 and Intel 8237 are two
DMA controllers.
88
HLDA
Pin 39 (Output)
HLDA stands for Hold
Acknowledge.
The microprocessor uses this pin
to acknowledge the receipt of
HOLD signal.
When HLDA signal goes high,
address bus, data bus, RD, WR,
IO/M pins are tri- stated.
This means they are cut-off from
external environment.
89
HLDA
Pin 39 (Output)
The control of these buses goes to
DMA Controller.
Control remains at DMA Controller
until HOLD is held high.
When HOLD goes low, HLDA also
goes low and the microprocessor
takes control of the buses.
90
VSS and VCC
Pin 20 (Input) and Pin 40
(Input)
 +5V power supply is
connected to VCC.
Ground signal is
connected to VSS.
91
THE 8085 AND ITS BUSSES
The 8085 is an 8-bit general purpose
microprocessor that can address 64K Byte of
memory.
It has 40 pins and uses +5V for power. It can
run at a maximum frequency of 3 MHz.
-The pins on the chip can be grouped into 6
groups:
Address Bus.
Data Bus.
Control and Status Signals.
Power supply and frequency.
Externally Initiated Signals.
Serial I/O ports. 88
The Address and Data Busses
 The address bus has 8 signal lines A8 – A15 which are
unidirectional.
 The other 8 address bits are multiplexed (time shared)
with the 8 data bits.
 So, the bits AD0 – AD7 are bi-directional and serve
as A0 – A7 and D0 – D7 at the same time.
During the execution of the instruction, these
lines carry the address bits during the early part,
then during the late parts of the execution, they
carry the 8 data bits.
 In order to separate the address from the data, we
can use a latch to save the value before the function
of the bits changes. 89
94
Flag Register
D7 D6 D5 D4 D3 D2 D1 D0
S Z AC P CY
95
The flags are affected by the arithmetic and logical
instruction
Accumulator
 It is an 8 bit register
 For any arithmetic and logical instruction one of the
data should be in this register
 It is used for storing the result of any arithmetic and
logical manipulations.
 It is also called as A register
 All the data which are sent to I/O devices are sent via
A register.
96
Temporary register
 It is used to hold the data during the
operation of arithmetic and logical
operation
97
Sign Flag
 If the D7 bit of the accumulator is set then
this flag is set i.e 1 meaning that the result
is in negative.
 Ex. 7-8 = -1
98
100
Carry flag
 During the arithmetic operation if a carry occurs then
this flag is set.
 Ex. F1+1F= 1 10
Carry
99
1111 0001
1111 0001
11110 0010
Zero flag
During the arithmetic/ logical
operation if the result is zero then
this flag is set.
Ex. FF-FF = 00
100
1 1 1 1 1 1 1 1
1 1 1 1 1 1 11
1 0 0 0 0 0 0 0 0
Parity flag
 After the of the arithmetic and logical
operation if the result is even then this flag
is set.
 Ex. 0A-+0A = 14
101
0000 1010
0000 1010
0001 0100
Auxiliary carry flag
 During BCD arithmetic operation when a carry is
generated by D3 bit and passed on to D4 bit then
this flag is set.
 Ex. 1F+11 = 0001 1111 +0001 0001
 = 0010 0000
102
103
104
105
Control and status signals
Machine Cycle IO/M S1 S0
Opcode fetch 0 1 1
Memory read 0 1 0
Memory write 0 0 1
I/O read 1 1 0
I/O write 1 0 1
106
107
Program Counter
It is a 16 bit register
It is used to point out the address
of the next instruction which is to
be executed
108
Stack pointer
 It is a 16 bit register
 It points the starting address of the stack
.
109
Register Array
 B, C, D, E, H and L are general purpose
register
 All are 8 bit register
 If the are combined as BC, DE and HL
they can store 16 bit data
110
111
Memory
organization
8085 Communication with Memory
112
 Involves the following three steps
1. Identify the memory location (with address)
2. Generate Timing & Control signals
3. Data transfer takes place
Example: Memory Read Operation
1
113
2
3
8085 Interfacing with Memory chips
Memory
Chip
Address
8085
Data
Control
Address
114
Memory
Interface
Data
Control
8085 Interfacing with Memory chips
8085
Memory
Memory
Chip
AD0-AD7
Control
A0 –A7
Data
74LS373
A8-A15 A8-A15
111
Interface
ALE
8085 Interfacing with Memory chips
8085
Memory
Interface
Program
Memory
AD0-AD7
IO/M
A0 – A7
Data
74LS373
A8-A15 A8-A15
ALE
RD
RD
CS
112
I/O ports &
Data
transfer
concepts 113
Interfacing I/O devices with 8085
8085
I/O
Interface
I/O
Devices
Memory
Interface
Memory
Devices
System Bus
118
Techniques for I/O Interfacing
119
 Memory-mapped I/O
 Peripheral-mapped I/O
Memory-mapped I/O
120
 8085 uses its 16-bit address bus to identify a
memory location
 Memory address space: 0000H to FFFFH
 8085 needs to identify I/O devices also
 I/O devices can be interfaced using
addresses from memory space
 8085 treats such an I/O device as a memory
location
 This is called Memory-mapped I/O
Peripheral-mapped I/O
121
 8085 has a separate 8-bit addressing scheme
for I/O devices
 I/O address space: 00H to FFH
 This is called Peripheral-mapped I/O or I/O-
mapped I/O
8085 Communication with I/O devices
122
 Involves the following three steps
1. Identify the I/O device (with address)
2. Generate Timing & Control signals
3. Data transfer takes place
 8085 communicates with a I/O device only if
there is a Program Instruction to do so
1.Identify the I/O device (with address)
123
1. Memory-mapped I/O (16-bit address)
2. Peripheral-mapped I/O (8-bit address)
2.Generate Timing & Control Signals
 Memory-mapped I/O
 Reading Input: IO/M = 0, RD = 0
 Write to Output: IO/M = 0, WR = 0
 Peripheral-mapped I/O
 Reading Input: IO/M = 1, RD = 0
 Write to Output: IO/M = 1, WR = 0
3. Data transfer takes place
124
8085 Communication with I/O devices
125
 Involves the following three steps
 Identify the I/O device (with address)
 Generate Timing & Control signals
 Data transfer takes place
 8085 communicates with a I/O device only if
there is a Program Instruction to do so
Peripheral I/O Instructions
126
 IN Instruction
 Inputs data from input device into the
accumulator
 It is a 2-byte instruction
 Format: IN 8-bit port address
 Example: IN 01H
 OUT Instruction
 Outputs the contents of accumulator to an
output device
 It is a 2-byte instruction
 Format: OUT 8-bit port address
 Example: OUT 02H
127
----------Example Program----------
128
 WAP to read a number from input port (port
address 01H) and display it on ASCII display
connected to output port (port address 02H)
IN 01H ;reads data value 03H (example)into
;accumulator, A = 03H
MVI B, 30H;loads register B with 30H
ADD B
OUT 02H
;A = 33H, ASCII code for 3
;display 3 on ASCII display
Memory-mapped I/O Instructions
129
 I/O devices are identified by 16-bit addresses
 8085 communicates with an I/O device as if it
were one of the memory locations
 Memory related instructions are used
 For e.g. LDA, STA
 LDA 8000H
 Loads A with data read from input device with
16-bit address 8000H
 STA 8001H
 Stores (Outputs) contents of A to output
device with 16-bit address 8001H
----------Example Program----------
130
 WAP to read a number from input port (port
address 8000H) and display it on ASCII
display connected to output port (port
address 8001H)
LDA 8000H;reads data value 03H (example)into
;accumulator, A = 03H
MVI B, 30H;loads register B with 30H
ADD B ;A = 33H, ASCII code for 3
STA 8001H;display 3 on ASCII display
131
Timing
Diagram
of 8085
132
Timing Diagram is a graphical representation. It
represents the execution time taken by each
instruction in a graphical format. The execution
time is represented in T-states.
Instruction Cycle:
The time required to execute an instruction .
Machine Cycle:
The time required to access the memory or
input/output devices .
T-State:
•The machine cycle and instruction cycle takes
multiple clock periods.
•A portion of an operation carried out in one
system clock period is called as T-state.
133
134
Timing diagrams
• The 8085 microprocessor has 7 basic machine
cycle. They are
1.Op-code Fetch cycle(4T or 6T).
2.Memory read cycle (3T)
3.Memory write cycle(3T)
4.I/O read cycle(3T)
5.I/O write cycle(3T)
6.Interrupt Acknowledge cycle(6T or 12T)
7.Bus idle cycle
135
1.Opcode fetch cycle(4T or 6T)
136
137
OPCODE FETCH
• The Opcode fetch cycle, fetches the instructions from memory
and delivers it to the instruction register of the microprocessor
• Opcode fetch machine cycle consists of 4 T-states.
T1 State:
During the T1 state, the contents of the program counter are
placed on the 16 bit address bus. The higher order 8 bits are
transferred to address bus (A8-A15) and lower order 8 bits are
transferred to multiplexed A/D (AD0-AD7) bus.
ALE (address latch enable) signal goes high. As soon as
ALE goes high, the memory latches the AD0-AD7 bus. At
the middle of the T state the ALE goes low
138
T2 State:
During the beginning of this state, the RD’ signal goes low
to enable memory. It is during this state, the selected memory
location is placed on D0-D7 of the Address/Data multiplexed
bus.
T3 State:
In the previous state the Opcode is placed in D0-D7 of the A/D
bus. In this state of the cycle, the Opcode of the A/D bus is
transferred to the instruction register of the microprocessor.
Now the RD’ goes high after this action and thus disables the
memory from A/D bus.
T4 State:
In this state the Opcode which was fetched from the memory
is decoded.
2. Memory read cycle (3T)
139
was obtained from the memory is then decoded.
• These machine cycles have 3 T-states.
T1 state:
• The higher order address bus (A8-A15) and lower order address
and data multiplexed (AD0-AD7) bus. ALE goes high so that the
memory latches the (AD0-AD7) so that complete 16-bit address
are available.
The mp identifies the memory read machine cycle from the status
signals IO/M’=0, S1=1, S0=0. This condition indicates the
memory read cycle.
T2 state:
• Selected memory location is placed on the (D0-D7) of the A/D
multiplexed bus. RD’ goes LOW
T3 State:
• The data which was loaded on the previous state is transferred
to the microprocessor. In the middle of the T3 state RD’ goes
high and disables the memory read operation. The data which
136
3. Memory write cycle (3T)
141
142
• These machine cycles have 3 T-states.
T1 state:
• The higher order address bus (A8-A15) and lower order address
and data multiplexed (AD0-AD7) bus. ALE goes high so that the
memory latches the (AD0-AD7) so that complete 16-bit address
are available.
The mp identifies the memory read machine cycle from the status
signals IO/M’=0, S1=0, S0=1. This condition indicates the
memory read cycle.
T2 state:
• Selected memory location is placed on the (D0-D7) of the A/D
multiplexed bus. WR’ goes LOW
T3 State:
• In the middle of the T3 state WR’ goes high and disables the
memory write operation. The data which was obtained from
the memory is then decoded.
4.I/O read cycle(3T)
143
5.I/O write cycle(3T)
144
STA instruction
ex: STA 526A
145
146
It require 4 m/c cycles
13 T states
1.opcode fetch(4T)
2.memory
read(3T)
3.memory
read(3T)
4.Memory
write(3T)
147
148
Timing diagram for IN C0H
• Fetching the Opcode DBH from the memory
4125H.
• Read the port address C0H from 4126H.
• Read the content of port C0H and send it to
the accumulator.
• Let the content of port is 5EH.
145
It require 3 m/c cycles
10 T states
opcode fetch(4T)
memory read(3T) I/O
read(3T)
150
151
OUT
instruction Machines
Cycles(10T):
1.instruction fetch(4T)
2.memory read (3T)
3.IO write (3T)
152
Timing diagram for MVI B, 43h
• Fetching the Opcode 06H from the memory
2000H. (OF machine cycle)
• Read (move) the data 43H from memory
2001H. (memory read)
153
154
INR M
155
ADD M
156
8085
157
Interrupts
8085 Interrupts
8085 has five interrupt inputs
1. TRAP
2. RST7.5
3. RST 6.5
4. RST5.5
5. INTR
158
U7
8085
1
2
5
6
9
8
7
10
11
29
33
39
36
35
12
13
14
15
16
17
18
19
21
22
23
24
25
26
27
28
30
31
32
34
3
37
4
38
40
20
VCC
HOLD
HLDA
CLKO
RST-IN
READY
IO/M
S1
RD
WR
ALE
S0
A15
A14
A13
A12
A11
A10 A9
A8
X1 X2
RST-OT
SOD
SID
TRAP
RST 7.5
RST 6.5
RST 5.5
INTR
INTA
AD0
AD1
AD2
AD3
AD4
AD5
AD6
AD7
VSS
Interrupt pins of 8085 155
Types of Interrupts
• Interrupts of 8085 can be classified as
– Maskable (RST 7.5, RST 6.5, RST 5.5, INTR)
– Non-maskable (TRAP)
• An interrupt is a request for attention/service
• 8085 may choose to service/not-service a
maskable interrupt
• 8085 cannot ignore a service request from a
non-maskable interrupt
160
Interrupt process
• 8085 is executing its main program
• an interrupt is generated by an external
device
• 8085 pauses execution of main program
• 8085 calls the Interrupt service routine
• 8085 executes the Interrupt service routine
• 8085 returns to execution of main program
(from where it was paused)
161
Example: Blinking LED Display with
Interrupt-based Display-Pattern change
Input
Switches
LED
Display
RST 7.5
8085
(Display-Pattern)
Interrupt Switch
162
Peripheral-mapped I/O
Interrupt I/O
Interrupt Service Routine (ISR)
• It is a subroutine
• 8085 calls an ISR in response to an
interrupt request by an external device
• ISRs must be located in memory at pre-
determined addresses known as Interrupt
Vectors
163
Interrupt Vector Table of 8085
164
Interrupt Interrupt Vector
TRAP 0024H
RST 7.5 003CH
RST 6.5 0034H
RST 5.5 002CH
Please Note: INTR is a non-vectored interrupt
Using Vectored Interrupts of 8085
• By default, all the vectored interrupts (except
TRAP) of 8085 are disabled
• 8085 vectored interrupts are enabled with
two instructions: EI and SIM
• EI (Enable Interrupt): 1-byte instruction that
sets the Interrupt Enable flip-flop
– It is internal to the processor & can be set or reset
by using software instructions
165
Using Vectored Interrupts
Step-1
•Set Interrupt Enable flip-flop by using EI
instruction to enable the interrupt process
Step-2
•Use SIM (Set Interrupt Mask) instruction to
set mask for RST 7.5, 6.5 and 5.5 interrupts
166
SIM Instruction
• It is a 1-byte instruction
• Reads Accumulator contents
• Enables/Disables interrupts accordingly
• Used for three different functions
– Set mask for RST 7.5, 6.5, 5.5 interrupts
– Additional control for RST 7.5
– Implement serial I/O
167
Accumulator bit pattern for SIM
D7 D6 D5 D4 D3 D2 D1 D0
SOD SDE XXX R7.5 MSE M7.5 M6.5 M5.5
0 = Available, 1 = Masked
Mask Set Enable, 0 = bits 0-2
ignored
1 = mask is set
IF 1, RESET RST 7.5
If 1, bit 7 is output to serial output
data latch
Serial Output Data, ignored if bit 6 = 0
Presented by C.GOKUL,AP/EEE Velalar College of Engg & Tech , Erode
164
8085 Interrupt process for
Vectored-Interrupts
1. Enables Interrupt process by writing the EI
instruction in the main program
2. Set interrupt mask using SIM instruction
3. 8085 monitors the status of all interrupt
lines during the execution of each
instruction
169
4. When 8085 detects an interrupt signal from
an external device
• It completes execution of current
instruction
• Disables the Interrupt Enable flip-flop
5. Executes a CALL to Interrupt Vector
location for that interrupt
• Before the CALL is made, 8085 stores
return address in main program on stack
170
8085 Interrupt process for
Vectored-Interrupts (Cont.)
6. 8085 executes the ISR written at the
specified interrupt vector location
• ISR should include the EI instruction to
Enable Interrupt again
• At the end of ISR, RET instruction
transfers the program control back to the
main program
171
Presented by C.GOKUL,AP/EEE Velalar College of Engg & Tech , Erode
8085 Interrupt process for
Vectored-Interrupts (Cont.)
Differentiate between the following instructions clearly
(i)Push and POP
(ii)CALL and Jump
(iii)ADD and ADC
(iv)INC and INX
(v)MOVB,B and MOVB,A
(vi)What is the general format of an 8085 instruction set?
https://www.electrical4u.com/electrical-
mcq.php?subject=microprocessor&page=1
https://electricalvoice.com/8085-microprocessor-mcqs/
https://www.digimat.in/nptel/courses/video/108105102/L01.html
https://www.youtube.com/watch?v=liRPtvj7bFU
https://nptel.ac.in/courses/108/105/108105102/
https://questions.examside.com/past-years/gate/question/in-the-8085-
microprocessor-the-rst6-instruction-transfers-th-gate-ece-2000-marks-
1-5a104b2ba3b5f.htm

More Related Content

What's hot

Microcontroller presentation
Microcontroller presentationMicrocontroller presentation
Microcontroller presentationxavierpaulino
 
Micro Processor And Micro controller
Micro Processor And Micro controller Micro Processor And Micro controller
Micro Processor And Micro controller Raja pirian
 
microcontroller basics
microcontroller basicsmicrocontroller basics
microcontroller basicssagar Ramdev
 
20838382 microprocessor-8085-notes
20838382 microprocessor-8085-notes20838382 microprocessor-8085-notes
20838382 microprocessor-8085-notesManikanteswar Madala
 
microcontroller-8051-ppt(1)
microcontroller-8051-ppt(1)microcontroller-8051-ppt(1)
microcontroller-8051-ppt(1)jhcid
 
Microprocessor 8086
Microprocessor 8086Microprocessor 8086
Microprocessor 8086Waleed Khan
 
Motorola 68hc11
Motorola 68hc11Motorola 68hc11
Motorola 68hc11gajani121
 
Microprocessor and Microcontroller lec1
Microprocessor and Microcontroller lec1Microprocessor and Microcontroller lec1
Microprocessor and Microcontroller lec1Ameen San
 
Microprocessor vs. microcontroller
Microprocessor vs. microcontrollerMicroprocessor vs. microcontroller
Microprocessor vs. microcontrolleraviban
 
8085 microprocessor ramesh gaonkar
8085 microprocessor   ramesh gaonkar8085 microprocessor   ramesh gaonkar
8085 microprocessor ramesh gaonkarSAQUIB AHMAD
 
8051 microcontroller and embedded system
8051 microcontroller and embedded system8051 microcontroller and embedded system
8051 microcontroller and embedded systemsb108ec
 
Microprocessor and Application (8085)
Microprocessor and Application (8085)Microprocessor and Application (8085)
Microprocessor and Application (8085)ufaq kk
 
Microprocessor & Micro-controller
Microprocessor & Micro-controllerMicroprocessor & Micro-controller
Microprocessor & Micro-controllerOm Bheda
 
M.sc I-sem-8086 notes
M.sc  I-sem-8086 notesM.sc  I-sem-8086 notes
M.sc I-sem-8086 notesDr.YNM
 
microprocessor and microcntroller
microprocessor and microcntrollermicroprocessor and microcntroller
microprocessor and microcntrollerjhcid
 
Solution manual the 8051 microcontroller based embedded systems
Solution manual the 8051 microcontroller based embedded systemsSolution manual the 8051 microcontroller based embedded systems
Solution manual the 8051 microcontroller based embedded systemsmanishpatel_79
 
microcontroller vs microprocessor
microcontroller vs microprocessormicrocontroller vs microprocessor
microcontroller vs microprocessorsobhadevi
 

What's hot (19)

Microcontroller presentation
Microcontroller presentationMicrocontroller presentation
Microcontroller presentation
 
Micro Processor And Micro controller
Micro Processor And Micro controller Micro Processor And Micro controller
Micro Processor And Micro controller
 
microcontroller basics
microcontroller basicsmicrocontroller basics
microcontroller basics
 
20838382 microprocessor-8085-notes
20838382 microprocessor-8085-notes20838382 microprocessor-8085-notes
20838382 microprocessor-8085-notes
 
microcontroller-8051-ppt(1)
microcontroller-8051-ppt(1)microcontroller-8051-ppt(1)
microcontroller-8051-ppt(1)
 
Microprocessor 8086
Microprocessor 8086Microprocessor 8086
Microprocessor 8086
 
Motorola 68hc11
Motorola 68hc11Motorola 68hc11
Motorola 68hc11
 
Microprocessor and Microcontroller lec1
Microprocessor and Microcontroller lec1Microprocessor and Microcontroller lec1
Microprocessor and Microcontroller lec1
 
Microprocessor vs. microcontroller
Microprocessor vs. microcontrollerMicroprocessor vs. microcontroller
Microprocessor vs. microcontroller
 
8085 microprocessor ramesh gaonkar
8085 microprocessor   ramesh gaonkar8085 microprocessor   ramesh gaonkar
8085 microprocessor ramesh gaonkar
 
8051 microcontroller and embedded system
8051 microcontroller and embedded system8051 microcontroller and embedded system
8051 microcontroller and embedded system
 
8085 microprocessor
8085 microprocessor8085 microprocessor
8085 microprocessor
 
Microprocessor and Application (8085)
Microprocessor and Application (8085)Microprocessor and Application (8085)
Microprocessor and Application (8085)
 
Microprocessor & Micro-controller
Microprocessor & Micro-controllerMicroprocessor & Micro-controller
Microprocessor & Micro-controller
 
M.sc I-sem-8086 notes
M.sc  I-sem-8086 notesM.sc  I-sem-8086 notes
M.sc I-sem-8086 notes
 
microprocessor and microcntroller
microprocessor and microcntrollermicroprocessor and microcntroller
microprocessor and microcntroller
 
Solution manual the 8051 microcontroller based embedded systems
Solution manual the 8051 microcontroller based embedded systemsSolution manual the 8051 microcontroller based embedded systems
Solution manual the 8051 microcontroller based embedded systems
 
Introduction to 8085svv
Introduction to 8085svvIntroduction to 8085svv
Introduction to 8085svv
 
microcontroller vs microprocessor
microcontroller vs microprocessormicrocontroller vs microprocessor
microcontroller vs microprocessor
 

Similar to Unit 1

8085 manual NCIT SAROZ BISTA SIR
8085 manual NCIT SAROZ BISTA SIR8085 manual NCIT SAROZ BISTA SIR
8085 manual NCIT SAROZ BISTA SIRTHEE CAVE
 
TOPIC 2 - Evolution of Microprocessors.pptx
TOPIC 2 - Evolution of Microprocessors.pptxTOPIC 2 - Evolution of Microprocessors.pptx
TOPIC 2 - Evolution of Microprocessors.pptxENYUTU ELIA
 
history of microprocessor.pptx
history of microprocessor.pptxhistory of microprocessor.pptx
history of microprocessor.pptxCefLlamelo
 
Genesis & Progression of Processors in CPU
Genesis & Progression of Processors in CPUGenesis & Progression of Processors in CPU
Genesis & Progression of Processors in CPUAnkita Jangir
 
Introduction to microprocessor
Introduction to microprocessorIntroduction to microprocessor
Introduction to microprocessorKashyap Shah
 
Microprocessors & Microcomputers Lecture Notes
Microprocessors & Microcomputers Lecture NotesMicroprocessors & Microcomputers Lecture Notes
Microprocessors & Microcomputers Lecture NotesFellowBuddy.com
 
History of microprocessors copy
History of microprocessors   copyHistory of microprocessors   copy
History of microprocessors copyyvonne katsande
 
Evolution of intel 4004 to i9.pptx
Evolution of intel 4004 to i9.pptxEvolution of intel 4004 to i9.pptx
Evolution of intel 4004 to i9.pptxYashrajMalviya
 
8085-microprocessor
8085-microprocessor8085-microprocessor
8085-microprocessorjhcid
 
All processors
All processorsAll processors
All processorsALI RAZA
 
MICROPROCESSORS BASICS
MICROPROCESSORS BASICS MICROPROCESSORS BASICS
MICROPROCESSORS BASICS Prakash Rao
 
Microprocessor and Positive and Negative Logic
Microprocessor and Positive and Negative LogicMicroprocessor and Positive and Negative Logic
Microprocessor and Positive and Negative LogicAnil Loutombam
 
microprocessor unit1 2022.pptx
microprocessor unit1 2022.pptxmicroprocessor unit1 2022.pptx
microprocessor unit1 2022.pptx22X041SARAVANANS
 
Intel Microprocessor
Intel MicroprocessorIntel Microprocessor
Intel MicroprocessorHome
 
Microprocessor Introduction
Microprocessor IntroductionMicroprocessor Introduction
Microprocessor IntroductionNaveen Dubey
 
Introduction to 8085 microprocessor
Introduction to 8085 microprocessorIntroduction to 8085 microprocessor
Introduction to 8085 microprocessorkunj desai
 
Microprocessors historical background
Microprocessors  historical backgroundMicroprocessors  historical background
Microprocessors historical backgroundHasnain Yaseen
 

Similar to Unit 1 (20)

8085 manual NCIT SAROZ BISTA SIR
8085 manual NCIT SAROZ BISTA SIR8085 manual NCIT SAROZ BISTA SIR
8085 manual NCIT SAROZ BISTA SIR
 
TOPIC 2 - Evolution of Microprocessors.pptx
TOPIC 2 - Evolution of Microprocessors.pptxTOPIC 2 - Evolution of Microprocessors.pptx
TOPIC 2 - Evolution of Microprocessors.pptx
 
history of microprocessor.pptx
history of microprocessor.pptxhistory of microprocessor.pptx
history of microprocessor.pptx
 
Genesis & Progression of Processors in CPU
Genesis & Progression of Processors in CPUGenesis & Progression of Processors in CPU
Genesis & Progression of Processors in CPU
 
Introduction to microprocessor
Introduction to microprocessorIntroduction to microprocessor
Introduction to microprocessor
 
Microprocessors & Microcomputers Lecture Notes
Microprocessors & Microcomputers Lecture NotesMicroprocessors & Microcomputers Lecture Notes
Microprocessors & Microcomputers Lecture Notes
 
History of microprocessors copy
History of microprocessors   copyHistory of microprocessors   copy
History of microprocessors copy
 
Evolution of intel 4004 to i9.pptx
Evolution of intel 4004 to i9.pptxEvolution of intel 4004 to i9.pptx
Evolution of intel 4004 to i9.pptx
 
8085-microprocessor
8085-microprocessor8085-microprocessor
8085-microprocessor
 
All processors
All processorsAll processors
All processors
 
MICROPROCESSORS BASICS
MICROPROCESSORS BASICS MICROPROCESSORS BASICS
MICROPROCESSORS BASICS
 
Microprocessor and Positive and Negative Logic
Microprocessor and Positive and Negative LogicMicroprocessor and Positive and Negative Logic
Microprocessor and Positive and Negative Logic
 
microprocessor unit1 2022.pptx
microprocessor unit1 2022.pptxmicroprocessor unit1 2022.pptx
microprocessor unit1 2022.pptx
 
8 bit microcontroller
8 bit microcontroller8 bit microcontroller
8 bit microcontroller
 
Intel Microprocessor
Intel MicroprocessorIntel Microprocessor
Intel Microprocessor
 
Microprocessor Introduction
Microprocessor IntroductionMicroprocessor Introduction
Microprocessor Introduction
 
Introduction to 8085 microprocessor
Introduction to 8085 microprocessorIntroduction to 8085 microprocessor
Introduction to 8085 microprocessor
 
Coa INTERUPT
Coa INTERUPTCoa INTERUPT
Coa INTERUPT
 
Microprocessors historical background
Microprocessors  historical backgroundMicroprocessors  historical background
Microprocessors historical background
 
8085
80858085
8085
 

Recently uploaded

HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 

Recently uploaded (20)

HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 

Unit 1

  • 1. EE8551 Microprocessors and Microcontrollers DEPARTMENTS: EEE {semester 05} Regulation : 2017 Presented by L.Padmanaban,AP/ECE PEC 1
  • 2. After completing the subject you will gain knowledge and will be eligible for the following post in an organization Electronics Engineer IOT Engineer Embedded system Engineer Embedded Trainer Embedded Developer Field Sales Executive Telecom Engineer Etc..
  • 3. To impart knowledge on the following Topics Architecture of µP8085 & µC 8051 Adresing modes & instruction set of 8085 & 8051. Need & use of Interrupt structure 8085 & 8051. Simple applications development with programming 8085 & 8051
  • 4. Ability to acquire knowledge in Addressing modes & instruction set of 8085 & 8051. Ability to explain the architecture of Microprocessor and Microcontroller. Ability to write the assembly language programme.
  • 5. Sl. No. Subject Description Level of Study 1 Digital Logic Circuits Data and number system, Boolean algebra, Combinational and Sequential circuits 3rd Semester
  • 7. 7 Microprocessor • Microprocessor (µP) is the “brain” of a computer that has been implemented on one semiconductor chip. • The word comes from the combination micro and processor. • Processor means a device that processes whatever(binary numbers, 0’s and 1’s) To process means to manipulate. It describes all manipulation. Micro - > extremely small
  • 8. 8 Definition of a Microprocessor. The microprocessor is a programmable device that takes in numbers, performs on them arithmetic or logical operations according to the program stored in memory and then produces other numbers as a result.
  • 9. 9 Microprocessor ? A microprocessor is multi programmable clock driven register based semiconductor device that is used to fetch , process & execute a data within fraction of seconds.
  • 10. 10 Applications • Calculators • Accounting system • Games machine • Instrumentation • Traffic light Control • Multi user, multi-function environments • Military applications • Communication systems
  • 13. 13 Development of Intel Microprocessors • 8086 - 1979 • 286 - 1982 • 386 - 1985 • 486 - 1989 • Pentium - 1993 • Pentium Pro - 1995 • Pentium MMX -1997 • Pentium II - 1997 • Pentium II Celeron - 1998 • Pentium II Zeon - 1998 • Pentium III - 1999 • Pentium III Zeon - 1999 • Pentium IV - 2000 • Pentium IV Zeon - 2001
  • 14. 14 GENERATION OF PROCESSORS Processor Bits Speed 8080 8 2 MHz 8086 16 4.5 – 10 MHz 8088 16 4.5 – 10 MHz 80286 16 10 – 20 MHz 80386 32 20 – 40 MHz 80486 32 40 – 133 MHz
  • 15. 15 GENERATION OF PROCESSORS Processor Bits Speed Pentium 32 60 – 233 MHz Pentium Pro 32 150 – 200 MHz Pentium II, Celeron , Xeon 32 233 – 450 MHz Pentium III, Celeron , Xeon 32 450 MHz – 1.4 GHz Pentium IV, Celeron , Xeon 32 1.3 GHz – 3.8 GHz Itanium 64 800 MHz – 3.0 GHz
  • 16. Intel 4004  Introduced in 1971.  It was the first microprocessor by Intel.  It was a 4-bit µP.  Its clock speed was 740KHz.  It had 2,300 transistors.  It could execute around 60,000 instructions per second. 16
  • 17. Intel 4040 Introduced in 1971. It was also 4-bit µP. 17
  • 19. Intel 8008 Introduced in 1972. It was first 8-bit µP. Its clock speed was 500 KHz. Could execute 50,000 instructions per second. 19
  • 20. Intel 8080 Introduced in 1974. It was also 8-bit µP. Its clock speed was 2 MHz. It had 6,000 transistors. 20
  • 21. Intel 8085 Introduced in 1976. It was also 8-bit µP. Its clock speed was 3 MHz. Its data bus is 8-bit and address bus is 16-bit. It had 6,500 transistors. Could execute 7,69,230 instructions per second. It could access 64 KB of memory. It had 246 instructions. 21
  • 23. INTEL 8086  Introduced in 1978.  It was first 16-bit µP.  Its clock speed is 4.77 MHz, 8 MHz and 10 MHz, depending on the version.  Its data bus is 16-bit and address bus is 20-bit.  It had 29,000 transistors.  Could execute 2.5 million instructions per second.  It could access 1 MB of memory.  It had 22,000 instructions.  It had Multiply and Divide instructions.
  • 24. INTEL 8088  Introduced in 1979.  It was also 16-bit µP.  It was created as a cheaper version of Intel’s 8086.  It was a 16-bit processor with an 8-bit external bus. 20
  • 25. INTEL 80186 & 80188  Introduced in 1982.  They were 16-bit µPs.  Clock speed was 6 MHz.  80188 was a cheaper version of 80186 with an 8-bit external data bus.
  • 26. INTEL 80286  Introduced in 1982.  It was 16-bit µP.  Its clock speed was 8 MHz.  Its data bus is 16-bit and address bus is 24- bit.  It could address 16 MB of memory.  It had 1,34,000 transistors. 22
  • 28. INTEL 80386  Introduced in 1986.  It was first 32-bit µP.  Its data bus is 32-bit and address bus is 32- bit.  It could address 4 GB of memory.  It had 2,75,000 transistors.  Its clock speed varied from 16 MHz to 33 MHz depending upon the various versions. 24
  • 29. INTEL 80486  Introduced in 1989.  It was also 32-bit µP.  It had 1.2 million transistors.  Its clock speed varied from 16 MHz to 100 MHz depending upon the various versions.  8 KB of cache memory was introduced. 29
  • 30. INTEL PENTIUM  Introduced in 1993.  It was also 32-bit µP.  It was originally named 80586.  Its clock speed was 66 MHz.  Its data bus is 32-bit and address bus is 32- bit. 30
  • 31. INTEL PENTIUM PRO  Introduced in 1995.  It was also 32-bit µP.  It had 21 million transistors.  Cache memory:  8 KB for instructions.  8 KB for data. 31
  • 32. INTEL PENTIUM II  Introduced in 1997.  It was also 32-bit µP.  Its clock speed was 233 MHz to 500 MHz.  Could execute 333 million instructions per second. 32
  • 33. INTEL PENTIUM II XEON  Introduced in 1998.  It was also 32-bit µP.  It was designed for servers.  Its clock speed was 400 MHz to 450 MHz. 33
  • 34. INTEL PENTIUM III  Introduced in 1999.  It was also 32-bit µP.  Its clock speed varied from 500 MHz to 1.4 GHz.  It had 9.5 million transistors.
  • 35. INTEL PENTIUM IV  Introduced in 2000.  It was also 32-bit µP.  Its clock speed was from 1.3 GHz to 3.8 GHz.  It had 42 million transistors.
  • 36. INTEL DUAL CORE  Introduced in 2006.  It is 32-bit or 64-bit µP.
  • 37.
  • 39. Intel Core 2 Intel Core i3
  • 40. INTEL CORE I5 INTEL CORE I7
  • 41. Basic Terms • Bit: A digit of the binary number { 0 or 1 } • Nibble: 4 bit Byte: 8 bit word: 16 bit • Double word: 32 bit • Data: binary number/code operated by an instruction • Address: Identification number for memory locations • Clock: square wave used to synchronize various devices in µP • Memory Capacity = 2^n , n->no. of address lines 41
  • 42. BUS CONCEPT • BUS: Group of conducting lines that carries data , address & control signals. CLASSIFICATION OF BUSES: 1. DATA BUS: group of conducting lines that carries data. 2. ADDRESS BUS: group of conducting lines that carries address. 3. CONTROL BUS: group of conducting lines that carries control signals {RD, WR etc} CPU BUS: group of conducting lines that directly connected to µP SYSTEM BUS: group of conducting lines that carries data , address & control signals in aµP system 42
  • 43. TRISTATE LOGIC 3 logic levels are: •High State (logic 1) •Low state (logic 0) •High Impedance state High Impedance: output is not being driven to any defined logic level by the output circuit. 43
  • 44. Basic Microprocessors System Input Devices s Proce sing Data into Information Output Devices Control Unit Secondary Storage Devices Arithmetic- Logic Unit Primary Storage Unit Central Processing Unit Keyboard, Mouse etc Monitor Printer Disks, Tapes, Optical Disks 40
  • 48. 4 Pin 1 and Pin 2 (Input) These are also called Crystal Input Pins. 8085 can generate clock signals internally. To generate clock signals internally, 8085 requires external inputs from X1& X2 pins
  • 49. RESET IN and RESET OUT 4 Pin 36 (Input) and Pin 3 (Output) RESET IN: ◦ It is used to reset the microprocessor. ◦ It is active low signal. ◦ When the signal on this pin is low for at least 3 clocking cycles, it forces the microprocessor to reset itself.
  • 50. RESET IN and RESET OUT 4 Pin 36 (Input) and Pin 3 (Output) Resetting the microprocessor means: ◦ Clearing the PC and IR. ◦ Disabling all interrupts (except TRAP). ◦ Disabling the SOD pin. ◦ All the buses (data, address, control) are tri- stated. ◦ Gives HIGH output to RESET OUT pin.
  • 51. RESET IN and RESET OUT 4 Pin 36 (Input) and Pin 3 (Output) RESET OUT: ◦ It is used to reset the peripheral devices and other ICs on the circuit. ◦ It is an output signal. ◦ It is an active high signal. ◦ The output on this pin goes high whenever RESET IN is given low signal. ◦ The output remains high as long as RESET IN is kept low.
  • 52. SID and SOD Pin 4 (Input) and Pin 5 (Output) SID (Serial Input Data): o It takes 1 bit input from serial port of 8085. o Stores the bit at the 8th position (MSB) of the Accumulator. o RIM (Read Interrupt Mask) instruction is used to transfer the bit. 52
  • 53. SID and SOD Pin 4 (Input) and Pin 5 (Output) SOD (Serial Output Data): o It takes 1 bit from Accumulator to serial port of 8085. o Takes the bit from the 8th position (MSB) of the Accumulator. o SIM (Set Interrupt Mask) instruction is used to transfer the bit. 53
  • 54. Interrupt Pins 54  Interrupt: • It means interrupting the normal execution of the microprocessor. • When microprocessor receives interrupt signal, it discontinues whatever it was executing. • It starts executing new program indicated by the interrupt signal. • Interrupt signals are generated by external peripheral devices. • After execution of the new program, microprocessor goes back to the previous program.
  • 55. Sequence of Steps Whenever There is an Interrupt 55  Microprocessor completes execution of current instruction of the program.  PC contents are stored in stack.  PC is loaded with address of the new program.  After executing the new program, the microprocessor returns back to the previous program.  It goes to the previous program by reading the top value of stack.
  • 56. Five Hardware Interrupts in 8085 56  TRAP  RST 7.5  RST 6.5  RST 5.5
  • 57. Classification of Interrupts 57  Maskable and Non-Maskable  Vectored and Non-Vectored  EdgeTriggered and Level Triggered  Priority Based Interrupts
  • 58. Maskable Interrupts 58  Maskable interrupts are those interrupts which can be enabled or disabled.  Enabling and Disabling is done by software instructions.
  • 59. Maskable Interrupts 59  List of Maskable Interrupts: • RST 7.5 • RST 6.5 • RST 5.5 • INTR
  • 60. Non-Maskable Interrupts 60  The interrupts which are always in enabled mode are called non- maskable interrupts.  These interrupts can never be disabled by any software instruction.  TRAP is a non-maskable interrupt.
  • 61. Vectored Interrupts 61  The interrupts which have fixed memory location for transfer of control from normal execution.  Each vectored interrupt points to the particular location in memory.
  • 62. Vectored Interrupts 62  List of vectored interrupts: • RST 7.5 • RST 6.5 • RST 5.5 • TRAP
  • 63. Vectored Interrupts 63  The addresses to which program control goes:  Absolute address is calculated by multiplying the RST value with 0008 H. Name Vectored Address RST 7.5 003C H (7.5 x 0008 H) RST 6.5 0034 H (6.5 x 0008 H) RST 5.5 002C H (5.5 x 0008 H) TRAP 0024 H (4.5 x 0008 H)
  • 64. Non-Vectored Interrupts 64  The interrupts which don't have fixed memory location for transfer of control from normal execution.  The address of the memory location is sent along with the interrupt.  INTR is a non-vectored interrupt.
  • 65. Edge TriggeredInterrupts 65  The interrupts which are triggered at leading or trailing edge are called edge triggered interrupts.  RST 7.5 is an edge triggered interrupt.  It is triggered during the leading (positive) edge.
  • 66. Level TriggeredInterrupts 66  The interrupts which are triggered at high or low level are called level triggered interrupts.  RST 6.5  RST 5.5  INTR  TRAP is edge and level triggered interrupt.
  • 67. Priority Based Interrupts 67  Whenever there exists a simultaneous request at two or more pins then the pin with higher priority is selected by the microprocessor.  Priority is considered only when there are simultaneous requests.
  • 68. Priority Based Interrupts 68  Priority of interrupts: Interrupt Priority TRAP 1 RST 7.5 2 RST 6.5 3 RST 5.5 4 INTR 5
  • 69. TRAP Pin 6 (Input) It is an non-maskable interrupt. It has the highest priority. It cannot be disabled. It is both edge and level triggered. It means TRAP signal must go from low to high. And must remain high for a certain period of time. TRAP is usually used for power failure and emergency shutoff. 69
  • 70. RST 7.5 Pin 7 (Input) It is a maskable interrupt. It has the second highest priority. It is positive edge triggered only. The internal flip-flop is triggered by the rising edge. The flip-flop remains high until it is cleared by RESET IN. 70
  • 71. RST 6.5 Pin 8 (Input) It is a maskable interrupt. It has the third highest priority. It is level triggered only. The pin has to be held high for a specific period of time. RST 6.5 can be enabled by EI instruction. It can be disabled by DI instruction. 71
  • 72. RST 5.5 Pin 9 (Input)  It is a maskable interrupt.  It has the fourth highest priority.  It is also level triggered.  The pin has to be held high for a specific period of time.  This interrupt is very similar to RST 6.5. 72
  • 73. INTR Pin 10 (Input) It is a maskable interrupt. It has the lowest priority. It is also level triggered. It is a general purpose interrupt. By general purpose we mean that it can be used to vector microprocessor to any specific subroutine 73
  • 74. INTA Pin 11 (Output) It stands for interrupt acknowledge. It is an out going signal. It is an active low signal. Low output on this pin indicates that microprocessor has acknowledged the INTR request. 74
  • 75. Address and Data Pins 75  Address Bus: • The address bus is used to send address to memory. • It selects one of the many locations in memory. • Its size is 16-bit.
  • 76. Address and Data Pins 76  Data Bus: • It is used to transfer data between microprocessor and memory. • Data bus is of 8-bit.
  • 77. AD0 –AD7 Pin 19-12 (Bidirectional) These pins serve the dual purpose of transmitting lower order address and data byte. During 1st clock cycle, these pins act as lower half of address. In remaining clock cycles, these pins act as data bus. The separation of lower order address and data is done by address latch. 77
  • 78. A8 –A15 Pin 21-28 (Unidirectional) These pins carry the higher order of address bus. The address is sent from microprocessor to memory. These 8 pins are switched to high impedance state during HOLD and RESET mode. 78
  • 79. A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 2 C D7 D6 D5 D4 D3 D2 D1 D0 0 0 1 0 1 1 0 1 2 D
  • 80. ALE Pin 30 (Output) It is used to enable Address Latch. It indicates whether bus functions as address bus or data bus. If ALE = 1 then ◦ Bus functions as address bus. If ALE = 0 then ◦ Bus functions as data bus. 80
  • 81. S0 and S1 Pin 29 (Output) and Pin 33 (Output) S0 and S1 are called Status Pins. They tell the current operation which is in progress in 8085. S0 S1 Operation 0 0 Halt 0 1 Write 1 0 Read 1 1 Opcode Fetch 81
  • 82. IO/M 7 Pin 34 (Output) This pin tells whether I/O or memory operation is being performed. If IO/M = 1 then ◦ I/O operation is being performed. If IO/M = 0 then ◦ Memory operation is being performed.
  • 83. IO/M Pin 34 (Output) The operation being performed is indicated by S0 and S1. If S0 = 0 and S1 = 1 then ◦ It indicates WRITE operation. If IO/M = 0 then ◦ It indicates Memory operation. Combining these two we get Memory Write Operation. 83
  • 84. Table Showing IO/M, S0, S1 and Corresponding Operations Operations IO/M S0 S1 Opcode Fetch 0 1 1 Memory Read 0 1 0 Memory Write 0 0 1 I/O Read 1 1 0 I/OWrite 1 0 1 InterruptAck. 1 1 1 Halt High Impedance 0 0 84
  • 85. RD Pin 32 (Output) RD stands for Read. It is an active low signal. It is a control signal used for Read operation either from memory or from Input device. A low signal indicates that data on the data bus must be placed either from selected memory location or from input device. 85
  • 86. WR Pin 31 (Output) WR stands for Write. It is also active low signal. It is a control signal used for Write operation either into memory or into output device. A low signal indicates that data on the data bus must be written into selected memory location or into output device. 86
  • 87. READY Pin 35 (Input) This pin is used to synchronize slower peripheral devices with fast microprocessor. A low value causes the microprocessor to enter into wait state. The microprocessor remains in wait state until the input at this pin goes high. 87
  • 88. HOLD Pin 38 (Input) HOLD pin is used to request the microprocessor for DMA transfer. A high signal on this pin is a request to microprocessor to relinquish the hold on buses. This request is sent by DMA controller. Intel 8257 and Intel 8237 are two DMA controllers. 88
  • 89. HLDA Pin 39 (Output) HLDA stands for Hold Acknowledge. The microprocessor uses this pin to acknowledge the receipt of HOLD signal. When HLDA signal goes high, address bus, data bus, RD, WR, IO/M pins are tri- stated. This means they are cut-off from external environment. 89
  • 90. HLDA Pin 39 (Output) The control of these buses goes to DMA Controller. Control remains at DMA Controller until HOLD is held high. When HOLD goes low, HLDA also goes low and the microprocessor takes control of the buses. 90
  • 91. VSS and VCC Pin 20 (Input) and Pin 40 (Input)  +5V power supply is connected to VCC. Ground signal is connected to VSS. 91
  • 92. THE 8085 AND ITS BUSSES The 8085 is an 8-bit general purpose microprocessor that can address 64K Byte of memory. It has 40 pins and uses +5V for power. It can run at a maximum frequency of 3 MHz. -The pins on the chip can be grouped into 6 groups: Address Bus. Data Bus. Control and Status Signals. Power supply and frequency. Externally Initiated Signals. Serial I/O ports. 88
  • 93. The Address and Data Busses  The address bus has 8 signal lines A8 – A15 which are unidirectional.  The other 8 address bits are multiplexed (time shared) with the 8 data bits.  So, the bits AD0 – AD7 are bi-directional and serve as A0 – A7 and D0 – D7 at the same time. During the execution of the instruction, these lines carry the address bits during the early part, then during the late parts of the execution, they carry the 8 data bits.  In order to separate the address from the data, we can use a latch to save the value before the function of the bits changes. 89
  • 94. 94
  • 95. Flag Register D7 D6 D5 D4 D3 D2 D1 D0 S Z AC P CY 95 The flags are affected by the arithmetic and logical instruction
  • 96. Accumulator  It is an 8 bit register  For any arithmetic and logical instruction one of the data should be in this register  It is used for storing the result of any arithmetic and logical manipulations.  It is also called as A register  All the data which are sent to I/O devices are sent via A register. 96
  • 97. Temporary register  It is used to hold the data during the operation of arithmetic and logical operation 97
  • 98. Sign Flag  If the D7 bit of the accumulator is set then this flag is set i.e 1 meaning that the result is in negative.  Ex. 7-8 = -1 98
  • 99. 100 Carry flag  During the arithmetic operation if a carry occurs then this flag is set.  Ex. F1+1F= 1 10 Carry 99 1111 0001 1111 0001 11110 0010
  • 100. Zero flag During the arithmetic/ logical operation if the result is zero then this flag is set. Ex. FF-FF = 00 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 11 1 0 0 0 0 0 0 0 0
  • 101. Parity flag  After the of the arithmetic and logical operation if the result is even then this flag is set.  Ex. 0A-+0A = 14 101 0000 1010 0000 1010 0001 0100
  • 102. Auxiliary carry flag  During BCD arithmetic operation when a carry is generated by D3 bit and passed on to D4 bit then this flag is set.  Ex. 1F+11 = 0001 1111 +0001 0001  = 0010 0000 102
  • 103. 103
  • 104. 104
  • 105. 105
  • 106. Control and status signals Machine Cycle IO/M S1 S0 Opcode fetch 0 1 1 Memory read 0 1 0 Memory write 0 0 1 I/O read 1 1 0 I/O write 1 0 1 106
  • 107. 107
  • 108. Program Counter It is a 16 bit register It is used to point out the address of the next instruction which is to be executed 108
  • 109. Stack pointer  It is a 16 bit register  It points the starting address of the stack . 109
  • 110. Register Array  B, C, D, E, H and L are general purpose register  All are 8 bit register  If the are combined as BC, DE and HL they can store 16 bit data 110
  • 112. 8085 Communication with Memory 112  Involves the following three steps 1. Identify the memory location (with address) 2. Generate Timing & Control signals 3. Data transfer takes place
  • 113. Example: Memory Read Operation 1 113 2 3
  • 114. 8085 Interfacing with Memory chips Memory Chip Address 8085 Data Control Address 114 Memory Interface Data Control
  • 115. 8085 Interfacing with Memory chips 8085 Memory Memory Chip AD0-AD7 Control A0 –A7 Data 74LS373 A8-A15 A8-A15 111 Interface ALE
  • 116. 8085 Interfacing with Memory chips 8085 Memory Interface Program Memory AD0-AD7 IO/M A0 – A7 Data 74LS373 A8-A15 A8-A15 ALE RD RD CS 112
  • 118. Interfacing I/O devices with 8085 8085 I/O Interface I/O Devices Memory Interface Memory Devices System Bus 118
  • 119. Techniques for I/O Interfacing 119  Memory-mapped I/O  Peripheral-mapped I/O
  • 120. Memory-mapped I/O 120  8085 uses its 16-bit address bus to identify a memory location  Memory address space: 0000H to FFFFH  8085 needs to identify I/O devices also  I/O devices can be interfaced using addresses from memory space  8085 treats such an I/O device as a memory location  This is called Memory-mapped I/O
  • 121. Peripheral-mapped I/O 121  8085 has a separate 8-bit addressing scheme for I/O devices  I/O address space: 00H to FFH  This is called Peripheral-mapped I/O or I/O- mapped I/O
  • 122. 8085 Communication with I/O devices 122  Involves the following three steps 1. Identify the I/O device (with address) 2. Generate Timing & Control signals 3. Data transfer takes place  8085 communicates with a I/O device only if there is a Program Instruction to do so
  • 123. 1.Identify the I/O device (with address) 123 1. Memory-mapped I/O (16-bit address) 2. Peripheral-mapped I/O (8-bit address)
  • 124. 2.Generate Timing & Control Signals  Memory-mapped I/O  Reading Input: IO/M = 0, RD = 0  Write to Output: IO/M = 0, WR = 0  Peripheral-mapped I/O  Reading Input: IO/M = 1, RD = 0  Write to Output: IO/M = 1, WR = 0 3. Data transfer takes place 124
  • 125. 8085 Communication with I/O devices 125  Involves the following three steps  Identify the I/O device (with address)  Generate Timing & Control signals  Data transfer takes place  8085 communicates with a I/O device only if there is a Program Instruction to do so
  • 126. Peripheral I/O Instructions 126  IN Instruction  Inputs data from input device into the accumulator  It is a 2-byte instruction  Format: IN 8-bit port address  Example: IN 01H
  • 127.  OUT Instruction  Outputs the contents of accumulator to an output device  It is a 2-byte instruction  Format: OUT 8-bit port address  Example: OUT 02H 127
  • 128. ----------Example Program---------- 128  WAP to read a number from input port (port address 01H) and display it on ASCII display connected to output port (port address 02H) IN 01H ;reads data value 03H (example)into ;accumulator, A = 03H MVI B, 30H;loads register B with 30H ADD B OUT 02H ;A = 33H, ASCII code for 3 ;display 3 on ASCII display
  • 129. Memory-mapped I/O Instructions 129  I/O devices are identified by 16-bit addresses  8085 communicates with an I/O device as if it were one of the memory locations  Memory related instructions are used  For e.g. LDA, STA  LDA 8000H  Loads A with data read from input device with 16-bit address 8000H  STA 8001H  Stores (Outputs) contents of A to output device with 16-bit address 8001H
  • 130. ----------Example Program---------- 130  WAP to read a number from input port (port address 8000H) and display it on ASCII display connected to output port (port address 8001H) LDA 8000H;reads data value 03H (example)into ;accumulator, A = 03H MVI B, 30H;loads register B with 30H ADD B ;A = 33H, ASCII code for 3 STA 8001H;display 3 on ASCII display
  • 132. 132 Timing Diagram is a graphical representation. It represents the execution time taken by each instruction in a graphical format. The execution time is represented in T-states. Instruction Cycle: The time required to execute an instruction . Machine Cycle: The time required to access the memory or input/output devices . T-State: •The machine cycle and instruction cycle takes multiple clock periods. •A portion of an operation carried out in one system clock period is called as T-state.
  • 133. 133
  • 134. 134 Timing diagrams • The 8085 microprocessor has 7 basic machine cycle. They are 1.Op-code Fetch cycle(4T or 6T). 2.Memory read cycle (3T) 3.Memory write cycle(3T) 4.I/O read cycle(3T) 5.I/O write cycle(3T) 6.Interrupt Acknowledge cycle(6T or 12T) 7.Bus idle cycle
  • 135. 135
  • 136. 1.Opcode fetch cycle(4T or 6T) 136
  • 137. 137 OPCODE FETCH • The Opcode fetch cycle, fetches the instructions from memory and delivers it to the instruction register of the microprocessor • Opcode fetch machine cycle consists of 4 T-states. T1 State: During the T1 state, the contents of the program counter are placed on the 16 bit address bus. The higher order 8 bits are transferred to address bus (A8-A15) and lower order 8 bits are transferred to multiplexed A/D (AD0-AD7) bus. ALE (address latch enable) signal goes high. As soon as ALE goes high, the memory latches the AD0-AD7 bus. At the middle of the T state the ALE goes low
  • 138. 138 T2 State: During the beginning of this state, the RD’ signal goes low to enable memory. It is during this state, the selected memory location is placed on D0-D7 of the Address/Data multiplexed bus. T3 State: In the previous state the Opcode is placed in D0-D7 of the A/D bus. In this state of the cycle, the Opcode of the A/D bus is transferred to the instruction register of the microprocessor. Now the RD’ goes high after this action and thus disables the memory from A/D bus. T4 State: In this state the Opcode which was fetched from the memory is decoded.
  • 139. 2. Memory read cycle (3T) 139
  • 140. was obtained from the memory is then decoded. • These machine cycles have 3 T-states. T1 state: • The higher order address bus (A8-A15) and lower order address and data multiplexed (AD0-AD7) bus. ALE goes high so that the memory latches the (AD0-AD7) so that complete 16-bit address are available. The mp identifies the memory read machine cycle from the status signals IO/M’=0, S1=1, S0=0. This condition indicates the memory read cycle. T2 state: • Selected memory location is placed on the (D0-D7) of the A/D multiplexed bus. RD’ goes LOW T3 State: • The data which was loaded on the previous state is transferred to the microprocessor. In the middle of the T3 state RD’ goes high and disables the memory read operation. The data which 136
  • 141. 3. Memory write cycle (3T) 141
  • 142. 142 • These machine cycles have 3 T-states. T1 state: • The higher order address bus (A8-A15) and lower order address and data multiplexed (AD0-AD7) bus. ALE goes high so that the memory latches the (AD0-AD7) so that complete 16-bit address are available. The mp identifies the memory read machine cycle from the status signals IO/M’=0, S1=0, S0=1. This condition indicates the memory read cycle. T2 state: • Selected memory location is placed on the (D0-D7) of the A/D multiplexed bus. WR’ goes LOW T3 State: • In the middle of the T3 state WR’ goes high and disables the memory write operation. The data which was obtained from the memory is then decoded.
  • 146. 146 It require 4 m/c cycles 13 T states 1.opcode fetch(4T) 2.memory read(3T) 3.memory read(3T) 4.Memory write(3T)
  • 147. 147
  • 148. 148 Timing diagram for IN C0H • Fetching the Opcode DBH from the memory 4125H. • Read the port address C0H from 4126H. • Read the content of port C0H and send it to the accumulator. • Let the content of port is 5EH.
  • 149. 145 It require 3 m/c cycles 10 T states opcode fetch(4T) memory read(3T) I/O read(3T)
  • 150. 150
  • 152. 152
  • 153. Timing diagram for MVI B, 43h • Fetching the Opcode 06H from the memory 2000H. (OF machine cycle) • Read (move) the data 43H from memory 2001H. (memory read) 153
  • 154. 154
  • 158. 8085 Interrupts 8085 has five interrupt inputs 1. TRAP 2. RST7.5 3. RST 6.5 4. RST5.5 5. INTR 158
  • 160. Types of Interrupts • Interrupts of 8085 can be classified as – Maskable (RST 7.5, RST 6.5, RST 5.5, INTR) – Non-maskable (TRAP) • An interrupt is a request for attention/service • 8085 may choose to service/not-service a maskable interrupt • 8085 cannot ignore a service request from a non-maskable interrupt 160
  • 161. Interrupt process • 8085 is executing its main program • an interrupt is generated by an external device • 8085 pauses execution of main program • 8085 calls the Interrupt service routine • 8085 executes the Interrupt service routine • 8085 returns to execution of main program (from where it was paused) 161
  • 162. Example: Blinking LED Display with Interrupt-based Display-Pattern change Input Switches LED Display RST 7.5 8085 (Display-Pattern) Interrupt Switch 162 Peripheral-mapped I/O Interrupt I/O
  • 163. Interrupt Service Routine (ISR) • It is a subroutine • 8085 calls an ISR in response to an interrupt request by an external device • ISRs must be located in memory at pre- determined addresses known as Interrupt Vectors 163
  • 164. Interrupt Vector Table of 8085 164 Interrupt Interrupt Vector TRAP 0024H RST 7.5 003CH RST 6.5 0034H RST 5.5 002CH Please Note: INTR is a non-vectored interrupt
  • 165. Using Vectored Interrupts of 8085 • By default, all the vectored interrupts (except TRAP) of 8085 are disabled • 8085 vectored interrupts are enabled with two instructions: EI and SIM • EI (Enable Interrupt): 1-byte instruction that sets the Interrupt Enable flip-flop – It is internal to the processor & can be set or reset by using software instructions 165
  • 166. Using Vectored Interrupts Step-1 •Set Interrupt Enable flip-flop by using EI instruction to enable the interrupt process Step-2 •Use SIM (Set Interrupt Mask) instruction to set mask for RST 7.5, 6.5 and 5.5 interrupts 166
  • 167. SIM Instruction • It is a 1-byte instruction • Reads Accumulator contents • Enables/Disables interrupts accordingly • Used for three different functions – Set mask for RST 7.5, 6.5, 5.5 interrupts – Additional control for RST 7.5 – Implement serial I/O 167
  • 168. Accumulator bit pattern for SIM D7 D6 D5 D4 D3 D2 D1 D0 SOD SDE XXX R7.5 MSE M7.5 M6.5 M5.5 0 = Available, 1 = Masked Mask Set Enable, 0 = bits 0-2 ignored 1 = mask is set IF 1, RESET RST 7.5 If 1, bit 7 is output to serial output data latch Serial Output Data, ignored if bit 6 = 0 Presented by C.GOKUL,AP/EEE Velalar College of Engg & Tech , Erode 164
  • 169. 8085 Interrupt process for Vectored-Interrupts 1. Enables Interrupt process by writing the EI instruction in the main program 2. Set interrupt mask using SIM instruction 3. 8085 monitors the status of all interrupt lines during the execution of each instruction 169
  • 170. 4. When 8085 detects an interrupt signal from an external device • It completes execution of current instruction • Disables the Interrupt Enable flip-flop 5. Executes a CALL to Interrupt Vector location for that interrupt • Before the CALL is made, 8085 stores return address in main program on stack 170 8085 Interrupt process for Vectored-Interrupts (Cont.)
  • 171. 6. 8085 executes the ISR written at the specified interrupt vector location • ISR should include the EI instruction to Enable Interrupt again • At the end of ISR, RET instruction transfers the program control back to the main program 171 Presented by C.GOKUL,AP/EEE Velalar College of Engg & Tech , Erode 8085 Interrupt process for Vectored-Interrupts (Cont.)
  • 172. Differentiate between the following instructions clearly (i)Push and POP (ii)CALL and Jump (iii)ADD and ADC (iv)INC and INX (v)MOVB,B and MOVB,A (vi)What is the general format of an 8085 instruction set? https://www.electrical4u.com/electrical- mcq.php?subject=microprocessor&page=1