Method and device for detecting connection state of serial port, and communication system
A technology of connection state and detection method, which is applied in the field of communication, can solve problems such as the inability to realize the detection of serial port connection state
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0033] The embodiment of the present invention provides a serial port connection state detection and application method, including the following steps:
[0034] Detect whether the data output signal of the serial port at the opposite end is a valid signal corresponding to the normal connection of the serial port;
[0035] If yes, output a connection state valid signal; if not, output a connection state invalid signal.
[0036] The opposite end here can be a computer device such as a PC or a laptop connected to the embedded system. When these devices are connected to the embedded system, they will also perform level conversion through the RS232 level converter; at this time, the opposite end can be detected Whether the output signal is the valid signal corresponding to the normal connection of the serial port. Generally, the level range of RS232 is ±5V~±15V; and in practical applications, there will be two positive and negative levels with the same absolute value. For example,...
Embodiment 2
[0049] The embodiment of the present invention provides a serial port connection state detection method for monitoring the serial port connection state, see figure 2 , is a schematic diagram of a serial port connection state detection circuit corresponding to this embodiment.
[0050] like figure 2As shown, the PC is connected to the embedded system through the RS232 level converter; among them, the RS232 level converter is used to convert the level output by the serial port of the PC (generally using negative logic, voltage ±5V~±15V) into TTL level;
[0051] The signal Rx_232 represents the serial port data output signal of the PC, and after passing through the RS232 level converter, the Rx_TTL signal is output as the data input signal of the embedded system;
[0052] The signal Tx_TTL represents the serial port data output signal of the embedded system. After passing through the RS232 level converter, the Tx_232 signal is output as the data input signal of the PC.
[00...
Embodiment 3
[0068] In addition to the discrete component detection circuit used in the second embodiment, other detection circuits may also be used to detect the PC serial port data output signal Rx_232. see image 3 , the embodiment of the present invention provides a serial port connection state detection method, which is used for detecting the serial port connection state.
[0069] In the embodiment of the present invention, AD sampling is combined with logical judgment to detect the serial port connection state; wherein, the input terminal of AD sampling is Rx_232 signal, and the Rx_232 level is obtained through AD sampling; AD sampling can be through a dedicated AD sampling chip, Or you can also use a processor with AD sampling function;
[0070] After the level value is obtained through AD sampling, then logical judgment is made. For example, when the level value is ±5V, it is judged that the serial port is in the connected state; when the level value is 0V, it is judged that the s...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 