Linux driver design hardware foundation (4) interface and serial port of bus

2.3 Interface and bus

2.3.1 Serial port

RS-232, RS-422 and RS-485 are all serial data interface standards, originally developed and published by the Electronic Industries Association (EIA).

RS-232 was released in 1962 under the designation EIA-232-E. The RS-422 released later defines a balanced communication interface, which is a one-way, balanced transmission specification for single-machine sending and multiple-machine receiving, and is named as the TIA/EIA-422-A standard. RS-422 improves the shortcoming of RS-232 communication distance and low speed. In order to further expand the scope of application, EIA formulated the RS-485 standard on the basis of RS-422 in 1983, adding multi-point and two-way communication capabilities, allowing multiple transmitters to be connected to the same bus, and increasing the number of transmissions. The drive capability and collision protection characteristics of the driver, and the expansion of the bus common mode range, is named as the TIA/EIA-485-A standard.

RS-232C , a     modified version of RS-232 released in 1969, is the most widely used serial interface in embedded systems. It is formulated for connecting DTE (Data Terminal Equipment) and DCE (Data Communication Equipment). The RS-232C standard interface has 25 lines (4 data lines, 11 control lines, 3 timing lines, 7 spare and undefined lines), and only 9 are commonly used, which are RTS/CTS (request to send/clear Send flow control), RxD/TxD (data transceiver), DSR/DTR (data set ready/data terminal ready flow control), Ringing-RI (ringing indication), SG (signal ground) signal, DCD ( Data Carrier Detect data) Carrier Detect, also known as RLSD, or Receive Line Signal Detect). The definitions of RTS/CTS, RxD/TxD, DSR/DTR and other signals are as follows:

RTS: It is used to indicate that the data terminal equipment requests the data communication equipment to send data. When the terminal wants to send data, the signal is enabled.

CTS: It is used to indicate that the data communication equipment is ready to receive the data sent by the data terminal equipment, which is the response signal to the RTS.

RxD: Data terminal equipment receives serial data sent from data communication equipment through RxD.

TxD: Data terminal equipment sends serial data to data communication equipment via TxD.

DSR: Active (ON state) indicates that the data communication device can be used.

DTR: Active (ON state) indicates that the data terminal device can be used.

DCD: When the local DCE device receives the carrier signal sent by the other party's DCE device, it makes the DCD valid and informs the DTE that it is ready to receive, and the DCE demodulates the received carrier signal into a digital signal, which is sent to the DTE via the RxD line.

Ringing-RI: When the modem receives the ringing call signal sent by the switching center, it makes the signal valid (ON state) and informs the terminal that it has been called.

The simplest RS-232C serial port only needs to connect the three signals of RxD, TxD and SG, and use XON/XOFF software flow control.

The hardware principle of forming an RS-232C serial port is shown in Figure 2.9. From the CPU to the connector, the order is CPU, UART (Universal Asynchronous Receiver Transmitter, whose function is to complete parallel/serial conversion), CMOS/TTL level and RS- 232C level shifting, DB9/DB25 or custom connectors.


Figure 2.9 Principle of RS-232C serial port circuit

















Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325974441&siteId=291194637