Communications between an input/output (I/O) device and the microcomputer take place through an interface. The interface converts data from a form used by one device to a form acceptable by the other.
It must also adjust for speed differences between the processor and I/O devices. The interface circuits used in a microcomputer correspond to the I/O control units of larger systems.
Table of Contents
Input and Output Interface
Two general types of interface devices in use are:
- Serial Interface,
- and Parallel Interface
Serial Port and Serial Interface
A serial port is associated with the serial interface and a serial I/0 device is connected to a PC via the serial port. The serial port uses one line to send data, another line to receive data and few lines to control data flow.
For its simplicity, a serial port is a general-purpose interface that can be used for almost any type of device including modems, mice and keyboards. Most serial ports on a PC conform to RS 232C or RS 422 standards.
Ethernet, Fireware and USB all send data as a serial stream. A serial port is not very efficient way to transfer data as it transports 1 bit at a time. This inefficient data transfer, however, is acceptable for a mouse that transmits small data where speed is not crucial.
The image below shows how data flows through a nine-bit serial interface. A chip called a universal asynchronous receiver transmitter (UART), converts parallel data from the bus into serial data that flows through a serial cable.
Parallel Port and Parallel Interface
A parallel I/O device is connected to the PC through parallel port associated with its parallel interface.
The parallel port has been synonymous with Printer port since early days of microcomputers.
A parallel port can send several bits of data, or an entire byte, across parallel wires simultaneously. Thus it can handle a high volume of data than a serial interface.
The image below shows how data moves through a parallel interface.
Before the advent of USB, the parallel interface was adapted to access a number of peripheral devices such as zip drives, scanners, external modems, sound cards, webcams, external hard disk drives and CD-ROM drives. Adapters are available to run SCSI devices via parallel interface. Other devices such as EPROM programmers and hardware controllers could be connected via parallel port.
On a PC, the parallel port uses a 25-pin connector (DB-25) and is used to connect printers, computers and other devices that need relatively high bandwidth. It is often called a Centronics interface after the company that designed the original standard for parallel communication between a computer and a printer.
A newer type of parallel port, which supports the same connectors as the Centronics interface, is the Enhanced parallel port (EPP) or Extended Capabilities Port (ECP). Both of these parallel ports supports bi-directional communication and their transfer rate is ten times as fast as the Centronics port. Macintoshes have a SCSI port, which is parallel, but more flexible.
Input and Output Methods
There are three basic I/O methods by which data can be read from or written to a peripheral device and RAM. These are programmed I/O, interrupt I/0 and direct memory access (DMA).
Programmed I/O
In programmed I/O, a microprocessor controls all transfers and other I/O operations. This is accomplished with specific input or output instructions.
When an input operation is desired, the microprocessor simply issues an input command and awaits the arrival of data at the data bus. The data are moved to memory from the data bus.
Similarly if an output operation is desired, the microprocessor transmits data to the bus and issue a command to the output devices through the appropriate interface.
Once the data transfer is initiated, the microprocessor must wait for its completion and the bus to be freed before new transfer.
This method is commonly used in PCs, because it Is effective and easily implemented.
Interrupt I/O
This is a device initiated transfer. An interrupt transfer involves the I/O device sending a request to the processor through an interrupt input (INT) to inform the CPU that the I/O device is ready for data transfer.
In response, the CPU interrupts the execution of its current program and jumps to a new program, called interrupt service routine, which contains instructions to transfer data to or from the interrupting device.
DMA
It is a technique for transferring data from main memory to a device without passing it through the CPU.
Computers that have DMA channel can transfer data to and from devices much more quickly than computers without a DMA channel.
This is useful for making quick backups and for real-time applications. Some expansion boards, such as CDROM cards are capable of accessing a computer’s DMA channel.
Key Points
- Communications between an input/output (I/O) device and the microcomputer take place through an interface.
- The serial port uses one line to send data, another line to receive data, and a few lines to regulate data flow.
- A parallel port can send several bits of data, or an entire byte, across parallel wires simultaneously.
- A newer type of parallel port, which supports the same connectors as the Centronics interface, is the Enhanced parallel port (EPP) or Extended Capabilities port (ECP).
- Interrupt I/O is a device initiated transfer.
- DMA is a technique for transferring data from main memory to a device without passing it trough the CPU.