Microprocessor Interfacing - Interfacing Concepts
Microprocessor Interfacing - Interfacing Concepts
com/
MICROPROCESSOR INTERFACING
http://tulisnota.blogspot.com/
INTERFACING CONCEPT
Address bus (16 bits)
Peripheral
Peripheral
Input
device
device
Output
interface MPU ROM RAM interface
adapter adapter
Control bus
http://tulisnota.blogspot.com/
INTERFACING CONCEPT
Definition: the interconnection, or linkage, of
the parts within the microprocessor based
system.
Activities over buses:
1. Memory read
2. Memory write
3. I/O read
4. I/O write
5. Interrupt or reset handling
http://tulisnota.blogspot.com/
INTERFACING CONCEPT
Types of Input/Output
1. Isolated Input/Output
2. Memory-mapped Input/Output
http://tulisnota.blogspot.com/
ISOLATED I/O
Memory
address
space FFFFH
I/O address
space
00001H 0001H
00000H 0000H
http://tulisnota.blogspot.com/
MEMORY MAPPED I/O
I/O address are inside memory address
Advantages:
1. More instructions are available to perform I/O
operations
2. More addressing modes are available to perform
input/output operations
Disadvantages:
1. Memory instructions to execute slower
2. Part of memory address space is lost
http://tulisnota.blogspot.com/
MEMORY MAPPED I/O
FFFFFH
EOFFFH
I/O address
space
Memory
E0000H
address
space
00001H
00000H
http://tulisnota.blogspot.com/
INPUT/OUTPUT INSTRUCTION
Mnemonic Meaning Format Operation
Input direct IN Acc, Port (Acc) (Port)
IN
Input indirect (variable) IN Acc, DX (Acc) ((DX))
Output direct OUT Port, Acc (Port) (Acc)
OUT
Output indirect (variable) OUT DX, Acc ((DX)) (Acc)
Example 1:
Write a sequence of instruction that will output the
data FFH to a byte-wide output port at address ABH
of the I/O address space,
http://tulisnota.blogspot.com/
INPUT/OUTPUT INSTRUCTION (CONT.)
Example 1 (answer):
First,
the AL register is loaded with FFH as an
immediate operand in the instruction
MOV AL, FF
Example 2:
Writea series of instruction that will output FFH to
an output port located at address B000H of the I/O
address space.
http://tulisnota.blogspot.com/
INPUT/OUTPUT INSTRUCTION (C0NT.)
Example 2 (answer):
The DX register must first be loaded with the
address of the output. This is done with instruction
MOV DX, BOOO
OUT DX, AL
http://tulisnota.blogspot.com/
INPUT/OUTPUT INSTRUCTION (C0NT.)
Example 3:
Data are to be read in from two byte-wide input
ports at address AAH and A9H and then the output
as word to a word-wide output port at address
B000H. Write a sequence of instruction to perform
this input/output operation.
http://tulisnota.blogspot.com/
INPUT/OUTPUT INSTRUCTION (C0NT.)
Example 3 (answer)
We can first read in the byte from the port at
address AAH into AL and move it to AH. This is done
with instructions
IN AL, AA
MOV AH, AL
OUT DX, AX