Appendix A Data Transfer in Digital Systems

A.1 Serial Interfaces

A large number of sensors in the and engine systems require only a low volume data transfer between the sensors, the microcontroller and the central processor. Because every computer depends on the communica- tion with peripheral devices, it contains components for data transfer with external equipment. Prevalent on PCs as well as on industrial, scientific and consumer devices is the RS-232 (EIA-232) serial port as a means of control, monitoring and low volume data transfer. One port can connect to only one peripheral device. A serial port transmits and receives data one bit at a time over one wire. While it takes longer to transfer data this way, only a few wires are re- quired. Two way (full duplex) communication is available with only three separate wires, one to transmit, one to receive and a common ground wire. The RS-232 specifications include numerous additional control lines, which are used for special applications only. Generally processors internally use 8-, 16-, 32-, or 64-bit parallel data buses for faster processing. Thus data intended for transmission on a serial data line has to be converted from a parallel to a serial data stream. Like- wise data received has to be converted from a serial to a parallel data stream. These conversions can be performed by applying appropriate soft- ware, which is a method generally used on microcontrollers. A specific piece of hardware that converts data between a parallel and an RS-232 interface in both directions is the UART (Universal Asyn- chronous Receiver-Transmitter). The RS-232 serial port is an asynchro- nous device. For an asynchronous transmission its start is identified by a start bit and the end by one and a half or two stop bits. The data bits are sent to the receiver after a start bit. Such a data character usually consists of 7 or 8 bits. A parity bit may optionally be transmitted after the data. The transmitter and the receiver must agree on the number of data bits and the transfer rate. After converting a character to be transmitted from parallel to serial, the UART adds the start and stop bits and sends the result to the se- 200 Appendix A Data Transfer in Digital rial port. Every character received is stored, the start and stop bits are re- moved and the character is converted from serial to parallel. Then it is ready to be read by the processor. The UART usually does not directly generate or receive the external signaling levels (voltages) that are used between the devices. An interface is used to convert the logic level signals of the UART to the external sig- naling levels. All signals are measured in reference to a common ground. A positive voltage between 3 and 15 V represents a logical 0 and a nega- tive voltage between -3 and -15 V a logical 1. This switching between positive and negative is called bipolar. The zero state is not defined and is considered to be a faulty condition (this happens when the device is not operating). The dead area between +3 and -3 V is designed to absorb noise. By employing the RS-232 specification, use is made of a mature and universally available PC technology. If higher noise immunity, higher data transfer rates and more complex networks are necessary, one of two other serial interfaces is used. These are the (TIA/EIA) RS-422 and RS-485. These use two twisted wires for the data transmission. On one line a true signal is transmitted and on the other an identical signal but of opposite polarity. This produces opposing currents and magnetic fields, thus mini- mizing the emitted electromagnetic interference by cross-canceling the op- posite fields around each wire pair. Furthermore noise is coupled to both wires of the pair in the same way and thus is common to both signals. As the receiver evaluates the difference between the vol