Hardware Reference
In-Depth Information
7.2 I/O Related Issues
A brief introduction to the I/O operation and I/O devices was given in Chapter 4. In this
chapter, the issues related to I/O addressing, I/O synchronization, electrical characteristics com-
patibility, and HCS12 I/O ports configuration are explored. More complicated I/O devices such
as liquid crystal displays (LCDs), keypads and keyboards, stepper motors, and D/A converters
will be explained.
7.3 I/O Addressing Issue
I/O devices are also called peripheral devices in the sense that they are outside the core of a
computer system. To perform an I/O operation, the CPU needs to specify the I/O device that it
intends to deal with. This involves two issues.
Address space . This issue is related to the question of whether I/O devices should
be treated the same as memory devices, that is, whether the I/O devices should
occupy the same address space (some people like to call it memory space ) as the
memory devices (SRAM, DRAM, EEPROM, or flash memory). Both approaches
have been used by microprocessor and microcontroller vendors. The current trend
is for I/O devices and memory components to share the same memory space.
Addressing modes and instructions . I/O devices may have their own addressing
modes and instruction set or share the same addressing modes and instruction set
with the memory devices. In the first approach, the microprocessor may use the
following instructions for input and output:
out 3: sends data in accumulator to I/O device at address 3.
in 5: inputs a byte from input device 5 to the accumulator.
In the second approach, the microprocessor uses the same instructions and addressing
modes to perform input and output operations. Again, the current trend is the second
approach.
Traditionally, Motorola microprocessors and microcontrollers have used the same address-
ing modes and instruction sets to access I/O and memory devices. Memory and I/O devices
share a single memory space.
7.4 I/O Synchronization
As described in Section 1.3.2, microprocessors either cannot provide the current required
by the peripheral devices or operate at a voltage level different from those of peripheral de-
vices. Therefore they usually communicate with peripheral devices via interface chips. For
the microcontroller, the functions of most of these interface chips are built into the same
chip as the microcontroller. When transferring data in the parallel format (multiple bits at a
time), the microcontroller reads and writes data through the parallel port. When transferring
data in the serial format (1 bit in one clock cycle), the microcontroller reads and writes data
through the serial interface such as a serial communication interface (SCI), serial peripheral
interface (SPI), inter-integrated circuit (I 2 C), or controller area network (CAN).
Because data transfers go through the interface chip (or logic for the MCU), the syn-
chronization issue occurs in two places. One is between the processor and the interface chip
 
Search WWH ::




Custom Search