Micrprocessor
-
Upload
coolvadivel -
Category
Documents
-
view
214 -
download
0
Transcript of Micrprocessor
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 1/48
8085 MICROPROCESSOR
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 2/48
Why the name 8085 ?
• 80 indicates it was developed in early
eighties(1976)
• 5 means the microprocessor operates at +5volts.
• 8 means 8bits, its word length is 1byte.
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 3/48
3
Organization of a microprocessor-
based system
I/O
Input / Output
Memory
System Bus ALU
Register
Array
Timing &Control
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 4/48
General Operations In
Microprocessor
• These are usually one of 4 operations:
– Memory Read
– Memory Write
– I/O Read (Get data from an input device)
– I/O write (Send data to an output device)
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 5/48
8085 Microprocessor Architecture
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 6/48
Three Sections in
Architecture
• ALU
• Timing and Control Unit
• Set of Registers
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 7/48
ALU Section
ALU Can Performs
– Addition
– Subtraction
– Logical AND – Logical OR
– Logical EXCLUSIVE OR
– Complement (logical NOT)
– Increment (add 1)
– Decrement (subtract 1)
– Left shift
– Clear
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 8/48
Register SectionGeneral Purpose Registers
– B Reg – C Reg
– D Reg
– E Reg
– H Reg
– L Reg
• Special Purpose Registers
– Accumulator
– Program Counter – Stack Pointer
– Temp Reg (Temp Data Reg W and Z Reg)
– Instruction Register
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 9/48
General Purpose Registers
B,C,D,E,H,L
• used as 8 bit registersseparately
• also 16 bit registers
as BC,DE,HL register pairs
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 10/48
Special Purpose Registers
• Accumulator (8 bit)
– Used to store arithmetic ,logic, load and
store operations
– Store the result of arithmetic operations
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 11/48
Program Counter (16 bit) – This is a register that is used to control the
sequencing of the execution of instructions.
– This register always holds the address of thenext instruction.
– Since it holds an address, it must be 16 bitswide.
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 12/48
The Stack pointer(16 bit)
– The stack pointer is used to point into memory.
– This register points to is a special area called
the stack.
– The stack is an area of memory used to hold
data that will be retreived soon.
– The stack is usually accessed in a Last In First
Out (LIFO) fashion.
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 13/48
Special Purpose Registers Contd…
Flag Register has five 1-bit flags.
• Sign - set if the most significant bit of the result is set.
• Zero - set if the result is zero.
• Auxiliary Carry Flag- set if there was a carry out from
bit 3 to bit 4 of the result.
• Parity Flag - set if the parity (the number of set bits in
the result) is even.
• Carry Flag- set if there was a carry during addition, or
borrow during subtraction/comparison/rotation.
S Z X AC X P X C
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 14/48
Timing and Control Unit
• Responsible for all the operation
• Generates signals for instruction
execution, required to interface external
devices to the processor 8085
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 15/48
Instruction Decoder
• Decoder then takes instruction and „decodes‟ or
interprets the instruction.
• Decoded instruction then passed to next stage.
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 16/48
System Bus
• Address Bus
• Data Bus• Control Bus
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 17/48
The Address Bus
– 16 bits wide (A0 A1…A15)• Therefore, the 8085 can access locations with
numbers from 0 to 65,536. Or, the 8085 can
access a total of 64K addresses.
– “Unidirectional”. • Information flows out of the microprocessor and
into the memory or peripherals.
– When the 8085 wants to access a peripheral
or a memory location, it places the 16-bit
address on the address bus and then sends
the appropriate control signals.
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 18/48
The Data Bus
– 8 bits wide (D0 D1…D7)
– “Bi-directional”.
• Information flows both ways between the
microprocessor and memory or I/O. – The 8085 uses the data bus to transfer the
binary information.
– Since the data bus has 8-bits only, then the
8085 can manipulate data 8 bits at-a-time
only.
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 19/48
Control Bus
• The control bus has various lines which have
specific functions for coordinating and controlling
microprocessor operations.
• 8085 has 11 control signals
s0, s1, IO/M, RD, WR, ALE, READY, HOLD, HLDA,
RESET IN, RESET OUT.
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 20/48
Example: Memory Read Operation
1
2
3
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 21/48
Example: Instruction Fetch Operation
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 22/48
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 23/48
8085 PIN
Configuration
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 24/48
8085
Functional
Pin Diagram
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 25/48
8085 is a 40 pin IC, DIP package.
The signals from the pins can be grouped
as follows
• Power supply and clock signals
• Address bus
• Data bus
• Control Bus
• Interrupts signals
• Serial I/O ports• DMA Signals
• Reset Signals
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 26/48
Power supply and Clock frequency signals
• Vcc + 5 volt power supply• Vss Ground
• X1, X2 : Crystal or R/C network or LC network
connections to set the frequency of internal clock
generator.• The frequency is internally divided by two. Since the
basic operating timing frequency is 3 MHz, a 6 MHz
crystal is connected externally.
• CLK OUT-Clock Output is used as the system clockfor peripheral and devices interfaced with the
microprocessor
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 27/48
Address Bus:
• A8 - A15 (output)
• It carries the most significant 8 bits of the memory address or the 8bits of the I/O address;
Multiplexed Address / Data Bus:
• AD0 - AD7 (input/output)
• These multiplexed set of lines used to carry the lower order 8 bit
address as well as data bus.
• During the opcode fetch operation, in the first clock cycle, the lines
deliver the lower order address A0 - A7.
• In the subsequent IO / memory, read / write clock cycle the lines are
used as data bus.
• The CPU may read or write out data through these lines.
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 28/48
Control Bus (Control Signals)
• ALE (output) - Address Latch Enable.
– This signal helps to capture the lower order address
presented on the multiplexed address / data bus.
• RD (output 3-state, active low) - Read memory or IO
device.
– This indicates that the selected memory location or I/O device is to be read and that the data bus is
ready for accepting data from the memory or I/O
device.
C t l B (C t l Si l )
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 29/48
Control Bus (Control Signals)
• WR (output 3-state, active low) - Write memory or IO
device.
– This indicates that the data on the data bus is to be written into
the selected memory location or I/O device.
• IO/M (output) - Select memory or an IO device.
– This status signal indicates that the read / write operation relates
to whether the memory or I/O device.
– It goes high to indicate an I/O operation.
– It goes low for memory operations
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 30/48
Status Signals
• It is used to know the type of currentoperation of the microprocessor .
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 31/48
Interrupts
• They are the signals initiated by an external
device to request the microprocessor to do a
particular task or work.
• There are five hardware interrupts called,
TRAP (High Priority)
RST 7.5
RST 6.5RST 5.5
INTR (Low Priority)
INTA
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 32/48
Interrupts Contd…
• On receipt of an interrupt, the microprocessor
acknowledges the interrupt by the active low
INTA (Interrupt Acknowledge) signal.
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 33/48
Serial I/O Signals
These signals are used for serial
communication.
• SID (input) - Serial input data line
– Used to accept serial data bit from external
device
• SOD (output) - Serial output data line
– Enables the transmission of serial data bit
by bit to the external device.
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 34/48
Reset Signals
• Reset In (input, active low) – This signal is used to reset the microprocessor.
– The program counter inside the microprocessor
is set to zero. – The buses are tri-stated.
• Reset Out (Output) – It indicates CPU is being reset.
– Used to reset all the connected devices when
the microprocessor is reset.
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 35/48
DMA Signal• HOLD signal
– generated by the DMA controller circuit.
– Indicates that another master is requesting for
the use of address bus, data bus and control
bus.
• HLDA Signal
– this active high signal is used to acknowledgeHOLD Request.
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 36/48
READY (input)
• Memory and I/O devices will have slower response compared to microprocessors.
• Before completing the present job such a slow
peripheral may not be able to handle further data or control signal from CPU.
• The processor sets the READY signal after
completing the present job to access the data
• The microprocessor enters into WAIT state whilethe READY pin is disabled.
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 37/48
Example: Instruction Fetch Operation
It takes four
instructionclock cycles to
get one into
the CPU.
Instruction
(opcode)
reaches thé
instructiondecoder now !
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 38/48
Execution of an Instruction
Now consider the execution of a simple instruction:
Instruction 3E (hex) means: Load a data byte into
the accumulator
The instruction is followed by the data byte 32 (hex)
Two-byte instruction !
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 39/48
39
Execution of an Instruction
Get the
instruction(opcode)
byte from
memory
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 40/48
40
Execution of an Instruction
Interpret the
instruction:
Wait for the
data byte !
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 41/48
41
Execution of an Instruction
Put the next
memorylocation on
the address
bus (2001 h)
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 42/48
42
Execution of an Instruction
Get the data
byte from thememory
Put intoaccumulator
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 43/48
43
8085 Inst ruc tion Set
The 8085 instructions can be classified as follows:
Data transfer operations
Arithmetic operations (ADD, SUB, INR, DCR)
Logic operations
Branching operations (JMP, CALL, RET)
• Between registers
• Between memory location and a register
• Direct write to a register / memory
• Between I/O device and accumulator
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 44/48
44
8085 Instruc tion Types
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 45/48
45
Cont.. 8085 Ins tru ctio n Types
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 46/48
46
Cont.. 8085 Ins tru ctio n Types
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 47/48
47
A Simp le Program
Add two hexadecimal numbers:
Load register A (accumulator) with 32 (hex)
Load register B with 48 (hex)
Add the two numbers and save the sum in A
Display accumulator (A) contents at port (01)
End
7/30/2019 Micrprocessor
http://slidepdf.com/reader/full/micrprocessor 48/48
48
A Simple Program