RS485 transceiving state conversion method, system and device, and medium

A technology of RS485 and conversion method, which is applied in the field of conversion of RS485 sending and receiving states, which can solve problems such as serial port freeze, data packet loss, frequent conversion or unreasonable delay, and achieve the effect of avoiding data packet loss or serial port freeze

Active Publication Date: 2021-04-27
重庆芯讯通无线科技有限公司
View PDF8 Cites 3 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] The technical problem to be solved by the present invention is to overcome the defect of data packet loss or serial port jam due to frequent conversion or unreasonable delay when realizing RS485 state conversion in the prior art, and provide a conversion method of RS485 transceiver state , systems, equipment and media

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • RS485 transceiving state conversion method, system and device, and medium
  • RS485 transceiving state conversion method, system and device, and medium
  • RS485 transceiving state conversion method, system and device, and medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0042] Such as figure 1 As shown, this embodiment provides a conversion method of RS485 transceiver state, this conversion method can be applied to the controller, so it can be executed by the controller, the controller in this embodiment can be realized by MCU (micro control unit) , and can also be other controllers that can run the conversion method, which is not specifically limited here. The data processing and the control of the RS485 transceiver state transition are realized by the MCU. The RS485 uses balanced sending and differential receiving methods to transmit data, has the ability to suppress common-mode interference, and the communication distance can reach thousands of meters. Its working mode is half-duplex, relying on the level change of the control direction pin, that is, the DE (transmitter output enable) pin to perform state conversion, and it will delay for a certain period of time between the conversion states to ensure complete and efficient data transmis...

Embodiment 2

[0061] Such as image 3 As shown, this embodiment provides a RS485 transceiving state conversion system, the conversion system includes a first control module 1 , a startup module 2 , a second control module 3 , a first judging module 4 and a second judging module 5 .

[0062] The second judging module 5 is used to judge whether the control direction pin of the RS485 is at the first level, if not, then call the starting module 2; if so, call the first control module 1 and the starting module 2.

[0063] In this embodiment, when the control direction pin of the RS485 is at the first level, the RS485 is in the receiver state, and when the control direction pin of the RS485 is at the second level, the RS485 is in the transmitter state.

[0064] In this embodiment, the first level is preferably a low level, and the second level is preferably a high level.

[0065] The first control module 1 is used to control the RS485 to be in the transmitter state, and call the startup module 2...

Embodiment 3

[0079] Figure 4 It is a schematic structural diagram of an electronic device provided by Embodiment 3 of the present invention. The electronic equipment includes a memory, a processor, and a computer program stored on the memory and operable on the processor. When the processor executes the computer program, the RS485 transceiving state conversion method of Embodiment 1 is realized. Figure 4 The electronic device 30 shown is only an example, and should not limit the functions and scope of use of the embodiments of the present invention.

[0080] Such as Figure 4 As shown, electronic device 30 may take the form of a general-purpose computing device, which may be a server device, for example. Components of the electronic device 30 may include, but are not limited to: at least one processor 31 , at least one memory 32 , and a bus 33 connecting different system components (including the memory 32 and the processor 31 ).

[0081] The bus 33 includes a data bus, an address bus...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses an RS485 transceiving state conversion method, system and device and a medium, and the method comprises the steps: controlling RS485 to be in a transmitter state, and starting a timer to start timing, wherein the timing period of the timer is calculated according to the current baud rate of RS485; and when the timing of the timer is finished, controlling the RS485 to be switched to a receiver state. The RS485 is controlled to be in the sending state, the timer is started to start timing, the timing period of the timer is calculated according to the current baud rate of the RS485, and when timing of the timer is finished, the RS485 is controlled to be in the receiver state, so that accurate quantitative control over the data sending time is achieved; and the data can be completely sent within reasonable and accurate delay time, and the problem of data packet loss or serial port jamming is avoided.

Description

technical field [0001] The present invention relates to the technical field of communication, in particular to a method, system, equipment and medium for converting the RS485 receiving and receiving states. Background technique [0002] RS485 is a half-duplex universal asynchronous transceiver. It can only be in one state of sending or receiving at any time. When sending data externally, it needs to convert RS485 to the transmitter state before sending data. When receiving data, it needs to convert RS485 first. It is in the receiver state to receive data. The state transition can be realized by hardware and software. The hardware method will take into account the driving ability and cost control of the hardware. Some applications are not suitable for the hardware method. However, most products with built-in RS485 on the market basically use the software method. This method realizes the conversion of sending and receiving states by controlling the direction pin level of RS48...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): H04B1/44
CPCH04B1/44
Inventor 黄涛
Owner 重庆芯讯通无线科技有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products