8085
MICROPROCESSOR
Dharita K. Patel
Asst. Professor
EED, BVM
Applications
Instrumentation:
• Frequency counters
• function generators
• frequency synthesizers
• spectrum analyzers
• Medical instrumentation
Control:
• microwave oven
• washing machine
• Appliances controlling various parameters like speed,
pressure, temperature etc.
Communication:
• digital telephone sets
• Telephone exchanges and modem
• Television
• satellite communication
• Railway reservation
• Air reservation system
• LAN and WAN for communication of vertical information
through computer network.
Office Automation and Publication:
• Microprocessor based micro computer with software packages
• word processing
• spread sheet operations
• storage etc.
Consumer:
• Calculators
• Accounting system
• Games machine
• Complex Industrial Controllers
• Traffic light Control
• Data acquisition systems
• Multi user, multi-function environments
• Military applications
• Communication systems
• Also following fields where microprocessors are dominating
• Universal Data Acquisition and Control System :- This includes
Voltage Control, Automatic Switching Sequence, Automatic reclosing,
generator sequence control, generator efficiency monitoring, revenue
metering collection, alarm logging, fault level monitoring.
• Integrated Substation Control System :- These are mutli processor
system which provides full control over data-base updating, output
execution, automatic execution of selected sequence.
• Integrated Control and Protection Systems :- Under this concept, both
control and protective relaying functions are combined in one system.
• SCADA System :- These are the first systems where microporocessors
entered in electrical field, Supervisory Control And Data Acquisition
(SCADA) systems are typically used by utilities such as power, Oil & Gas,
water and waste management, etc. SCADA systems are also used by
Process Industries including petrochemicals, fertilizers, cement, paper
and pulp, steel industries, and aluminum plants.
• Unconventional Monitoring Systems :- one of the example of this is
system designed for the power transformer, these systems are for
monitoring power transformer parameters such as saturation curves,
over excitation, gas content, partial discharges and insulation damages,
etc.
• Examples: Intel Pentium, Motorola Power PC
• Fixed Point and Floating Point
Features
• 8 bit microprocessor(8085 microprocessor can read or
write or perform arithmetic and logical operations on 8-bit
data at time)
• It has 8 data lines and 16 address lines hence capacity is
216 = 64 kB of memory
• Cock frequency is 3 MHz
• It requires +5V power supply.
• It is a single chip NMOS device implemented with 6200
transistors.
• It provides 74 instructions with five addressing modes.
• It provides 5 hardware interrupt and 8 software interrupts.
Pin Configuration
• 40 pins classified into
6 groups:
1. Data bus
2. Address bus
3. Control & status lines
4. Externally generated
5. Serial interface
6. Power supply & clock
Pin Configuration cont…
1) Address Bus (A15-A8 and AD7-AD0):
The microprocessor 8085 has 16 bit address lines
from A15-A8 and AD7-AD0. These lines are used to
transfer 16 bit address of memory as well as 8-bit address
of I/O ports.
2) Data Bus:
The lower 8 lines (AD7-AD0) are often called as
multiplexed data lines.
CONTROL LINES
• RD : Read: This is active low signal which indicates that the
selected I/O or memory device is to be read and also is
available on the data bus.
• WR : Write: This is active low signal which indicates that the
data on data bus are to be written into a selected memory
location.
• IO/ M : (Input / Output / Memory): This is used to select either
Input / Output devices or memory operation. When it is high it
indicates an I/O operation and when it is low, it indicates a
memory operation.
STATUS LINES
• Status Pins (S1, S0): The microprocessor 8085 has two status
pins as S1, S0 which is used to indicate the status of
microprocessor or operation which is performed by
microprocessor.
SPECIAL SIGNAL
• ALE (Address Latch Enable): The ALE signal is used to
enable or disable the external peripherals (LATCH).
• The external latch IC is used for the de-multiplexing of
AD7-AD0 lines, i.e., it is used to separate the address and
data from AD7-AD0 lines.
• If ALE = 1/0 then external latch IC is enabled / disabled
respectively.
Architecture 0f 8085 Cont…
8. Interrupt Control
1. ALU
9.Serial I/O Control
2. Timing and Control Unit
10.Address Bus
3. General Purpose
11. Data Bus
Registers
4. Program Status word
5. Program Counter
6. Stack Pointer
7. Instruction Register and
Decoder
PROGRAMMING MODEL OF 8085
REGISTERS
The Registers are of 8-bit & 16-bit size used for different
purposes
A- Accumulator – This is an special
purpose register. All the ALU operations are
performed with reference to the contents of
Accumulator.
B,C,D,E,H,L – General purpose registers.
These registers can also used for 16-bit
operations in pairs. The default
pairs are BC, DE & HL.
F – Flag register – This register indicates the
status of the ALU operation.
PC – Program Counter – This is a 16-bit
register used to address the memory location
from where an instruction is going to be
executed.
Signed(positive and negative) and (7 bits, 8th bit
(D7) indicates sign, 1=negative
S=1 0=positive, S=0)
Unsigned (positive)
SP – Stack pointer - This is a 16-bit register
used to address the top of the stack memory
location.
Temporary register, W & Z – These registers
are only used by 8085 and are not available for
the programmer.
ALU – Arithmetic & Logic Unit
ALU of 8085 performs 8-bit arithmetic & logical
operations. The operations are generally performed
with Accumulator as one of the operands. The result
is saved in accumulator register.
Timing & Control Unit
This unit works as the brain of the CPU and
generates all the timing and control signals to
perform all the internal & external operations of the
CPU.
Instruction Decoder & Machine Cycle Encoder Unit
This unit decodes the op-code stored in the
Instruction Register (IR) and encodes it for the timing
& control unit to perform the execution of the
instruction.
The 8085 Bus Structure
The 8-bit 8085 CPU (or MPU – Micro Processing Unit) communicates with the other
units using a 16-bit address bus, an 8-bit data bus and a control bus.
Over all structure
Chip Selection
A15- A10 Circuit
8085
CS
A15-A8
ALE
A9- A0 1K Byte
AD7-AD0 Latch Memory
A7- A0 Chip
WR RD IO/M D7- D0
RD WR
RESET CIRCUIT
• On reset, the PC sets to 0000H which causes the 8085 to execute the first
instruction from address 0000H. For proper reset operation reset signal must be
held low for at least 3 clock cycles.
• The power-on Reset Circuit of 8085 can be used to ensure execution of first
instruction from address 0000H.
• Upon power-up, RESET IN must remain low for at least 10ms after minimum
Vcc has been reached, in the circuit shown in Fig. Upon power up or key press,
the RESET IN goes low and slowly rises to +5V, providing sufficient time for the
processor to reset the system.
• The diode is connected to discharge the capacitor immediately when power
supply is switched OFF.
• After RESET, 8085 loads 0000H in PC register
MPU Communication and Bus Timing
Moving data form memory to MPU using instruction MOV C, A (code
machine 4FH = 0100 1111) 26
8085 clock
On chip clock generator
• The 8085 has on chip clock generator. Fig. shows the internal block
diagram of the on chip clock generator.
• The internal clock generator requires tuned circuit like LC, RC or crystal, or
external clock source as an input to generate the 8085 Clock Circuit.
• The internal T-flip flop divides the frequency by 2. Hence the operating
frequency of the 8085 Clock Circuit is always half of the oscillator
frequency.
LC Tuned Circuit or LC Tank Frequency:
• It is a LC resonant tank circuit. The resonant frequency for this circuit is given
by
•
• where Cint is the internal capacitance and it is normally 15 pF. The output
frequency of this circuit has 10% variations.
• To minimize the variations in the output frequency, it is recommended to have
Cext at least twice that of Cint i.e. 30 pF.
RC Tuned Circuit :
• The output frequency of this circuit is also not exactly
stable. But this circuit .has an advantage that its
component cost is less.
Crystal Oscillator Circuit:
• It is the most stable circuit. The 20 pF capacitor in the
circuit is connected to assure oscillator start-up at the
correct frequency.
• External Clock:
• Here external clock is applied at X1 input and X2 input is
kept open.
I/O Interfacing
Input Port :
• It is used to read data from the input device such as keyboard. The
simplest form of input port is a buffer. The input device is connected to the
microprocessor through buffer as shown in the Fig.This buffer is a tri-state
buffer and its output is available only when enable signal is active.
• When microprocessor wants to read data from the input device (keyboard),
the control signals from the microprocessor activates the buffer by
asserting enable input of the buffer. Once the buffer is enabled, data from
the input device is available on the data bus. Microprocessor reads this
data by initiating read command.
Input Port Interfacing
Output Port :
• It is used to send data to the output device such as display from the
microprocessor. The simplest form of output port is a latch. The output
device is connected to the microprocessor through latch as shown in
the Fig.
• When microprocessor wants to send data to the output device, it puts
the data on the data bus and activates the clock signal of the latch,
latching the data from the data bus at the output of latch. It is then
available at the output of latch for the output device.
Output Port Interfacing
Memory Interfacing in 8085
• 2^x=4096, find x?
• 2,
4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,3
2766,65536
Basic Concepts in Memory Interfacing
• For Memory Interfacing in 8085, following important points are to be kept in mind.
• Microprocessor 8085 can access 64Kbytes memory since address bus is 16-bit.
But it is not always necessary to use full 64Kbytes address space. The total
memory size depends upon the application.
• Generally EPROM (or EPROMs) is used as a program memory and RAM (or
RAMs) as a data memory. When both, EPROM and RAM are used, the total
address space 64Kbytes is shared by them.
• The capacity of program memory and data memory depends on the application.
• It is not always necessary to select 1 EPROM and 1 RAM. We can have multiple
EPROMs and multiple RAMs as per the requirement of application.
• We can place EPROM/RAM anywhere in full 64 Kbytes address space. But
program memory (EPROM) should be located from address 0000H since reset
address of 8085 microprocessor is 0000H.
• It is not always necessary to locate EPROM and RAM in consecutive memory For
example : If the mapping of EPROM is from 0000H to OFFFH, it is not must to
locate RAM from 1000H. We can locate it anywhere between 1000H and FFFFH.
Where to locate memory component totally depends on the application.
The memory interfacing requires to :
• Select the chip
• Identify the register
• Enable the appropriate buffer.
• Microprocessor system includes memory devices and I/O
devices. It is important to note that microprocessor can
communicate (read/write) with only one device at a time,
since the data, address and control buses are common
for all the devices.
• In order to communicate with memory or I/O devices, it is
necessary to decode the address from the
microprocessor. Due to this each device (memory or I/O)
can be accessed independently.
Address Decoding Techniques
• Absolute decoding/Full Decoding
• In absolute decoding technique, all the higher address lines are
decoded to select the memory chip, and the memory chip is
selected only for the specified logic levels on these high-order
address lines; no other logic levels can select the chip.
• Linear decoding/Partial Decoding
• In small systems, hardware for the decoding logic can be
eliminated by using individual high-order address lines to select
memory chips. This is referred to as linear decoding.
• This technique is also called partial decoding. It reduces the
cost of decoding circuit, but it has a drawback of multiple
addresses (shadow addresses).
Decoding main address (EPROM)
000000---0000000000 starting address (0000 H)
Absolute Decoding 000000---1111111111 ending address (03FF H)
Decoding main address (RAM)
001000---0000000000 starting address (2000 H)
001000---1111111111 ending address (23FF H)
Decoding main address (EPROM)
0XXXXX---0000000000 starting address (0000 H)
0XXXXX---1111111111 ending address (03FF H)
Instruction Set
Broadly classified into two types:
Based on size:
• One Byte - Opcode only (CMA, ADD B)
• Two Byte - Opcode ,an operand (MVI A,32H)
• Three Byte - Opcode, operand, operand (LDA 4200, STA 4500)
Based on function:
• Data transfer group (MOV A,B; MVI A,32H;MOV C,4500)
• Arithmetic operations (ADD B, SBI 32H,INC D, DEC B)
• Logical operations (ANA B, ORI 05H, RLC, RAR)
• Branching operations (JMP, JNZ, JC, CALL,
RETURN)
• Machine control instructions (HLT, NOP,EI,DI,SIM,RIM)
ADDRESSING MODES
• Immediate (MOV A,B ;ADD B; SUB E;ANA C)
• Register (MVI A,05H;LXI B, 20AEH; ADI 05H;ORI 07H)
• Direct (LDA 4500H;STA 7500H;IN 09H;OUT 70H)
• Indirect (MOV A, M;MOV M,A;ADD M;ORA M)
• Implied(implicit) (HLT; NOP;RST;RET)
Timing diagrams
• A timing diagram in the field of embedded systems refers
to a graphical representation of processes occurring with
respect to time.
• In other words, the representation of the changes and
variations in the status of signals with respect to time is
referred to as a timing diagram.
Terminologies used in timing diagram
• T state
Processors work in synchronization with a periodic signal called ‘clock signal’. The
part of any operation carried out during one time period of this clock signal is known
as a T state. Sometimes, ‘T state’ is also used to refer to a time of one clock period.
For studying the rest of the concepts, it becomes a basic unit of measuring time.
• Instruction cycle
For the execution of any instructions, basically, two steps are followed – fetch and
then execute. The time (or the number of ‘T states’) required to fetch and execute an
instruction is called an instruction cycle.
• Fetch cycle
When you write an assembly language program, every instruction of that program is
converted to corresponding hex codes, which is then converted to binary and is
stored somewhere in the memory. During the process of running an uploaded
program, the processor first has to read from the memory the instruction that is to be
executed. This process of reading the code for the instruction to be executed is
called the fetch cycle. We can say that during this cycle, instruction to be executed
is fetched from memory.
• Execution cycle
After fetching the code for the instruction that is supposed to be executed, the next
step is to execute that instruction. This process is referred to as an execution cycle.
• Machine cycle
The time required for the microprocessor to access memory or an IO device either
for a read operation or a write operation is called a machine cycle.
Machine Cycles in 8085
Opcode fetch
Memory read and memory write
In/out read In/Out Write
Interrupt Acknowledge cycle
Bus Idle
Eg:
Eg:
Thank You