|
|
Sprache Language ![]() ![]()
|
|
RS232 Serial InterfaceThe RS232 transmission protocol was originally developed for data transmission via the telephone line. It was defined that 8-bit data bytes are transmitted. Additionally at the beginning a start bit is sent which marks the start of a data byte. At the end of the byte an additional stop bit is sent. This means that in total 10 bits are sent. The voltage level of a start bit and stop bit is also defined, thus the envelopped user bits are for sure detected. For the transmission of user data the ASCII code (American Standard Code of Information Interchange) was defined so that the information is universal and independent of the type of the data terminals. The interface is designed for the handling and use of modems (Modulator/Demodulator) and contains some special signals for this purpose. Applications like the automotive vehicle testers which also use an RS232 interface, however do not need these modem specific signals. For this equiment it is sufficient to use the RD, TD and GND signals. These signals are explained here in detail. RS232 GlossaryDCE = Data Communications Equipment DCE. This is another word for modem. This is a device which transforms the data in a way that they can be transmitted via a telephone line. Data Communication Equipment (i.e. modems and level converters) are devices that transmit and receive signals and pass them on to other equipment without any processing. DTE = Data Terminal Equipment. This can be e.g. a computer terminal of a mainframe system, which in fact is the origin of the expression. It can be a printer, plotter or PC, etc. Data Terminal Equipments are devices which transmit and/or receive data and process them without passing them on to other eqipment. Null Modem = This expression stands for a RS232 cable connection between two DTEs, which use this transmission protocol, without using modems. This is e.g. the case if a serial printer is connected to a PC. The length of the cable, however, is limited to 10 meters. There are amplifiers available which can be connected in between and allow a much longer cable length. Since there are no modems used, it is necessary to connect the odem specific signals in a certain way to simulate the presence of a modem. The wireing details are described below. RS232 Signal DescriptionRD/RX = Received data. On this wire the data bits from the data terminal (DTE) are received. TD/TX = Transmitted data. On this wire the data bits are transmitted to the data terminal (DTE). CHS GND = Chassis ground. The data terminal and the modem have to have a common ground, to prevent ground loops. DSR = Data Set Ready. This signal is generated by the modem and means that the modem is active and ready to communicate with the data terminal. DTR = Data Terminal Ready. This signal is generated by the data terminal and transmitted to the modem and means that the data terminal is active and ready to comunicate with the modem. DCD/CD = Data Carrier Detect or Carrier Detect. This signal shows that the modems on both sides are connected via the telephone line and are ready to interchange data. RTS = Request To Send. This signal is generated by the data terminal and means that the terminal wants to transmit data. CTS = Clear To Send. This is the response signal from the modem to the data terminal (followng a RTS) and signals that the modem is ready to receive the data from the data terminal and transform them for the telephone line. SIG GND = Signal ground. This ground is the reference ground for all signals. Depending on the equipment this can be a separate ground or it can be connected to the chassis ground. RI = Ring Indicator. Is a signal from the modem to the datat terminal which indicates that an external call is comming in on the telephone line. I.e. the telephone is "ringing". Depending on the application the receiver is "liftet off". The number of rings until lifting off can be set in the modem. RS232 Pin AssignmentView upon the D-SUB 25 pin female connector (socket) +-------------------------------------+ View upon the D-SUB 25 pin male connector (plug) +-------------------------------------+ View upon the D-SUB 9 pin female connector (socket) +-------------------+ View upon the D-SUB 9 pin male connector (plug) +-------------------+
The pin assignment in this table can be used as a wireing schematic for an adpter between the two types of connectors. RS232 Data TransmissionThree Wire (Minimal Connection) between DTE (e.g. PC) and DCE (e.g. modem)DTE DCE Three Wire (Minimal Connection) between DTE (e.g. PC) and DTE (e.g. Plotter)DTE DTE To achieve a safe data transmission via a three wire connection a method should be used in which blocks of data are transmitted and a checksum is calculated for each block. Another possibility is to use the "software handshake" with the Xon (ASCII: 11h) / Xoff (ASCII: 13h) protocol. Full Connection (with Hardware-Hand-Shake) between DTE (e.g. PC) and DCE (e.g. Modem)DTE DCE RS232 Null ModemThis is a full connection (with Hardware-Hand-Shake) between DTE (e.g. PC) and DTE (e.g. plotter). All other pins are not used. This cable can also be used to connect two PCs to exchange data (interlink cable WIN98 / WIN95) DTE DTE Here is another table using the 9pin connectors
Simplified Null Modem ConnectionDTR to DSR and DCD of the own interface. DTR is set if the data terminal is switched on and ready. This signal generates now the DSR signal which simulates to the data terminal, that the modem is ready. Additionaly the DTS signal is connected to the DCD input of the interface, which simulates to the data terminal, that the modem is connected to the modem of the communication partner and that data can be transmitted. RTS to CTS of the own interface. If the data terminal wants to transmit a byte, it sets the RTS signal and expects as a respone from the modem the CTS signal. If both pins are connected it is simulated to the interface of the DTE that data can be transmitted. TD to RD of the communication partner. The transmit line of the first communication equipment has to be connected to the receive line of the second communication equipment and vise versa. Additionally the signal ground and the chassis ground have to be connected between the two stations. Pin Assignment of the simplified Null Modem
Attention! In this case the DTR signal of the printer is connected to the CTS signal of the PC. By this it can be achieved, that in case of an error condition at the printer (e.g. out of paper) the CTS of the PC is deactivated, so that no data are lost. This can be regarded as the "Light" version of the full hardware handshake version. RS232 Mainboard ConnectorsThe serial RS232 output of some mainboards (10pol. DIL) is wired with a flat cable to the connectors in the back of the housing. Two variants of this are known. IBM Assignment:
Everex Assignment:
RS232 Loopback DiagnosticsUsing the fllowing wireing a test adapter can be made to check the function of the RS232 interface e.g. in a PC. 25pin D-Sub female loopback connector (socket) 2 to 3 (TxD to RxD) 9pin D-Sub female loopback connector (socket) 2 to 3 (TxD to RxD) Game Port
|
Safety Software Design Training Web-based training: Safety Software Design for Microcontroller |