Академический Документы
Профессиональный Документы
Культура Документы
Chapter 4
Interfacing methods
16:16:56
4.1 Introduction
Input device
Busy Done Busy Done
Software
Waiting for new input Read data Process data Waiting Read data
Time
Output device
Done Busy Done Busy
Software
Generate Write Generate Waiting Write Generate Waiting
Time
Interfacing methods
• Blind: The software simply waits a fixed amount of time and
assumes the I/O will complete after that fixed delay. Used in
situations where the I/O speed is short and predictable.
• Busy-wait: The software waits for the done state. Used in
situations where the software system is relatively simple and
real-time response is not important.
• An interrupt: The hardware causes special software
execution.Used in situations where the software system is fairly
complicated or when real-time response is important.
• Periodic polling: Periodically check the I/O status. Used in
situations that require interrupts, but the I/O device does not
support interrupt requests.
• Direct memory access (DMA): Transfers data directly to/from
memory.Used in situations where bandwidth and latency are
important.
Microcomputer principles and applications
16:16:56
4.2 Timing diagrams
Output
MCU
device
WR
Busy
En
Input
MCU
device
RD
Busy
En
Peripheral
MCU
device
WR/RD
Busy
En
One frame
5V
Serial port Start b b1 b b3 b b5 b b7 Stop
0V
A start bit (0), 8 bits of data (least significant bit first), and a stop bit
(1). This protocol is used for both transmitting and receiving.
• 8-bit
• Logical Function : Shift Register
• Output Type : 3-State
P1.0 (LAT)
P1.1 (CLK)
P1.2 (DATA)
GND
VCC