Академический Документы
Профессиональный Документы
Культура Документы
Cosc 3P92
Week 11 Lecture slides
COSC 3P92
Input/ Output
Physical I/O
To transfer information between CPU and physical
I/O devices, one may use the following
techniques:
1. programmed I/O
2. interrupt (-driven) I/O
3. direct memory access (DMA)
COSC 3P92
1. Programmed I/O
I/O ports may be addressed using:
1. standard (isolated) I/O address space
eg. Intel
In and OUT instructions
pin on CPU chip indicates whether IO or memory address
space being used. [See next slide]
2. memory-mapped I/O address space
eg. Motorola
devices reside at specific memory locations.
COSC 3P92
8088 i/o
port
control
COSC 3P92
1. Programmed
I/O
Advantages Memory-mapped I/O:
Disadvantages:
I/O interfaces may need more circuitry to recognize larger
addresses.
possible slow down in bus performance.
COSC 3P92
1=output 0=input
I/O port
COSC 3P92
Parallel ports
Each I/O port (as a whole) may be configured as either
input or output.
Command register
0
1
1
0
0
Other control signals
1
B
0
A
1=output 0=input
I/O port A (output)
I/O port B (input)
COSC 3P92
Interrupt I/O
Interrupt-service
routine
perform I/O
transfer
Resume
Return from
interrupt
COSC 3P92
Interrupt I/O
example code:
Setting up interrupt I/O...
move.b
#$81, DDRA
; data direction
move.b
move.b
move.b
#$00, DDRB
#$81, PORTA
#$01, PORTA
;
registers
; start pulse
; to device
...
Device will cause interrupt when ready/done,
and an interrupt routine will complete
transaction...
move.b
PORTB, D1
rte
COSC 3P92
Polled
Daisy-chain
10
COSC 3P92
11
COSC 3P92
12
COSC 3P92
DMA
3 techniques:
1. Block transfer
- whole data block transferred
- CPU can do non-related bus activities in the
meanwhile
2. Cycle stealing
- DMA controller freezes the CPU, and then
does a DMA while CPU frozen
- word-by-word transfer
3. Interleaved
- DMA controller uses CPU cycles that aren't
using the bus, letting DMA xfers and CPU
alternate use of the bus
13
COSC 3P92
14
COSC 3P92
I/O
processo
Each IOP uses DMA to communicate
with devices
rs
Some considerations:
priority system for IOP's sharing system bus
priority system for devices on one IO bus
IOP requires software or hardware to manage different devices
15
COSC 3P92
IO example: LED
16
COSC 3P92
8086 Programmed IO
17
COSC 3P92
8086 Programmed IO
18
COSC 3P92
68000 IO
20
COSC 3P92
68000
IO
21
COSC 3P92
68000 memory
22
COSC 3P92
The end
26