RS-232 is one of the communication interfaces on a personal computer, an asynchronous transmission standard interface developed by the Electronic Industries Association (EIA). Usually RS-232 interface appears in the form of 9 pins (DB-9) or 25 pins (DB-25). Generally, there are two RS-232 interfaces on personal computers, which are called COM1 and COM2.
The RS-232 standard interface (also known as EIA RS-232) is one of the commonly used serial communication interface standards. It is jointly established by the American Electronics Industry Association (EIA) in conjunction with Bell Systems, modem manufacturers and computer terminal manufacturers in 1970. Formulated, its full name is "Technical Standard for Serial Binary Data Exchange Interface between Data Terminal Equipment (DTE) and Data Communication Equipment (DCE)".
In serial communication, both sides of the communication are required to use a standard interface, so that different devices can be easily connected to communicate. RS-232-C
rs232 (9-pin) interface
The interface (also known as EIARS-232-C) is currently the most commonly used serial communication interface. ("-C" in "RS-232-C" just means the version of RS-232, so it is the same as "RS-232" for short).
It is a standard for serial communication jointly developed by the American Electronics Industry Association (EIA) in conjunction with Bell Systems, modem manufacturers, and computer terminal manufacturers in 1970. Its full name is "Technical Standard for Serial Binary Data Exchange Interface between Data Terminal Equipment (DTE) and Data Communication Equipment (DCE)". This standard specifies the use of a 25-pin DB-25 connector. The signal content of each pin is specified, and the levels of various signals are also specified. Later, IBM's PC reduced RS232 to DB-9 connector, which became the de facto standard. The RS-232 port of industrial control generally only uses RXD, TXD, GND three lines.
Less signal lines
The RS-232 bus specifies 25 lines and contains two signal channels, namely the first channel (called the main channel) and the second channel (called the secondary channel). The RS-232 bus can be used to achieve full-duplex communication. The main channel is usually used, and the secondary channel is used less. In general applications, three to nine signal lines can be used to achieve full-duplex communication, and the use of three signal lines (reception line, transmission line, and signal ground) can achieve a simple full-duplex communication process.
Flexible baud rate selection
The standard transmission rates specified by RS-232 are 50b/s, 75b/s, 110b/s, 150b/s, 300b/s, 600b/s, 1200b/s, 2400b/s, 4800b/s, 9600b/s, 19200b /s, can flexibly adapt to different rate devices. For slow peripherals, you can choose a lower transfer rate: otherwise, you can choose a higher transfer rate.
Negative logic transmission
The level of logic "1" is specified as -5V~-15 V, and the level of logic "0" is +5 V~+15 V. The purpose of selecting this electrical standard is to improve the anti-interference ability and increase the communication distance. The noise tolerance of RS-232 is 2V, and the receiver will recognize signals as high as +3V as logic "0" and signals as low as -3 V as logic "1".
Long transmission distance
Because RS-232 adopts serial transmission mode, and converts the TTL level of the microcomputer to RS-232C level, the transmission distance is generally up to 30 m. If a 20 mA current loop with photoelectric isolation is used for transmission, the transmission distance can reach 1000 m. In addition, if the Modem is added to the RS-232 bus interface, the transmission distance can be farther through wired, wireless or optical fiber transmission.
Two physical interfaces
One connector of RS-2-32 interface is the 25-pin plug socket of D13-25. Generally, the plug is at the DCE end, and the socket is at the DTE end.
(1) The signal level value of the interface is high, which is easy to damage the chip of the interface circuit, and because it is incompatible with the TTL level, it is necessary to use a level conversion circuit to connect with the TTL circuit.
(2) The transmission rate is low. In asynchronous transmission, the baud rate is 20Kbps; therefore, in the CPLD development board, the integrated program baud rate can only be 19200, which is also the reason.
(3) The interface uses a signal line and a signal return line to form a common ground transmission form. This common ground transmission is prone to common mode interference, so the anti-noise interference is weak.
(4) The transmission distance is limited. The standard value of the maximum transmission distance is 50 feet. In fact, it can only be used at about 15 meters.
The following explains the RS-232 serial communication principle with the communication process between the computer and the modem. Consider the interaction and working process between the RS-232 signal between the computer and the modem when the modem is in answer mode. Assuming that the modem is full-duplex and uses RS-232
(1) In the initial state, RTS and CTS continue to be ON, and the RS232 lead status is set and monitored through the communication program. In the answer mode, the software in the computer has been monitoring the ring indication (RI), waiting for the RI to send an ON signal.
(2) After the communication program on the computer receives the RI signal, it starts to count the ringing by the number of times the ring indicator ON/OFF changes. When the number of ringing times set in the arrival process is reached, the communication program will occur. The data terminal is ready (DTR) signal, forcing the modem to go off-hook.
(3) After waiting for 2s (FCC regulations), the modem automatically starts sending its response carrier. At this time, the modem sends a modem ready (DSR) signal to inform the computer that it has completed all preparations and is waiting for the carrier signal.
(4) During continuous DTR signal sending, computer software monitors the DSR signal. When the DSR signal turns ON, the computer knows that the modem is ready for the data link connection, and the computer immediately starts monitoring the data carrier monitoring (CD) signal to confirm the existence of the data link.
(5) When the carrier of the source modem appears on the telephone line, the answering modem sends out a CD signal.
(6) Start full-duplex communication by sending data lines (TD) and receiving data lines (RD). During the data link transmission, the computer monitors the CD to ensure the existence of the data link.
(7) Once the communication task is completed, the computer prohibits DTR, and the modem responds by removing its carrier tone and prohibiting CD and DSR. As the link is removed, the modem returns to its initial state.
When the RS-232 serial communication distance is close (<12m), you can directly connect the standard RS232 port with a cable. If the distance is far, you need to add a modem (Mode). The most simple and commonly used is the three-wire system connection, that is, ground , Receive data, send data are connected by three feet.
The interface adopted by the RS232 standard is a 9-pin or 25-pin D-type plug, and the commonly used one is a 9-pin plug.
The RS232C standard interface has 25 wires, and only 9 are commonly used. They are:
(1) Received Line Signal Detection (RSD)-used to indicate that DCE has connected the communication link and inform DTE that it is ready to receive data. When the local MODEM receives the carrier signal sent by the MODEM at the other end of the communication link (remote), it validates the RLSD signal, informs the terminal to prepare for reception, and the MODEM demodulates the received carrier signal into digital data , Along the receiving data line RXD to the terminal. This line is also called a data carrier detection (Data Carrier detection, DCD) line.
(2) Received data (RXD)-Receive serial data (DCE→DTE) sent from MODEM through RXD line terminal.
(3) Transmitted data (TXD)—Transmit serial data to MODEM (DTE→DCE) through the TXD terminal.
(4) The data terminal is ready (Data Set Ready, DTR)-when it is active (ON) state, indicating that the data terminal can be used.
(5) Ground wire-GND.
(6) Data Set Ready (DSR)-the ON state, indicating that the communication device is in a usable state.
(7) Request to send (Request to Send)-used to indicate that the DTE requests DCE to send data, that is, when the terminal wants to send data, the signal is valid (ON state), to MODEM request to send. It is used to control whether the MODEM is to enter the sending state.
(8) Clear to Send (CTS)-used to indicate that DCE is ready to receive data from DTE, it is a response signal to the request to send signal RTS. When MODEM is ready to receive the data from the terminal and send it forward, make this signal valid and notify the terminal to start sending data along the transmission data line TXD.
(9) Ringing indication (Ringing, R)-When the MODEM receives the ringing call signal from the switching station, the signal is valid (ON state) to notify the terminal that it has been called.
On TXD and RXD: logic 1 (MARK) = -3 ~ -15V; logic 0 (SPACE) = 3 ~ 15V. On RTS, CTS, DSR, DTR, DCD and other control lines: signal valid (on, ON state, positive voltage) = 3~15V; signal invalid (off, OFF state, negative voltage) = -3~-15V .
The above regulations explain the definition of logic levels in the RS232C standard. For data (information code), the level of logic 1 (sign) is lower than -3V, and the level of logic 0 (space) is higher than +3V; for the control signal, the ON state is the power level of the signal is valid The level is higher than 3V, and the off state (OFF) means that the invalid signal level is lower than -3V, that is, when the absolute value of the transmission level is greater than 3V, the circuit can effectively check out the voltage between -3~3V Meaningless, voltages lower than -15V or higher than 15V are also considered meaningless. Therefore, in actual operation, it should be ensured that the level is within ±(3~15)V. When using RS232 bus to connect the system, there are short-range communication methods and remote communication There are two ways. Short-range communication refers to the communication with a transmission distance of less than 15m, which can be directly connected by RS232 cable; for long-distance communication over 15m, a modem is required.
RS-232 and USB are both serial communications, but whether it is the underlying signal, level definition, mechanical connection, or data format, communication protocol, etc., the two are completely different. RS-232 is a popular interface. In MS-DOS, the four serial interfaces are called COM1, COM2, COM3, and COM4, and most windows applications can have up to 4 peripherals, but if users want to expand more peripherals, they must Use plug-in serial card or external switch box to achieve. RS-232 point-to-point connection, only one peripheral can be connected to one serial port.
The USB is a multi-point, high-speed connection, using a hub to achieve more connections. The basic part of the USB interface is the serial interface engine SIE. The SIE receives data bits from the USB transceiver and converts them into valid bytes and transmits them to the SIE interface. Conversely, the SIE interface can also receive bytes and convert them into serial bits to the bus. Since the maximum rate of the PC serial port is only 115.2kbps, it will form a speed bottleneck. The RS-232 system includes two serial signal paths, whose directions are opposite, and are used to transmit commands and data, respectively, and commands and status must be interwoven with the data; and USB supports separate commands and data channels and allows independent status reporting . USB is a convenient, flexible, simple, high-speed bus structure. Compared with the traditional RS-232 interface, USB has the following characteristics:
(1) USB adopts a single form of connector and connecting cable to realize a single data universal interface. The USB unified 4-pin plug replaces a wide variety of serial/parallel plugs behind the PC case, and realizes the unification of conventional computer I/O equipment, multimedia equipment (parts), communication equipment (telephone, network) and household appliances into one Interface desire.
(2) The USB adopts a tree structure that is easy to expand. By using the USB Hub expansion, up to 127 peripherals can be connected. USB eliminates the requirement for all system resources, avoids port conflicts when installing hardware, and frees up hardware resources for other devices.
(3) USB peripherals can be set automatically, supporting plug and play and hot plug.
(4) Flexible power supply. The USB cable has the function of transmitting power, supports energy saving mode, and has low power consumption. The USB bus can provide a power supply with a voltage of +5v and a maximum current of 500mA. It can be used as a power supply for low-power devices, and no additional power supply is required.
(5) USB can support four transfer modes: control transfer, synchronous transfer, interrupt transfer, batch transfer, and can be applied to many types of peripherals.
(6) The communication speed is fast. USB supports three bus speeds, low speed 1.5Mbps, full speed 12Mbps and high speed 480Mbps.
(7) Reliability of data transmission. USB adopts differential transmission mode, and has error detection and error correction functions to ensure the correct transmission of data.
(8) Low cost. USB simplifies the method of connecting and configuring peripherals, effectively reducing the overall cost of the system. It is a cheap, simple and practical solution with a high cost performance.
RS-232 has a wide range of applications, is cheap, easy to program, and can use longer wires than other interfaces. As USB ports become more common, there will be more conversions from USB to RS-232 or other interfaces. Conversion device. But RS-232 and similar interfaces will still be widely used in applications such as monitoring and control systems. For developers and products accustomed to using RS-232, consider designing a USB/RS-232 converter to transmit RS-232 data through the USB bus, that is, the application software on the PC side is still programmed for the RS-232 serial port, peripherals RS-232 is also used as the data communication channel, but the physical connection from the PC to the peripherals is the USB bus, and the data communication on it is also a USB data format. The advantage of using this method is that: on the one hand, the original software development investment is protected, and the successfully developed application software for RS-232 peripherals can continue to be used without modification; on the other hand, the advantages of the USB bus are fully utilized, More RS-232 devices can be connected through the USB interface, which not only obtains higher transmission speed, realizes real plug and play, but also solves the shortcoming that the USB interface cannot be transmitted over long distances (USB communication distance is within 5 meters.
FPGA Virtex-II Family 1M Gates 11520 Cells 750MHz 0.15um Technology 1.5V 575-Pin BGA
FPGA Virtex-II Family 1M Gates 11520 Cells 750MHz 0.15um Technology 1.5V 456-Pin FBGA
FPGA Virtex-II Family 1M Gates 11520 Cells 820MHz 0.15um Technology 1.5V 456-Pin FBGA
FPGA Spartan-3A Family 700K Gates 13248 Cells 770MHz 90nm Technology 1.2V 256-Pin FTBGA
FPGA Spartan-3A DSP Family 1.8M Gates 37440 Cells 667MHz 90nm Technology 1.2V 484-Pin LCSBGA