Industry common sense_serial port related


I. Introduction

As a factory dog, I often hear some words, "RS232", "RS485", "serial port", "DB9"...
In my eyes, it is always this stuff,

Why does this (wrong) understanding arise?
Because someone told me that the object in the picture above is called a USB to 485 data cable .
I know USB, it is the connector on the left; the remaining one is 485.
In addition, the communication with these two heads plugged in is called serial port communication, and it seems that there is no problem with calling this thing a serial port cable.
The appearance of the USB to 232 data cable is the same as the picture above, so I naturally thought it was a thing.
Obviously, this way of understanding is wrong. So it is necessary to learn from scratch.


Two, study

serial port

Serial port is the abbreviation of serial port. There is also a serial interface, and the interface has the meaning of a hardware port, focusing on the physical interface.

Serial communication is a communication method in which data is sequentially transmitted bit by bit on the communication line.

The port is the meaning of the import and export of the device and the outside world.

Serial ports are often used to implement serial communication between computers and external devices.

DB9

D-type data interface connector, an interface standard for connecting electronic devices (such as: computers and peripherals). Because the shape is similar to the English letter D, it is named D-type interface.

Then why is it called DB9 instead of D9?
Because the D-type interface can be subdivided into A-type (15-pin), B-type (25-pin), C-type (37-pin), D-type (50-pin) according to the number of ports (female)/pins (male), Type E (9-pin). And because the early B-type (25-pin) was used more, people are used to the DB port. So later, models with other numbers of pins were also called DB ports (in fact, according to the standard name, the 9-pin one is called DE9, and the 25-pin one is called DB25).

The number after DB is the number of pins.

RS232

RS-232, the full name is EIA-RS-232C, EIA is Electronic Industry Association - representing the American Electronics Industry Association; RS is Recommended Standard - indicating the recommended standard; 232 is the identification number; C represents the latest modification of RS232 (1969) , Before that, there were RS232B and RS232A. Only EIA RS-232C (referred to as 232, RS232) is introduced here.

that's obvious,232 is a standard, and a standard is a unified regulation.
What does 232 stipulate?
It specifies connecting cables and mechanical, electrical characteristics, signal functions and transmission processes.

  • Wiring/connection : The typical serial port in the PC is 232 and its compatible interface. There are two types of serial port pins: 9-pin and 25-pin. Common PCs use a 9-pin connector. The 9-pin 232 serial port pins are defined as follows:
    insert image description here
    That is to say, 232 usually uses DB9 or DB25 connectors to realize the connection between devices, and the pins are defined.
  • In terms of signal level : it is stipulated that RS-232C uses negative logic to specify the logic level, -3V—-15V is the logic “1” level, +3V—+15V is the “0” level (how is this obtained? After A lot of practice, based on comprehensive evaluation).
  • In terms of transmission rate : the transmission speed of the serial port terminal provided by the PC can generally reach 115200bps or even higher, and the transmission speed provided by the standard serial port mainly includes the following baud rates: 1200bps, 2400bps, 4800bps, 9600bps, 19200bsp, 38400bps, 57600bps , 115200bps, etc. In instrumentation or industrial control occasions, 9600bps is the most common transmission speed. When the transmission distance is relatively short, it is also possible to use the highest transmission speed. The relationship between the transmission distance and the transmission speed is inversely proportional, appropriately reducing the transmission speed can extend the transmission distance of RS-232 and improve the stability of communication.

RS485

With 232 as a foreshadowing, 485 is obviously also a standard.
485 belongs to the electrical characteristics of the physical layer of the OSI model and specifies the standard for multi-point communication of 2-wire, half-duplex, and balanced transmission lines. It is a serial communication standard for differential signaling. Compared with RS-232, RS-485 has higher communication rate, longer communication distance and better anti-interference performance, and is widely used in industrial control, building automation, remote sensor reading and other fields.

USB

So, in fact, USB is also a standard.
USB uses a four-wire cable, two of which are serial channels used to transmit data, and the other two provide power for downstream (Downstream) devices. For any peripherals that have been successfully connected and recognized each other, both devices will be able to support them. The highest rate of data transfer.

How can USB be four wires?
It is obviously a generous mouth:

In fact, this generous port is just a USB interface.
Like software, for the convenience of use (plugging), hardware circuits usually do not expose the most primitive wires/pins, but encapsulate them into an interface.


3. Summary

  • Strictly speaking, 232, 485, and USB are the abbreviations of the standard; but the usual 232, 485, and USB may be interfaces that follow the corresponding standards;
  • DB9 is a 9-pin D-type interface;
  • The serial port is a port for serial communication (at this level, the usual USB can also be regarded as a serial port?);
  • USB to 485 is actually to convert the USB standard port to the 485 standard port (because it involves changes in electrical standards, connection methods, etc., a conversion circuit is usually designed and packaged at the interface).

Guess you like

Origin blog.csdn.net/BadAyase/article/details/129843789