Data Transfer Modes
Logical data in microcomputers is represented as
bits (binary digits). Bits are customarily explained through tables that
illustrate each bit's contribution to some overall logical scheme. Although the
bit is an intellectual construction, it is, nevertheless, physically a voltage
whose magnitude gives the bit his value (i.e 1 or 0).
When bits must be moved about within the computer itself, they are
transmitted along wires. If the data to be transmitted is in 8-bits format
bytes, then eight separate, discrete wires must simultaneously carry the eight
representative electrical voltages between the two points. This simultaneous
transmission of the eight bit-voltages that constitute a byte is referred to as
"parallel transfer". Parallel transfer, then,is done
byte-by-byte.Since all eight bits arrive at their destination at the same
instant, parallel data transfer can be accomplished at extremely high speeds.
These qualities make it the preferred method of data transfer whenever possible.
Data transfer, especially high-speed data transfer,demands a tightly
controlled environment. The internal temperature of the computer must be
regulated and the electrical properties of resistance, capacitance, and
inductance carefully pre-calculated. As long as data is being moved about inside
a computer, this environment is stable and predictable. But a great deal of
computer data must be transported to the outside world. Microcomputers
communicate with peripheral devices such as printers, terminals, modems, print
buffers,etc. These processes are known collectively as input/output, or simply
I/O.
The Interface
An interface is the point of contact between
dissimilar environments; Between the computer's circuitry and external devices.
Since an interface is a sort of "door" to the computer's world , it is sometimes
called an I/O port ,or just a port.
The primary objective of any interface is to provide a medium for the
transfer of data. Further more, self-protection and usability are also important
goals for any interface. Once such an interface has been established , the
transfer of data to external environments is possible.
When considering parallel transfer for the interface, two major problems
arise. The first is the wire itself. At least nine wires - eight for the data
bits, one for circuit common ("ground")- are needed. Still more wires are
usually required to control the flow of data across the interface. Another
problem lies in the very nature of the bits/voltages themselves. When a
bit/voltage changes state from a one to a zero, or vice versa, it does so very
rapidly -in the order of nanoseconds (one billionth of a second).This abruptness
is itself an essential part of the process of data transfer. Slow changes
between zero and one are not even recognized as data. As a cable gets longer,its
electrical properties (capacitance & inductance) restrict the abruptness
with which a bit can change between zero and one, and data corruption or loss
becomes likely. Because of this,the speed inherent in parallel data transfers
makes transmission over long cables problematic.
Therefor, its use is restricted to a few peripheral devices (such as
printers) that are likely to be used in close proximity to the computer, or that
must be operate at very high speeds.
The obvious alternative to sending all bits simultaneously on multiple wires
is to send them singly, one after the other. At the receiving end, the process
is reversed and the individual bits are reassembled into the original byte. With
just one bit to transmit at a time,data can be transferred with a simple
electrical circuit consisting of only two wires. This scheme - known as
"Serial Transfer" - reduces the bulk and much of the expense of
the parallel technique.
This saving is offset by a decrease in efficiency: it takes at least eight
times longer to transmit eight individual bits one after the other than to
transmit them all simultaneously in parallel. This speed limit is insignificant
for many typical applications. serial peripheral devices are slow, at least in
comparison to the internal speed of microprocessors. Each involves some
time-consuming, sometimes mechanical process that greatly limits its speed:
printers are limited by the speed of their print-heads, modems by the frequency
restrictions of the telephone lines, and disk drives by their slow rotational
speed.So the speed inherent in the process of parallel data transfer is largely
wasted on such peripheral devices. The serial method, therefore ,can afford to
sacrifice some speed while still adequately servicing the peripheral devices. In
such cases,the sacrifice in speed is inconsequential in comparison to the
increased reliability and transmission range.
Standard Interfaces
There are always several ways to design any
circuit "correctly", any number of perfectly functional interfaces for an
application are possible. In this diversity lies a problem fundamental to all
interface circuitry: compatibility with other interfaces.
In the late 1960's a need surfaced for remote access to mainframe computers.
It become desirable for the end-users to access computers from remote locations.
Short distances- a few hundred feet, perhaps within the same building- could be
spanned by the addition of extra wires. For truly distant remote access,
telephone lines were considered. For many reasons computer data cannot be
injected directly into the telephone network. A translating device - the Modem -
is required.
When computerized telecommunications was in its infancy, the Bell System
supplied most of the data equipment to its lines. Bell naturally exercised
strict control over the modem interface. But as activity in the
telecommunications field increased, and more and different kinds of equipment
began to appear, Bell surveyed the hodgepodge of equipment that the computer
industry was threatening to connect to its lines. It saw little that it liked
and much that it felt would compromise and complicate the delivery of
communications service to the public. The telephone companies predictably
prohibited the connection of most of these devices.
Interfacing Basics
In its simplest form, the RS-232-C interface
consist of only two wires-one to carry data, plus a "circuit
common". The circuit common is the absolute voltage reference for all
the interface circuitry, the point in the circuit from which all voltages are
measured.
A typical DTE device is an ordinary video terminal with a keyboard and a
video display. Data on pin 2 of the DTE is transmitted, while the same data on
pin 2 of a DCE (modem) is received data.
Bidirectional Data
Terminals and modems are not usually one-way
devices- each may also perform the opposite function. For example, modems
usually fetch characters from the telephone line and output them to the
terminal. Similarity, the terminal receives the characters output from the modem
and displays them on the video screen. Bidirectional interchange between the two
devices is directly analogous to the connection of two telephones. The
differences between the DTE and DCE is : DTEs transmit on pin 2 and receive on
pin 3. DCEs transmit on pin 3 and receive on pin 2.
Handshaking
There remains only the straightforward matter of
interactive device control, i.e handshaking. Handshaking is the
way in which the data flow across the interface is regulated and controlled. Two
distinct kinds of handshaking are described in Software
Handshaking and Hardware
Handshaking.
An important distinction between the kinds of signals of the interface is
between data signals and control signals. Data
signals are simply the pins which actually transmit and receive the characters,
while control signals are everything else. If a modem can automatically answer
the telephone, for example, it must be able to report an incoming call
to the computer and not start transferring data to the computer without first
receiving a "OK, I'm ready to receive now" confirmation from the
computer.
There are generally two or three such inquire-confirm pairs on an interface
that allow one device to "talk" to the other. There is in practice no guarantee
that a modem and/or terminal will implement any or all of these handshaking
features. The manufacturers of equipment may arbitrarily decide to apply some of
the standard handshaking, no handshaking at all, or to invent a scheme of their
own.
The RS-232-C Interface Standard
RS-232-C interface was developed for
a single purpose, unambiguously stated by its title:
"Interface Between Data Terminal Equipment and Data Communications
Equipment Employing Serial Binary Data Interchange."
The
interface standard document consist of four parts:
RS-232-C equipment "Compatibility"
While some of the signals on the
RS-232-C interface are implemented almost universally on microcomputers, others
are applied liberally without regard to any established practice. What can be
expected from any device claiming to be "RS-232-C compatible" ?
Areas of RS-232-C Compatibility :
- The prescribed electrical characteristics (voltage, etc) of the
interface are, by necessity, closely observed. If a device claims to be
"RS-232-C compatible" it means that you can connect it to another such
"compatible" device without damaging either. This guarantees that they will
match well enough electrically to permit the exchange of data.
- The voltage levels assigned for zero and one will correspond to those
described in the standard.
- A few pins on the connector are absolutely predictable: * pin 2
& pin 3 are transmitted/received data * pin 7 is Circuit Common.
- A terminal is a DTE. When the standard was written,terminals were
usually printing terminals; there were no video displays like those in use
today. Instead, the computer responded to all commands by printing them.
Printer interfaces therefore are traditionally configured DTE.
- A modem is a DCE. Because the RS-232-C standard was intended to
standardize this interface, modems are nearly always DCE; however a few modem
manufacturers - mindful that computer manufacturers can't decide if their
serial ports should be DTE or DCE - have begun to include switches inside
their equipment to permit the user to rearrange the traditional DCE pin
assignments to DTE. Thus, even the holy distinction that the modem is, by
definition, Data Communication Equipment, is beginning to blur.