Serial interface rs 232. COM port pinout (RS232)


Signals and contacts of the RS232 interface
Connector 9
pin #
Connector 25
pin #
Designation Full name Direction What means
Transmit Data Transferring data from a computer
Receive Data Receiving data by computer
Request to Send
Clear to Send Hardware control of data transmission type RTS/CTS
Data Set Ready I'm ready to exchange data
Data Terminal Ready I'm ready to exchange data
Carrier Detect One modem connected to another
Ring Indicator Ring (call) on a telephone line
Earth

Note: DCD is sometimes labeled as CD

Signals may have different meanings

Only 3 pins out of 9 have a strictly defined meaning: transmit, receive and ground. These are hardware lines and you cannot change their purpose. But all other signal lines are controlled by software and can be (or are implied to be) mostly for other purposes. However, they can only assume two states: high (installed) (+12 volts) and low (reset) (-12 volts). The set state is "on" and the reset state is "off". For example, Advanced Serial Port Monitor (or more precisely, the user of the program) can control the DTR signal, and the hardware, in turn, supplies it with a voltage of 12 volts with one polarity or another. The modem (or other device) that receives the DTR signal may interpret it differently. In one case, the modem (depending on the model and firmware) may occupy the telephone line if the DTR signal is reset. Otherwise, the modem will ignore the DTR signal in the reset state.

This applies to all 6 signal lines. The hardware only sends and receives these signals, but the action depends (if at all) on the program (such as Advanced Serial Port Monitor) and the configuration of the hardware you connect to the serial port.

Cable connections between serial ports

Working over a serial interface has its advantages. One reason is that all signals are unidirectional. If pin 2 sends data (and does not allow other signals to be received) then it is obvious that you cannot connect a pin of the same type to pin 2. If you do this, you will not be able to send or receive signals on this line. There are two different ways to connect devices. One of them involves connecting two devices of different types, when pin No. 2 of one sends data to pin No. 2 of the second (which receives this signal). This is the path when you connect a computer (DTE) and a modem (DCE). There is also a second way in which devices can be of the same type: connect the sending data pin No. 2 to the data receiving pin No. 3 of the device of the same type. This is a way where you can connect two computers (DTE-to-DTE). The type of cable used in this case is called a null-modem cable because it connects two computers without the use of modems. A null modem is also sometimes called an inverted cable because the wires between pins 2 and d 3 go in reverse. The example above is shown for the contacts of a 25-pin connector, but a 9-pin connector can also be used accordingly.

Control of RTS/CTS and DTR/DSR data transmission

This is the so-called “hardware” control of data transmission. Data transmission control was covered in more detail on another page in the section "Data transmission control", but the contacts and signals were not described. Advanced Serial Port Monitor supports RTS/CTS and DTR/DSR types of hardware control of data transmission. Only the RTS/CTS data transmission control type will be discussed here, since the DTR/DSR data transmission control type functions on the same principle. In order to activate RTS/CTS data transfer control, you only need to select this option in the Advanced Serial Port Monitor settings.

So, if a DTE device (such as a computer) wants to stop transmitting data, it resets the RTS signal state. A reset "Request to Send" signal (-12 volts) means "do not send requests to me" (stop sending). When the computer is ready to accept the next block of data, it sets the RTS signal (+12 volts) and the data flow resumes. Data control signals are always sent in the opposite direction of the data flow they control. DCE devices (modems) work on the same principle, only they send a signal on the CTS pin. Therefore, the RTS/CTS data transfer control type uses 2 lines (wires).

Strictly speaking, the interface RS 232- this is the name of the standard (RS - recommended standard - recommended standard, 232 - its number), describing the interface for connecting a computer and a data transmission device.

The standard was developed quite a long time ago, in the 60s of the 20th century. The current version of the standard, adopted in 1991 by the electronics and telecommunications industry associations, is called EIA/TIA-232-E.

However, most people still use the name RS-232, which is firmly attached to the interface itself.

Devices

The RS-232 interface provides a connection between two devices, one of which is called DTE (Data Terminal Equipment), the second is called DCE (Data Communications Equipment).

Typically, DTE (DTE) is a computer, and DCE (DCE) is a modem, although RS-232 was used both to connect peripheral devices (mouse, printer) to a computer and to connect to another computer or .

It is important to remember these designations (DTE and DCE). They are used in the names of interface signals and help to understand the description of a specific implementation.

Connector types

Initially, the standard described the use of a 25-pin connector, type DB25. A DTE device must be equipped with a plug (male) and a DCE device must be equipped with a socket (female). Later, with the advent of the IBM PC, they began to use a truncated version of the interface and 9-pin DB9 connectors, the most common today.

RS-232 wiring

The table below shows the pin assignments of the 9-pin DB9 connector. The table shows the wiring data processing equipment (DTE) plugs, for example, PC. The data communications equipment (DCE) socket is wired so that the two connectors are mated directly, or via a pin-to-pin cable.

1 - Carrier Detect (CD) Availability of carrier frequency

2 -Received Data (RD) Received data

3 - Transmitted Data (TD) Transmitted data

4 - Data Terminal Ready (DTR) OOD readiness

5 - Signal Ground General

6 - Data Set Ready (DSR) OPD readiness

7 - Request To Send (RTS) Transfer request

8 - Clear To Send (CTS) Ready to transmit

9 - Ring Indicator (RI) Availability of a call signal

The RD and TD circuits are intended for data transmission. The remaining circuits are intended for device status indication (DTR, DSR), transmission control (RTS, CTS) and line status indication (CD, RI). The full set of circuits is used only to connect an external modem to the PC. In other cases, for example, when connecting an industrial controller to a PC, a limited set of circuits is used, depending on the hardware and software implementation of the interface in the controller.

RS-232 cable diagram

As mentioned above, to connect strictly compliant DTE and DCE devices, a contact-to-contact cable is required. To connect two DTE devices, so-called null modem cables are used, in which the wires are “crossed” in accordance with the purpose of the signals. In practice, before unsoldering the cable, you should always understand the documentation for both devices being connected.

The start bit is always a logical zero level, the stop bit is always a logical one. The state of the parity bit is determined by the transmitter configuration. Bit complements the number of single data bits before odd (parity odd), even (parity even), may not be used (parity none), always be one (mark) or zero (space).

Prospects

In fact, RS-232 has no prospects. Currently, more and more computers are appearing that are not equipped with this interface. However, there are a large number of devices with an RS-232 interface in use. To connect PCs to such devices, USB - RS-232 adapters are used.

After connecting such an adapter and installing the drivers, a virtual COM port appears on the PC, through which you can communicate with the device.

Interfaces. It is almost impossible for an ordinary user to identify them and know everything. When a beginner decides to build his own personal computer, many questions arise regarding compatibility. Today we will learn what RS-232 interfaces are.

Concept

If you are faced with the fact that you do not know what kind of connector this is and what it is needed for, then we will look into this further. This standard belongs to the physical layer and was developed as a “sidekick” to the asynchronous interface. Most often, when thinking about RS-232, experts mention the PC serial port.

It so happened that it was often used in the telecommunications industry. Now he is known to everyone thanks to the development of computers. It is connected to a PC if high data transfer rates are not needed, and also if the synchronized device is not located at a long distance. If we have a computer for office work or entertainment, then the RS-232 interfaces are replaced with USB.

Story

In the middle of the last century, active development of technology began, in particular telecommunications. Each company that produced certain equipment developed its own standard for data transmission. Accordingly, it was difficult to use such devices, as compatibility problems arose.

To resolve this issue forever and standardize everything that had already been developed, a special association was organized in 1962. She formed recommendations for the manufacturer, which she called “Recommended Standard 232.” This is how the need to develop RS-232 interfaces arose.

Now character encoding was limited to 5 to 8 bits. The signal voltage did not rise above +25 V and did not fall below -25 V. It was possible to organize service signals, which in general did not necessarily need to be used. Data transfer occurred in two modes: synchronous and asynchronous. Thanks to all the established characteristics, the standard is ideal for telecommunications equipment.

Development

Just seven years after its founding, new editions began to appear. RS-232C was redesigned due to all the shortcomings that were discovered during this time. It was decided to assign 25 pins to the DB25 connector. This option really became a “work on mistakes”, so it did not change for a long time and became the basis for many years to come.

Already in 1983, personal computers using this standard became known. We started using the UART transceiver. One of the new products had as many as 4 such transmitters, which were called COM port.

The development of such standards has begun to gain momentum. Manufacturers realized the principle of action in such situations, so the Association itself began to lose dominance. In 1986, RS changes to EIA. As rights passed from one company to another, a couple more variations of the standard were released. In general, nothing new was introduced into the RS-232 interfaces.

Job

Thanks to this standard, it has become possible to transmit data or special signals between two devices, one of which is a terminal and the other a communication device. Transmission is carried out up to 15 meters, and the maximum speed can reach 115,200 baud. Interestingly, the interface is easy to use and program. Ego is often used when distance needs to be extended. Specialists simply reduce the speed proportionally.

Goals

It is known that the RS-232 serial interface was first used from a telephone modem to a PC. Because of this, he soon acquired rudiments, among which was a separate “Call” line. Over time, Internet devices changed connectors and began to connect using USB. The connector in question has not disappeared from the interface panel, so other manufacturers have decided to create compatible cables for their devices in order to connect to the system. Thus, computer mice with RS-232 became known.

Now this interface is more often found in highly specialized devices, industrial equipment and microprocessor systems. As a result, an RS-232 interface cable is practically never found on modern netbooks or laptops. But some motherboards of stationary systems still have this connector. As a result, there are both single slots and a daisy chain block on the motherboard. To prevent this connector from being useless, some provide converters.

Operation

As you know, the monitored hero is a duplex interface. It transmits data as an asynchronous serial interface. A binary signal passes through the wire, which has received two voltage levels. This is how information is transferred.

If we consider logical indicators, then “zero” is associated with a positive voltage, and “one” is associated with a negative voltage. In order for this structure to work properly, developers use a large number of “firewood” chips. RS-232 interfaces usually have not only standard input and output lines, but also special auxiliary traces to control the flow on the hardware side and regulate special functions.

Lines

Interestingly, this port is equipped with type D, with 25 contacts. Each has its own abbreviation and direction. They have a full name and are responsible for a specific characteristic. So there are transmitted and received data, transmission request and reset, positive and negative voltage, mode equalization, receiver synchronization, ringer indicator, etc.

Classes

If we have a terminal device in front of us, then its connector will be equipped with contacts, but if it is a connected device, then it will have holes. It seems to be a standard position, but sometimes there are exceptions. The RS-232 connection interface signals are divided into classes.

Serial materials of the TXD type work with an independent serial transmission channel, which is divided into primary and secondary. Lines work by transmitting and receiving information.

The RTS control type has the word acknowledgment in its name. It refers to the manner in which serial line signals begin communication from one transmission to the actual one. There is a synchronization class. In this mode, equipment transmits signals among themselves, which simplifies transmission during decoding.

Converters

Before you understand the RS-232 interface converter, it is worth knowing in principle what it is and why it is needed. To make it clearer, a converter is an adapter. If the device has one connector, but you need another, you can simply buy an adapter. Thus, all the necessary slots either become necessary or simply do not take up extra space.

In our case, it is possible to use equipment with RS-232/422/485 interfaces for COM ports. As a result, galvanic isolation of standards occurs, information transfer takes place in difficult conditions with electromagnetic interference. The problem in this case is only related to the fact that a simple connection is not enough; you will have to configure the software level.

In general, different equipment requires its own special technologies to transmit data. Therefore, it is necessary to work with the unification of protocols; converting data into a single form only with a converter is impossible. The task of such an adapter is that it adapts the type of information that is transferred between certain parts of the system with special technologies.

Thus, package processing takes place at the software stage. The program changes the structure of the materials that are transmitted and uses a different protocol.

Classification

It is interesting that any RS-232 interface converter (etherne and others) can be characterized by several parameters. So, the standard is determined by the type of equipment and protocols. They also consider the data transfer rate, which is determined by the maximum amount of materials in a certain time.

The next parameter is the possible data transmission distance, based on the maximum distance of nodes from each other that can transmit information between themselves while maintaining its integrity. The transmission line is represented by the medium where data transfer occurs. Among the parameters is the number of “firewood” and receivers, and it is also possible to analyze the “connection” scheme of the main components.

Examples

In order for RS-232 interfaces to work correctly in conjunction with RS-485/422, you need to acquire not just a converter, but software control. It is worth remembering that not all terminals are used, so out of 10, only the data transmission/reception and signal ground triplets remain. As a result, the conversion process itself is represented by bit-by-bit processing of data from one form to another. At this moment, protocol conversion does not occur, as well as the transformation of the input/output port “firewood”.

The RS-232C interface is intended for connecting equipment that transmits or receives data (DTE - data terminal equipment, or DTE - Data Terminal Equipment) to data channel terminal equipment (DCE; DCE - Data Communication Equipment). A computer, printer, plotter and other peripheral equipment can act as an ADF. The modem usually plays the role of the ADC. The ultimate purpose of the connection is to connect two ADF devices. The complete connection diagram is shown in Fig. 1; The interface allows you to exclude a remote communication channel together with a pair of AKD devices by connecting the devices directly using a null modem cable (Fig. 2).

Fig.1. Complete RS-232C connection diagram


Fig.2. Connection via RS-232C with a null modem cable

The standard describes interface control signals, data transfer, electrical interface, and connector types. The standard provides asynchronous and synchronous exchange modes, but COM ports only support asynchronous mode. Functionally, RS-232C is equivalent to the CCITT V.24/V.28 standard and the C2 interface, but they have different signal names.

The RS-232C standard describes single-ended transmitters and receivers - the signal is transmitted relative to a common wire - circuit ground (balanced differential signals are used in other interfaces - for example, RS-422). The interface does not provide galvanic isolation of devices. A logical one (MARK state) at the data input (RxD signal) corresponds to a voltage range from –12 to –3 V; logical zero - from +3 to +12 V (SPACE state). For control signal inputs, the ON (“on”) state corresponds to a range from +3 to +12 V, the OFF (“off”) state corresponds to –12 to –3 V. The range from –3 to +3 V is a dead zone that determines Receiver hysteresis: the line state will be considered changed only after crossing the threshold (Fig. 3). The signal levels at the transmitter outputs must be in the ranges from –12 to –5 V and from +5 to +12 V. The potential difference between the circuit grounds (SG) of the connected devices must be less than 2 V; with a higher potential difference, incorrect perception of signals is possible . Note that TTL level signals (at the inputs and outputs of UART chips) are transmitted in direct code for the TxD and RxD lines and in inverse code for all others.

The interface assumes a protective ground for the devices being connected if they are both AC powered and have surge protectors.

ATTENTION

Connecting and disconnecting interface cables of self-powered devices must be done with the power turned off. Otherwise, the difference in uneven potentials of devices at the time of switching may be applied to the output or input (which is more dangerous) interface circuits and damage the microcircuits.

The RS-232C standard regulates the types of connectors used.

On ADF equipment (including COM ports), it is customary to install DB-25P plugs or a more compact version - DB-9P. Nine-pin connectors do not have pins for the additional signals required for synchronous mode (most 25-pin connectors do not use these pins).

DB-25S or DB-9S sockets are installed on AKD equipment (modems).

This rule assumes that AKD connectors can be connected to ADF connectors directly or through adapter “straight” cables with a socket and plug, in which the contacts are connected “one to one”. Adapter cables can also be adapters from 9 to 25 pin connectors (Fig. 4).

If the ADF equipment is connected without modems, then the connectors of the devices (plugs) are connected to each other with a null-modem cable (Zero-modem, or Z-modem), which has sockets at both ends, the contacts of which are connected crosswise according to one of the diagrams shown in Fig. 5.


Rice. 3. Receive RS-232C signals

Rice. 4. Modem connection cables


Rice. 5. Null modem cable: a - minimal, b - full

If a socket is installed on any ADF device, it is almost 100% that it must be connected to another device with a straight cable, similar to the modem connection cable. The socket is usually installed on those devices that do not have a remote connection via a modem.

In table 1 shows the assignment of the contacts of the COM port connectors (and any other ADF data transmission equipment). The DB-25S connector pins are defined by the EIA/TIA-232-E standard, the DB-9S connector is defined by the EIA/TIA-574 standard. For modems (AKD), the names of the circuits and contacts are the same, but the roles of the signals (input-output) are reversed.

Table 1. Connectors and signals of the RS-232C interface

Circuit designation

Connector pin

PC remote connector cable wire no.

Direction

1 Ribbon cable for 8-bit multicards.
2 Ribbon cable for 16-bit multicards and ports on motherboards.
3 Option for ribbon cable ports on motherboards.
4 Wide ribbon cable to 25-pin connector.

Let's consider a subset of RS-232C signals related to asynchronous mode from the point of view of the PC COM port. For convenience, we will use the name mnemonic adopted in the descriptions of COM ports and most devices (it differs from the faceless designations of RS-232 and V.24). Let us recall that the active state of the control signals (“on”) and the zero value of the transmitted data bit corresponds to a positive potential (above +3 V) of the interface signal, and the “off” state and the unit bit correspond to a negative potential (below –3 V). The purpose of the interface signals is given in table. 2. The normal sequence of control signals for the case of connecting a modem to a COM port is illustrated in Fig. 6.

Table 2. Purpose of RS-232C interface signals

Purpose

Protected Ground - protective ground, connected to the device body and cable shield

Signal Ground - signal (circuit) ground relative to which signal levels apply

Transmit Data - serial data - transmitter output

Receive Data - serial data - receiver input

Request To Send - data transfer request output: the “on” state notifies the modem that the terminal has data to transfer. In half-duplex mode, it is used to control direction - the “on” state serves as a signal to the modem to switch to transmit mode

Clear To Send - input for allowing the terminal to send data. The “off” state prohibits data transmission. The signal is used for hardware flow control

Data Set Ready - input of a readiness signal from data transmission equipment (the modem is connected to the channel in operating mode and has completed actions in coordination with the equipment at the opposite end of the channel)

Data Terminal Ready - output signal that the terminal is ready for data exchange. The “on” state keeps the switched link in a connected state

Data Carrier Detected - remote modem carrier detection signal input

Ring Indicator - call indicator input. In a switched channel, this signal is used by the modem to indicate that the call has been accepted.


Rice. 6. Sequence of interface control signals

  1. By setting DTR, the computer indicates its desire to use a modem.
  2. By installing DSR, the modem signals that it is ready and that the connection has been established.
  3. With the RTS signal, the computer requests permission to transmit and declares its readiness to receive data from the modem.
  4. With the CTS signal, the modem notifies that it is ready to receive data from the computer and transmit it to the line.
  5. By removing CTS, the modem signals that further reception is impossible (for example, the buffer is full) - the computer must pause data transmission.
  6. With the CTS signal, the modem allows the computer to continue transmission (there is space in the buffer).
  7. Removing RTS can mean either that the computer's buffer is full (the modem must pause data transmission to the computer) or that there is no data to transfer to the modem. Typically, in this case, the modem stops sending data to the computer.
  8. The modem confirms the removal of the RTS by resetting the CTS.
  9. The computer resets RTS to resume transmission.
  10. The modem confirms its readiness for these actions.
  11. The computer indicates the exchange is complete.
  12. The modem responds with confirmation.
  13. The computer reads the DTR, which is usually a signal to disconnect (“hang up”).
  14. The modem resets the DSR to signal that the connection is broken.

From considering this sequence, the DTR–DSR and RTS–CTS connections in null modem cables become clear.

Asynchronous transfer mode

Asynchronous transfer mode is byte-oriented (character-oriented): the minimum unit of information transferred is one byte (one character). The byte sending format is illustrated in Fig. 7. The transmission of each byte begins with a start bit, which signals the receiver to begin sending, followed by data bits and, possibly, a parity bit. The transmission ends with a stop bit, which guarantees a pause between transmissions. The start bit of the next byte is sent at any moment after the stop bit, that is, pauses of arbitrary duration are possible between transmissions. The start bit, which always has a strictly defined value (logical 0), provides a simple mechanism for synchronizing the receiver with a signal from the transmitter. It is assumed that the receiver and transmitter operate at the same baud rate. The internal clock generator of the receiver uses a counter-divider of the reference frequency, which is reset to zero at the moment the start of the start bit is received. This counter generates internal strobes by which the receiver records subsequent received bits. Ideally, the strobes are located in the middle of the bit intervals, which allows data to be received even with a slight mismatch between the speeds of the receiver and transmitter. Obviously, when transmitting 8 bits of data, one control bit and one stop bit, the maximum permissible speed mismatch at which the data will be recognized correctly cannot exceed 5%. Taking into account phase distortions and discrete operation of the internal synchronization counter, a smaller frequency deviation is actually permissible. The smaller the internal oscillator reference frequency division factor (the higher the transmit frequency), the greater the error in pinning the gates to the middle of the bit interval, and the frequency consistency requirements become more stringent. The higher the transmission frequency, the greater the effect of edge distortion on the phase of the received signal. The interaction of these factors leads to increased requirements for frequency matching between the receiver and transmitter as the exchange frequency increases.


Fig.7. RS-232C asynchronous transmission format

The asynchronous sending format allows you to identify possible transmission errors.

  • If an edge signaling the start of a transmission is received, and the start bit strobe detects a logical one level, the start bit is considered false and the receiver goes back to the waiting state. The receiver may not report this error.
  • If a logic zero level is detected during the stop bit time, a stop bit error is detected.
  • If parity is used, a parity bit is sent after the data bit is sent. This bit complements the number of one data bits to even or odd depending on the convention adopted. Receiving a byte with an incorrect check bit value results in an error being detected.
  • Format control allows you to detect a line break: as a rule, when a line is broken, the receiver “sees” a logical zero, which is first interpreted as a start bit and zero data bits, but then the stop bit control is triggered.

For asynchronous mode, a number of standard exchange rates have been adopted: 50, 75, 110, 150, 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600 and 115200 bps. Sometimes baud is used instead of the unit of measurement “bit/s”, but this is incorrect when considering binary transmitted signals. It is customary to measure the frequency of line state changes in baud, and with a non-binary coding method (widely used in modern modems) in a communication channel, bit rates (bit/s) and signal changes (baud) can differ several times.

The number of data bits can be 5, 6, 7 or 8 (5- and 6-bit formats are not very common). The number of stop bits can be 1, 1.5 or 2 (“one and a half bits” only means the duration of the stop interval).

Data Flow Control

To control the flow of data (Flow Control), two protocol options can be used - hardware and software. Flow control is sometimes confused with handshaking. Handshaking involves sending a notification that an element has been received, while flow control involves sending a notification about the possibility or impossibility of later receiving data. Often flow control is based on a handshaking mechanism.

The hardware flow control protocol RTS/CTS (hardware flow control) uses the CTS signal, which allows you to stop data transmission if the receiver is not ready to receive it (Fig. 8). The transmitter “releases” the next byte only when the CTS line is turned on. It is impossible to delay a byte that has already begun to be transmitted with a CTS signal (this guarantees the integrity of the package). The hardware protocol ensures the fastest response of the transmitter to the state of the receiver. Asynchronous transceiver microcircuits have at least two registers in the receiving part - a shifting one, for receiving the next message, and a storing one, from which the received byte is read. This allows you to implement exchange using a hardware protocol without data loss.


Fig.8. Hardware flow control

The hardware protocol is convenient to use when connecting printers and plotters, if they support it. When connecting two computers directly (without modems), the hardware protocol requires a cross-connection of the RTS - CTS lines.

With a direct connection, the transmitting terminal must ensure the “on” state on the CTS line (by connecting its own RTS - CTS lines), otherwise the transmitter will be “silent”.

The 8250/16450/16550 transceivers used in the IBM PC do not process the CTS signal in hardware, but only display its status in the MSR register. The implementation of the RTS/CTS protocol rests with the BIOS Int 14h driver, and calling it “hardware” is not entirely correct. If a program using a COM port interacts with the UART at the register level (and not through the BIOS), then it processes the CTS signal itself to support this protocol. A number of communications programs allow you to ignore the CTS signal (unless a modem is used), and they do not require the CTS input to be connected to the output of even their RTS signal. However, there are other transceivers (for example, 8251), in which the CTS signal is processed in hardware. For them, as well as for “honest” programs, the use of the CTS signal on connectors (or even on cables) is mandatory.

The XON/XOFF flow control software protocol assumes a bidirectional data link. The protocol works as follows: if the device receiving data detects reasons why it cannot continue to receive it, it sends the XOFF character byte (13h) over the reverse serial channel. The opposite device, having received this character, pauses the transmission. When the receiving device becomes ready to receive data again, it sends an XON (11h) symbol, upon receiving which the opposite device resumes transmission. The transmitter's response time to a change in the receiver's state compared to the hardware protocol increases by at least the time it takes to transmit a symbol (XON or XOFF) plus the time the transmitter program reacts to receiving a symbol (Fig. 9). It follows from this that lossless data can only be received by a receiver that has an additional buffer of received data and signals its unavailability in advance (having free space in the buffer).


Fig.9. Software flow control XON/XOFF

The advantage of the software protocol is that there is no need to transmit interface control signals - the minimum cable for two-way communication can have only 3 wires (see Fig. 5, a). The disadvantage, in addition to the mandatory presence of a buffer and longer response time (which reduces the overall performance of the channel due to waiting for the XON signal), is the difficulty of implementing a full-duplex exchange mode. In this case, flow control characters must be extracted (and processed) from the received data stream, which limits the set of transmitted characters.

In addition to these two common standard protocols, supported by both the PU and the OS, there are others.

About RS-232 (unsoldering of cables, connectors, brief description)

RS-232C contacts

Wiring out the “modem” cable for the RS-232C interface

Communication and RS-232 interface

Troubleshooting RS-232 Communications

RS-232C contacts

Contacts of the DB-9 connector of the RS-232C interface

Wiring out the “modem” cable for the RS-232C interface

Wiring out a "null modem" cable for the RS-232C interface

RS-232C cable wiring for Kramer switches

Communication and RS-232 interface

When working in potentially noisy environments, we need reliable means of transmitting data. The most common standard is still the archaic RS-232C (Recommended Standard 232 Version C), adopted by the EIA (Electronic Industries Association) in August 1969.
Advantages of RS-232:
Popular - all PC computers (but not Macs) are equipped with at least one RS-232 port
Ease of purchasing ready-made cables
Possibility of using hardware control of the transfer process (often not used!)
Disadvantages of RS-232:
Point-to-point communications (DTE? DCE)
Low speed by modern standards (usually 9600 baud [bits per second])
Works only at short distances (up to 10 m)
The composition of the communication lines between DTE and DCE devices is not precisely defined. The standard describes the functions of up to 25 trunk lines, but does not specify whether a particular line should or should not be used. Things are better (technologically) in the RS-422 standard. According to this standard, communication is carried out over two pairs of wires, and the transmitted signal can be received by more than one device. The RS-485 (Enhanced RS-422) standard uses a single pair of wires that is used for transmission or reception by many devices.
RS-422/RS-485 Features and Benefits:
Can be used for multipoint connections
Is the de facto standard for much of the broadcast video industry!
Can be used at distances up to 1.2 km
High noise immunity due to the use of differential (balanced) communication lines
Communication line extender KRAMER VP-43 Range Extender:
Designed to overcome the distance limitations of our RS-232 controlled products.
Converts to the RS-422 interface, and then back to RS-232, which allows you to use two pairs of wires as a physical medium.
Can be used to extend communication distance for any RS-232 null modem connection.
It can also be used to control our products via RS-422, or as a general purpose converter from RS-232 to RS-422 and vice versa.
KRAMER VP-14 Port Extender:
Designed to overcome the limitation of the RS-232 interface, which can only make point-to-point connections. Allows communication between multiple devices with RS-232 interfaces.
Data that arrives at any of the device ports is forwarded to the other 3 ports.
Can be used to control the switch from 3 DTE devices (eg computers).
Works in all communication modes (number of bits, speed, parity, etc.) and does not require configuration of these parameters.

Troubleshooting RS-232 Communications

The following steps may help resolve problems encountered when communicating with Kramer devices via the RS-232 interface.
1. Make sure that a null modem connection is established between the device (switch, router) and the control computer (PC).
The easiest way (when using a 25-pin port on a PC) is to use the null modem adapter included with the device. Connect such an adapter with a 25-pin connector to the serial port of the PC, then use a straight cable - that is, with one-to-one wiring - connect the 9-pin connector of the adapter to the serial port on the device. (If the adapter is used with a partial cable, a minimum of 9-pin connectors must be connected at both ends: pin 2 to pin 2, 3 to 3, and 5 to 5.)
When directly connecting the 25-pin port on the PC to the 9-pin connector on the device (i.e. without a null modem adapter), connect the following:
Pin 2 on a 25-pin connector - with pin 2 on a 9-pin connector
Pin 3 on a 25-pin connector - with pin 3 on a 9-pin connector
Pin 7 on a 25-pin connector - with pin 5 on a 9-pin connector
Short together pins 6 and 20 on the 25-pin connector
Short pins 4, 5 and 8 together on the 25-pin connector
When directly connecting the 9-pin port on the PC to the 9-pin connector on the device, connect the following:
Pin 2 on the PC connector - with pin 3 on the device connector
Pin 3 on the PC connector - with pin 2 on the device connector
Pin 5 on the PC connector - with pin 5 on the device connector
Short together pins 4 and 6 on the PC connector
Short together pins 1, 7 and 8 on the PC connector
2. Make sure that all DIP switches on the device are set correctly.
3. Make sure that the settings for the data transfer speed on the PC and on the device match, and the correct com port is selected on the PC.
4. If multiple devices are being used at the same time, make sure they are all turned on. If any of the devices are turned off in a master/slave system, communication in such a system will not be reliable.
5. If your device has a “DISABLE TXD” feature, make sure this feature is turned off; Likewise, if a DIP switch is used to “disable reply”, ensure that reply is enabled.
6. Pin 3 on the RS-232 connector of the device is used to send data to the PC (this is TXD of the device and RXD to the PC). Pin 2 on the device connector is used to receive data from the PC (these are RXD devices and TXD on the PC). It may be useful to use a digital storage oscilloscope to verify that the device is transmitting/receiving data on the specified pins.
7. Most devices use a “bidirectional” communication protocol. This means that the same code is used both to send a command to the device to perform a certain action, and as a response from the device (in the PC) when you press a button on its front panel to perform a similar action. For example, if the user pressed the buttons and switched input 4 to output 5, the device sends the hexadecimal code 7B to the computer; at the same time, when the device receives code 7B, it will also work out the connection of input 4 to output 5. For such a protocol, it may be useful to analyze the codes sent by the device when pressing the buttons on its front panel in order to understand the communication protocol.
8. When troubleshooting, it may be helpful to use a communications program like Procomm or Viewcom to first analyze the codes the device is sending. Then you can try sending such codes back (see point 7), checking that the device responds to them correctly. Finally, you can send a code that will return the device to its state.
9. If a user-written program is to be used, if possible, first verify that communication between the PC and the device is working properly using a proprietary program.
10. For equipment where RS-232 control is an option and is enabled by installing an additional hardware board, ensure that the board is installed correctly (as described in the manual). In particular, for the X02 series of switches, check the straight cable connected to the module and make sure that there are no jammed pins on the connectors.
11. Some devices may receive control from other pieces of equipment and may be configured to operate via RS-232 with that equipment rather than with a computer. In this case, you must configure the device correctly. For example, the BC-2216 and BC-2616 (16X16 Audio Matrix Switchers) are factory configured (default) to work with the BC-2516 (16X16 Video Matrix Switcher). In this case, the sound matrix receives control from the PC through the video matrix. If the sound matrix is ​​to be controlled independently, it should be reconfigured accordingly (to operate as an audio-only switching device).
12. If you need to send several commands, then before sending an additional command you should make sure that the device has processed the previous command. To do this, wait until the previous command receives a response before sending the next one.
13. Make sure that you are using a real RS-232 interface to communicate with the device! Some equipment (such as the standard Macintosh serial port), although similar to RS-232, uses different communication modes.
14. When using a PC with the Windows NT4.0 (or lower) operating system, additional measures should be taken. This system is not plug and play and therefore setting up the computer ports on it is not an easy task. Please refer to your Windows NT documentation! Even if your program is running on a computer with a different operating system, it is possible that under Windows NT the port will not initialize correctly.
15. Please note that the operating distance for RS-232 (by definition) does not exceed 10 meters! If longer communication length is required, our VP-43 "Link Extender" should be used.
16. By definition, the RS-232 interface is intended for communication between 2 ports (in our case, a PC and a switch). If you need to connect together several devices with RS-232 interfaces, you can use VP-14 (for example, if the switch needs to be controlled from 2 computers and a BC-2000 controller).
(NOTE: Some of our products allow you to control multiple units in a daisy chain with straight cables - which doesn't seem right in light of the above! We actually configure the units in master/slave modes, with Only one device, the master device, is connected to the computer via RS-232. With this connection, the master device transmits information to and from the PC to the slave devices, and the ports are connected in pairs by the RS-232 interface.)







2024 gtavrl.ru.