Professional Documents
Culture Documents
A. Introduction
B. Input/Output Subsystems and Registers
C. Memory or Input/Output Mapping
D. Interfacing Using Polling or Interrupts
E. The Parallel I/O Subsystem
F. Serial Systems
G. Analog/Digital I/O Subsystems
H. The I/O Subsystem Registers
I. Interface Standards
Introduction
z An interface is a device z The process of reading
and/or set of rules to input signals and
match the output of one sending output signals is
device to send inf to the called I/O
input of another device z I/O conventions
z physical connection z I/O direction is relative to
z the hardware the MCU
z rules and procedures z Input is data read by the
z the software MCU
z Interfacing is the z Output is data sent out by
the MCU
process of connecting
devices together so that
they can exchange info
ENGG4640/3640; Fall 2004; Prepared by Radu Muresan 2
1
Interfacing Concepts
A. Introduction
B. Input/Output Subsystems and Registers
C. Memory or Input/Output Mapping
D. Interfacing Using Polling or Interrupts
E. The Parallel I/O Subsystem
F. Serial Systems
G. Analog/Digital I/O Subsystems
H. The I/O Subsystem Registers
I. Interface Standards
2
Input/Output Subsystems and Registers
3
Interfacing Concepts
A. Introduction
B. Input/Output Subsystems and Registers
C. Memory or Input/Output Mapping
D. Interfacing Using Polling or Interrupts
E. The Parallel I/O Subsystem
F. Serial Systems
G. Analog/Digital I/O Subsystems
H. The I/O Subsystem Registers
I. Interface Standards
4
Memory or Input/Output Mapping
z Input/Output
mapping technique IN AL,03H ;read turn lever status
z Have separate AND AL,00000001B ;left turn?
JE NO_LEFT ;if no go to no_left
memory and I/O IN AL,04H ;get old output status
instructions AND AL,01111111B ;turn off right
;signal indicator
z Ex. Intel, Zilog OR AL,01000000B ;turn on left
models ;signal indicator
z Ex. Turn indicator OUT 04H,AL ;this sends out
;the new data
application using
8086
5
Memory or Input/Output Mapping
#include <hc11.h> #include <hc11.h>
Interfacing Concepts
A. Introduction
B. Input/Output Subsystems and Registers
C. Memory or Input/Output Mapping
D. Interfacing Using Polling or Interrupts
E. The Parallel I/O Subsystem
F. Serial Systems
G. Analog/Digital I/O Subsystems
H. The I/O Subsystem Registers
I. Interface Standards
6
Interfacing Using Polling or Interrupts
z Polled I/O
z Interrupt-driven I/O
Polled I/O
z Configuration z Description
z refers to the initial z the MCU checks
settings for a subsystem periodically whether a
z each subsystem has its peripheral requests
own control register servicing => polling
z a bit in the control z when there is a request
register selects polled the MCU performs the
I/O mode data transfer operation
z read or write
7
Polled I/O
z Request z Servicing: through
z an external peripheral an I/O routine
may request service by z input: peripheral
pulsing an I/O request line sends data to the I/O
z a L-H or H-L transition port => data register
causes a flag bit in the z output: the MCU will
status register to be set write data to the data
(or reset) register => I/O port
z Polling
z the MCU reads (polls) the
status register periodically
to check the status flags
Interrupt-Driven I/O
Control Register
Status Register
Program Interrupt
Interrupt request Service
Routine
(ISR)
MCU stacks CPU registers
MCU sets mask interrupt bit
ENGG4640/3640; Fall 2004; Prepared by Radu Muresan 16
8
Interfacing Concepts
A. Introduction
B. Input/Output Subsystems and Registers
C. Memory or Input/Output Mapping
D. Interfacing Using Polling or Interrupts
E. The Parallel I/O Subsystem
F. Serial Systems
G. Analog/Digital I/O Subsystems
H. The I/O Subsystem Registers
I. Interface Standards
9
Interfacing Concepts
A. Introduction
B. Input/Output Subsystems and Registers
C. Memory or Input/Output Mapping
D. Interfacing Using Polling or Interrupts
E. The Parallel I/O Subsystem
F. Serial Systems
G. Analog/Digital I/O Subsystems
H. The I/O Subsystem Registers
I. Interface Standards
Serial Systems
z Synchronous serial I/O subsystems
z Asynchronous serial I/O subsystems
10
Synchronous Serial I/O Subsystem
11
Asynchronous Serial I/O Subsystem
12
Programmable
Timer I/O
Subsystem
By using a timer
the CPU does not
have to execute
software
time-delay loops
to keep track
of time
Applications:
* automotive
* speed control of
a dc motor
* reference timing
signals etc.
Interfacing Concepts
A. Introduction
B. Input/Output Subsystems and Registers
C. Memory or Input/Output Mapping
D. Interfacing Using Polling or Interrupts
E. The Parallel I/O Subsystem
F. Serial Systems
G. Analog/Digital I/O Subsystems
H. The I/O Subsystem Registers
I. Interface Standards
13
Analog/Digital I/O Subsystem
14
Interfacing Concepts
A. Introduction
B. Input/Output Subsystems and Registers
C. Memory or Input/Output Mapping
D. Interfacing Using Polling or Interrupts
E. The Parallel I/O Subsystem
F. Serial Systems
G. Analog/Digital I/O Subsystems
H. The I/O Subsystem Registers
I. Interface Standards
15
Control Registers and System
Configuration
IE = Interrupt Enable
enabled or disabled
LE = I/O Request Level
active high or low
ED = I/O Request edge sensitive
edge or level sensitive
DIR = I/O Data Direction
output or input
TM = Transfer Mode
depends on subsystem
16
Status Registers
Data Registers
17
Interfacing Concepts
A. Introduction
B. Input/Output Subsystems and Registers
C. Memory or Input/Output Mapping
D. Interfacing Using Polling or Interrupts
E. The Parallel I/O Subsystem
F. Serial Systems
G. Analog/Digital I/O Subsystems
H. The I/O Subsystem Registers
I. Interface Standards
Interface Standards
z Technical associations have become
standards organizations
z The Institute of Electrical and Electronics
Engineering (IEEE)
z The American National Standards Institute (ANSI)
z The International Standards Organization (ISO)
18