485 Self-Transceiving Circuit and Its Control Method, Device, Storage Medium

Through the combination of the feedback module, the switching control module and the delay adjustment module, the switching time and driving capability of the 485 self-transmitter and reception circuit are controlled, which solves the problem of not being able to take into account both the switching time and the driving capability in traditional design, and achieves more efficient circuit performance.

CN115987323BActive Publication Date: 2025-06-20SHANDONG YOU INTERNET OF THINGS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211704116.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-29
Publication Date
2025-06-20
Estimated Expiration
2042-12-29

AI Technical Summary

Technical Problem

The traditional 485 self-transmitter and reception circuit cannot take into account the requirements of short switching time of circuit transmission and reception and strong circuit driving capability.

Method used

The feedback module, switching control module, and delay adjustment module control module control circuit transmitting and receiving switching times, and the driving capability of the circuit is increased, so as to achieve both switching time and driving capability.

Benefits of technology

It realizes precise control of the 485 transceiver and receive switching moment, enhances the driving capability of the circuit, and takes into account the requirements of switching time and driving capability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115987323B_ABST
    Figure CN115987323B_ABST
Patent Text Reader

Abstract

A 485 self-transceiving circuit and its control method, computer device, and storage medium disclosed by the present invention. The 485 self-transceiving circuit includes: a main control module, a communication module, a delay adjustment module, a switching control module, and a feedback module. Among them, the delay adjustment module is used to receive a control signal transmitted by the main control module and adjust the resistance value of a preset resistor according to the control signal; the switching control module is used to receive the adjusted resistance value transmitted by the delay adjustment module and control a preset transceiving signal according to the resistance value; the communication module is used to receive transceiving data transmitted by the main control module and the transceiving signal transmitted by the switching control module, and perform transmission processing on the transceiving data according to the transceiving signal; the feedback module is used to obtain the transceiving data and the transceiving signal, and transmit the transceiving data and the transceiving signal to the main control module. The technical solution of the present invention can meet the requirements of a relatively strong driving ability of the 485 circuit and a fast switching time of the 485 circuit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of communication circuits, and particularly to a 485 self-transceiving circuit, a control method thereof, a computer device, and a storage medium. Background Art

[0002] In currently commonly used 485 switching circuits, there are mainly two methods to achieve automatic switching of 485 circuits: The first method is to use the TXD (Transmit Data) signal of UART (Universal Asynchronous Receiver / Transmitter), and after inverting the TXD signal through a logic NAND gate, an optocoupler, or a triode, it is used to drive the transceiver enable pin of the 485 chip. When the bit (Binary Digit) in the data signal is high, the 485 chip is in the receiving state. This characteristic results in that the 485 chip driver does not have the ability to pull up the external bus A&B, and only relying on the pull-up and pull-down resistors on the 485 bus cannot drive bus A to the standard level, damaging the load capacity of the 485 chip; The second method is to increase a delay circuit, which slows down the falling speed of the level of the 485 transceiver switching pin and solves the driving ability problem within a single byte. However, since the parameters of the circuit are determined, the level holding time of such a 485 transceiver switching pin is fixed and can only be fixedly used for circuits with a specific baud rate.

[0003] In summary, the 485 self-transceiving circuit designed by the traditional design method cannot take into account the requirements of short switching time between circuit transceiving and strong circuit driving ability. Summary of the Invention

[0004] The main purpose of the present invention is to provide a 485 self-transceiving circuit, a control method thereof, a computer device, and a storage medium, aiming to control the transceiving switching moment of the 485 circuit and increase the driving ability of the circuit through a feedback module, a switching control module, and a delay adjustment module, so as to balance the switching time and driving ability of the 485 self-transceiving circuit.

[0005] To achieve the above object, the present invention provides a 485 self-transceiving circuit, which includes: a main control module, a communication module connected to the main control module, a delay adjustment module connected to the main control module, a switching control module connected to the delay adjustment module, the main control module, and the communication module, and a feedback module connected to the communication module, the main control module, and the switching control module;

[0006] The delay adjustment module is configured to receive a control signal transmitted by the main control module and adjust the resistance value of a preset resistor according to the control signal;

[0007] The switching control module is configured to receive the adjusted resistance value transmitted by the delay adjustment module and control a preset transceiver signal according to the resistance value;

[0008] The communication module is configured to receive the transceiver data transmitted by the main control module and the transceiver signal transmitted by the switching control module, and perform transmission processing on the transceiver data according to the transceiver signal;

[0009] The feedback module is configured to obtain the transceiver data and the transceiver signal, and transmit the transceiver data and the transceiver signal to the main control module.

[0010] Optionally, the main control module includes:

[0011] A main control device, the communication interface of the main control device is connected to the communication module, the feedback interface of the main control device is connected to the feedback module, and the control interface of the main control device is connected to the delay adjustment module.

[0012] Optionally, the communication module includes:

[0013] A 485 chip, the RE and DE pins of the 485 chip are connected to the switching control module, and the RO and DI pins of the 485 chip are connected to the main control module.

[0014] Optionally, the feedback module includes:

[0015] A voltage follower unit, the input end of the voltage follower unit is connected to the communication module, and the output end of the voltage follower unit is connected to the main control module.

[0016] Optionally, the switching control module includes:

[0017] A timing chip, the output pin of the timing chip is connected to the communication module, the trigger signal input pins of the timing chip are connected to the feedback module, the communication module, and the main control module, and the discharge and threshold pins of the timing chip are connected to the delay adjustment module.

[0018] Optionally, the delay adjustment module includes:

[0019] A decoder unit, the input pins of the decoder unit are connected to the main control module;

[0020] A resistance matching unit, the resistance matching unit is connected to the decoder unit;

[0021] A digital potentiometer, the digital potentiometer is connected to the switching control module and the resistance matching unit.

[0022] In addition, to achieve the above object, the present invention also provides a control method for a 485 self-transceiving circuit. The control method is applied to the 485 self-transceiving circuit as described above, and the control method includes:

[0023] Transmit a control signal from the main control module to the delay adjustment module connected to the main control module to control the delay adjustment module to adjust the resistance value of a preset resistor according to the control signal;

[0024] Transmit the adjusted resistance value from the delay adjustment module to the switching control module connected to the delay adjustment module to control the switching control module to control a preset transceiving signal according to the resistance value;

[0025] Transmit transceiving data from the main control module to the communication module connected to the main control module, and transmit the transceiving signal from the switching control module to the communication module connected to the switching control module to control the communication module to perform transmission processing on the transceiving data according to the transceiving signal;

[0026] Transmit the transceiving signal and the transceiving data from the communication module to the feedback module connected to the communication module to control the feedback module to transmit the transceiving data and the transceiving signal to the main control module.

[0027] Optionally, the control signal includes: a resistance increasing signal and a resistance decreasing signal. The step of controlling the delay adjustment module to adjust the resistance value of a preset resistor according to the control signal includes:

[0028] Adjust the resistance value of a preset resistor to be larger by the delay adjustment module according to the resistance increasing signal;

[0029] Adjust the resistance value of the resistor to be smaller by the delay adjustment module according to the resistance decreasing signal.

[0030] In addition, to achieve the above object, the present invention also provides a computer device, which includes: a memory, a processor, and a control program for a 485 self-transceiving circuit stored on the memory and executable on the processor. When the control program for the 485 self-transceiving circuit is executed by the processor, the steps of the control method for the 485 self-transceiving circuit as described above are implemented.

[0031] In addition, to achieve the above object, the present invention also provides a storage medium, on which a control program for a 485 self-transceiving circuit is stored. When the control program for the 485 self-transceiving circuit is executed by a processor, the steps of the control method for the 485 self-transceiving circuit as described above are implemented.

[0032] The 485 self-transceiving circuit provided by the present invention includes: a main control module, a communication module connected to the main control module, a delay adjustment module connected to the main control module, a switching control module connected to the delay adjustment module, the main control module, and the communication module, and a feedback module connected to the communication module, the main control module, and the switching control module; the delay adjustment module is configured to receive a control signal transmitted by the main control module and adjust the resistance value of a preset resistor according to the control signal; the switching control module is configured to receive the adjusted resistor value transmitted by the delay adjustment module and control a preset transceiving signal according to the resistor value; the communication module is configured to receive the transceiving data transmitted by the main control module and the transceiving signal transmitted by the switching control module, and perform transmission processing on the transceiving data according to the transceiving signal; the feedback module is configured to obtain the transceiving data and the transceiving signal and transmit the transceiving data and the transceiving signal to the main control module.

[0033] A 485 self-transceiving circuit, a control method thereof, a computer device, and a storage medium provided by the present invention, through a delay adjustment module connected to the main control module, receive a control signal transmitted by the main control module and adjust the resistance value of a preset resistor according to the control signal, through a switching control module connected to the delay adjustment module and the main control module, receive the resistor value transmitted by the delay adjustment module and control the transceiving signal according to the resistor value, through a communication module connected to the main control module and the switching control module, receive the transceiving data transmitted by the main control module and the transceiving signal transmitted by the switching control module, and thus perform transmission processing on the transceiving data according to the transceiving signal, through a feedback module connected to the communication module, the main control module, and the switching control module, obtain the transceiving data and the transceiving signal transmitted by the communication module, and thus transmit the transceiving data and the transceiving signal to the main control module.

[0034] In this way, the present invention adjusts the resistance value through the delay adjustment module, adjusts the duration of the transceiving signal of the 485 chip in the communication module through the switching control module, and collects the transceiving data and the transceiving signal through the feedback module, so that the main control module iteratively adjusts the resistance value in the delay adjustment module, achieving the effect of accurately controlling the 485 transceiving switching moment while ensuring the driving ability of the circuit, and achieving the purpose of taking into account the switching time and driving ability of the 485 self-transceiving circuit. Description of the Drawings

[0035] The drawings here are incorporated into the specification and form a part of this specification, showing embodiments consistent with the present invention and used together with the specification to explain the principles of the present invention.

[0036] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0037] Figure 1 Schematic diagram of a circuit module of an embodiment of the 485 self-transceiving circuit of the present invention;

[0038] Figure 2 Schematic diagram of the circuit principle of an embodiment of the 485 self-transceiving circuit of the present invention;

[0039] Figure 3 Schematic flow chart of an embodiment of the control method of the 485 self-transceiving circuit of the present invention;

[0040] Figure 4 Schematic diagram of the iterative process of an embodiment of the 485 self-transceiving circuit of the present invention.

[0041] The implementation, functional features and advantages of the object of the present invention will be further described in conjunction with the embodiments with reference to the accompanying drawings. Detailed implementation manners

[0042] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0043] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0044] In the present invention, unless otherwise clearly defined and limited, terms such as "connection" and "fixation" should be understood in a broad sense. For example, "fixation" can be a fixed connection, a detachable connection, or integrated; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and can be the internal connection of two components or the interaction relationship between two components, unless otherwise clearly defined. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0045] In addition, in the present invention, descriptions such as "first", "second", etc. are for descriptive purposes only, and should not be construed as indicating or implying their relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include at least one such feature. In addition, the technical solutions between various embodiments may be combined with each other, but it must be based on the ability of those of ordinary skill in the art to implement. When the combination of technical solutions results in contradictions or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0046] It should be noted that in the commonly used 485 switching circuit at present, there are mainly two methods to achieve the automatic switching of the 485 circuit: the first method is to use the TXD signal of the UART, and after inverting the TXD signal through a logic NAND gate, an optocoupler or a triode, it is used to drive the transceiver enable pin of the 485 chip. When the bit in the data signal is high, the 485 chip is in the receiving state. This characteristic results in that the 485 chip driver does not have the ability to pull up the external bus A&B, and only relying on the pull-up and pull-down resistors on the 485 bus cannot drive the bus A to the standard level, which damages the load capacity of the 485 chip; the second method is to add a delay circuit, which slows down the falling speed of the level of the 485 transceiver switching pin and solves the driving ability problem within a single byte. However, since the parameters of the circuit are determined, the holding time of the level of the 485 transceiver switching pin is fixed and can only be fixedly used for circuits with a specific baud rate.

[0047] In summary, the 485 self-transceiving circuit designed by the traditional design method cannot meet the requirements of short switching time and strong circuit driving ability for circuit transceiving.

[0048] Based on the above problems, the 485 self-transceiving circuit provided by the present invention includes: a main control module, a communication module connected to the main control module, a delay adjustment module connected to the main control module, a switching control module connected to the delay adjustment module, the main control module, and the communication module, and a feedback module connected to the communication module, the main control module, and the switching control module; the delay adjustment module is used to receive the control signal transmitted by the main control module and adjust the resistance value of a preset resistor according to the control signal; the switching control module is used to receive the adjusted resistance value transmitted by the delay adjustment module and control a preset transceiving signal according to the resistance value; the communication module is used to receive the transceiving data transmitted by the main control module and the transceiving signal transmitted by the switching control module, and perform transmission processing on the transceiving data according to the transceiving signal; the feedback module is used to acquire the transceiving data and the transceiving signal, and transmit the transceiving data and the transceiving signal to the main control module.

[0049] A 485 self-transceiving circuit provided by the present invention, its control method, computer device, and storage medium receive a control signal transmitted by a main control module through a delay adjustment module connected to the main control module, and adjust the resistance value of a preset resistor according to the control signal. A switching control module connected to the delay adjustment module and the main control module receives the resistance value transmitted by the delay adjustment module, and controls the transceiving signal according to the resistance value. A communication module connected to the main control module and the switching control module receives the transceiving data transmitted by the main control module and the transceiving signal transmitted by the switching control module, and thus processes the transceiving data according to the transceiving signal. A feedback module connected to the communication module, the main control module, and the switching control module obtains the transceiving data and the transceiving signal transmitted by the communication module, and thus transmits the transceiving data and the transceiving signal to the main control module.

[0050] In this way, the present invention adjusts the resistance value through the delay adjustment module, adjusts the duration of the transceiving signal of the 485 chip in the communication module through the switching control module, and collects the transceiving data and the transceiving signal through the feedback module, so that the main control module iteratively adjusts the resistance value in the delay adjustment module, achieving the effect of accurately controlling the 485 transceiving switching moment while ensuring the circuit driving ability, and achieving the purpose of taking into account the switching time and driving ability of the 485 self-transceiving circuit.

[0051] Based on the overall concept of the 485 self-transceiving circuit of the present invention described above, a first embodiment of the 485 self-transceiving circuit of the present invention is proposed.

[0052] Please refer to Figure 1 , Figure 1 which is a schematic diagram of the circuit module of the 485 self-transceiving circuit of the present invention. In the first embodiment of the 485 self-transceiving circuit of the present invention, the 485 self-transceiving circuit includes: a main control module, a communication module connected to the main control module, a delay adjustment module connected to the main control module, a switching control module connected to the delay adjustment module, the main control module, and the communication module, and a feedback module connected to the communication module, the main control module, and the switching control module;

[0053] The delay adjustment module is configured to receive a control signal transmitted by the main control module and adjust the resistance value of a preset resistor according to the control signal;

[0054] The switching control module is configured to receive the adjusted resistance value transmitted by the delay adjustment module and control a preset transceiving signal according to the resistance value;

[0055] The communication module is configured to receive the transceiving data transmitted by the main control module and the transceiving signal transmitted by the switching control module, and process the transceiving data according to the transceiving signal;

[0056] The feedback module is used to obtain the transceiver data and the transceiver signal, and transmit the transceiver data and the transceiver signal to the main control module.

[0057] In this embodiment, the delay adjustment module is connected to the main control module, the switching control module is connected to the delay adjustment module and the main control module, the communication module is connected to the main control module and the switching control module, and the feedback module is connected to the communication module, the main control module and the switching control module. The feedback module, the switching control module, the delay adjustment module and the communication module connected to the main control module are driven to work by receiving the signals transmitted by the main control module, that is:

[0058] The main control circuit transmits a control signal to the delay adjustment module according to the working condition of the communication module. The delay adjustment module receives the control signal transmitted by the main control module, and then adjusts the resistance value of the preset resistor according to the control signal; the switching control module then receives the adjusted resistance value transmitted by the delay adjustment module, and controls the duration of the preset transceiver signal according to the received resistance value; the communication module then receives the transceiver data transmitted by the main control module and the transceiver signal transmitted by the switching control module, and transmits the transceiver data according to the transceiver signal; the feedback module obtains the transceiver data and the transceiver signal transmitted by the communication module, and transmits the stabilized transceiver data and transceiver signal to the main control module.

[0059] It should be noted that the working condition of the communication module refers to the switching condition of the sending and receiving levels of the 485 chip in the communication module and the condition of whether the data has been sent or received.

[0060] Exemplarily, the 485 self-transceiving circuit of the present invention includes: a main control module, a feedback module, a switching control module, a delay adjustment module, and a communication module. Among them, the delay adjustment module is connected to the main control module, the switching control module is connected to the delay adjustment module and the main control module, the communication module is connected to the main control module and the switching control module, and the feedback module is connected to the communication module, the main control module, and the switching control module. That is, the feedback module, the switching control module, the delay adjustment module, and the communication module are all connected to the main control module and are driven to work according to the signals transmitted by the main control module. The main control module transmits control signals to the delay adjustment module according to the switching situation of the transceiver control level of the 485 chip and the data sending or receiving situation in the communication module. Then, the delay adjustment module adjusts the resistance value of the preset resistor according to the received control signal. The switching control module then receives the adjusted resistance value transmitted by the delay adjustment module and controls the duration of the transceiving signal according to the size of the resistance value. The communication module receives the transceiving data transmitted by the main control module and the transceiving signal transmitted by the switching control module, and transmits the transceiving data according to the transceiving signal. The feedback module collects the transceiving data and the transceiving signal transmitted by the communication module, and transmits the stabilized transceiving data and transceiving signal to the main control module so that the main control module can judge whether the resistance value in the delay adjustment module meets the requirements.

[0061] Further, in a feasible embodiment, the main control module includes:

[0062] A main control device, the communication interface of the main control device is connected to the communication module, the feedback interface of the main control device is connected to the feedback module, and the control interface of the main control device is connected to the delay adjustment module.

[0063] In this embodiment, the main control module is used to adjust the resistance value of the resistor in the delay adjustment module according to the circuit working conditions, connect the communication interface of the main control device to the communication module, connect the feedback interface of the main control device to the feedback module, and connect the control interface of the main control device to the delay adjustment module, so as to facilitate the main control device to transmit communication data and send signals according to the feedback data obtained by the feedback module to adjust the resistance value in the delay adjustment module.

[0064] It should be noted that the main control device can be an MCU (Microcontroller Unit), an MPU (Microprocessor Unit), or other components with signal processing functions.

[0065] Exemplarily, assume that the master device is an MCU. Then, the MCU can adjust the resistance value of the resistor in the delay adjustment module according to the working conditions of the circuit. The MCU can be connected to the communication module through the RXD and TXD interfaces, can be connected to the feedback module through the CHK_TXD and CHK_TR interfaces, and can be connected to the delay adjustment module through the BD_CL1, BD_CL2, BD_CL3, and BD_EN interfaces. In this way, the MCU can transmit communication data with the communication module through the RXD and TXD interfaces, and can adjust the resistance value of the resistor device in the delay adjustment module through the BD_CL1, BD_CL2, BD_CL3, and BD_EN interfaces according to the feedback data obtained from the CHK_TXD and CHK_TR interfaces.

[0066] Further, in a feasible embodiment, the communication module includes:

[0067] A 485 chip, where the RE and DE pins of the 485 chip are connected to the switching control module, and the RO and DI pins of the 485 chip are connected to the master module.

[0068] In this embodiment, the communication module can be connected to the switching control module and the master module through the 485 chip. The RE and DE pins of the 485 chip are used to control the switching of the 485 chip to send or receive data, and the RO and DI pins are used to receive or send data. Therefore, the RE and DE pins of the 485 chip are connected to the switching control module, and the RO and DI pins of the 485 chip are connected to the master module.

[0069] It should be noted that in addition to the 485 chip, there are other components in the communication module, such as decoupling capacitors, pull-up resistors, pull-down resistors, etc. required for the common 485 chip to work.

[0070] Exemplarily, when the master device is an MCU and there are a 485 chip, decoupling capacitors, pull-up resistors, and pull-down resistors in the communication module, the RO pin of the 485 chip is connected to the RXD pin of the MCU, the DI pin is connected to the TXD pin, the RE pin is connected to the DE pin after taking the inverse, and then connected to the switching control module. The decoupling capacitor can be connected to the VCC pin of the 485 chip, the pull-up resistor is connected to the A pin of the 485 chip, and the pull-down resistor is connected to the B pin of the 485 chip.

[0071] Further, in a feasible embodiment, the feedback module includes:

[0072] A voltage follower unit, where the input end of the voltage follower unit is connected to the communication module, and the output end of the voltage follower unit is connected to the master module.

[0073] In this embodiment, the feedback module includes a voltage follower unit. The input end of the voltage follower unit is connected to the communication module to collect the transceiver data and signals of the communication module, and the output end of the voltage follower unit is connected to the feedback interface of the main control module to feed back the collected transceiver data and signals to the main control module.

[0074] It should be noted that the voltage follower unit is composed of at least two voltage followers. When it is composed of more than two voltage followers, the connection of multiple voltage followers requires the output of the previous stage to be used as the input of the next stage.

[0075] Exemplarily, when the voltage follower unit is composed of 2 voltage followers and the main control device is an MCU, the input end of voltage follower A is connected to the DI pin in the communication module, and the input end of voltage follower B is connected to the DE pin in the communication module. The transceiver data of the communication module is obtained through the DI pin, and the transceiver signal of the communication module is obtained through the DE pin. The output end of voltage follower A is connected to the CHK_TXD interface of the MCU, and the output end of voltage follower B is connected to the CHK_TR interface of the MCU to feed back the stable transceiver data and signals collected to the main control module.

[0076] Furthermore, in a feasible embodiment,

[0077] The switching control module includes:

[0078] A timing chip. The output pin of the timing chip is connected to the communication module. The trigger signal input pin of the timing chip is connected to the feedback module, the communication module, and the main control module. The discharge pin and threshold pin of the timing chip are connected to the delay adjustment module.

[0079] In this embodiment, the switching control module includes a timing chip. The output pin of the timing chip is connected to the communication module to control the transceiver signals of the chip in the communication module. The trigger signal input pin of the timing chip is connected to the feedback module, the main control module, and the communication module to control the transmission of transceiver data. The discharge and threshold pins of the timing chip are connected to the delay adjustment module to control whether the trigger pin of the chip is triggered.

[0080] It should be noted that the timing chip can be a common 555 chip or other chips that can meet the timing function. In addition to the timing chip, the switching control module can also have other components.

[0081] Exemplarily, when the timing chip is a 555 chip, the OUT pin of the 555 chip is connected to the signal transceiver pin in the communication module to control the signal transceiver of the 485 chip. The TRIG pin of the 555 chip is connected to the input end of the voltage follower in the feedback module, the DI pin in the communication module, and the TXD interface in the main control module to control the transmission of the transceiver data. The DISCH and THRES pins of the 555 chip are connected to the delay adjustment module to control whether the trigger pin of the 555 chip is triggered.

[0082] Further, in a feasible embodiment, the delay adjustment module includes:

[0083] A decoder unit, the input pin of the decoder unit is connected to the main control module;

[0084] A resistor matching unit, the resistor matching unit is connected to the decoder unit;

[0085] A digital potentiometer, the digital potentiometer is connected to the switching control module and the resistor matching unit.

[0086] In this embodiment, the delay adjustment module includes a decoder unit, a resistor matching unit, and a digital potentiometer. Among them, the input pin of the decoder unit is connected to the main control module to receive the signal transmitted by the main control module. The resistor matching unit is connected to the decoder unit to control the resistance value of the resistor in the resistor matching unit through the output of the decoder unit. The digital potentiometer is connected to the resistor matching unit and the switching control module to adjust its own resistance value.

[0087] It should be noted that the resistor matching unit can flexibly adjust the number and size of the resistors according to the baud rate required by the circuit system, and the digital potentiometer can also select a suitable digital potentiometer according to the baud rate required by the circuit system.

[0088] Exemplarily, please refer to Figure 2 , Figure 2 is the circuit principle schematic diagram of the 485 self-transceiver circuit of the present invention. Among them, Figure 2 When the delay adjustment module in is composed of a 74LS138 decoder, a baud rate matching resistor array, and a 256-division 10K digital potentiometer, the input pin of the 74LS138 decoder is connected to the control interface of the MCU to receive the control signal transmitted by the MCU. The baud rate matching resistor array is connected to the output end of the 74LS138 decoder to adjust the resistance value of the resistor in the resistor array through the output signal of the decoder. The W pin of the 256-division 10K digital potentiometer is connected to the switching control module, and the H pin is connected to the matching resistor array to flexibly adjust the resistance value of the digital potentiometer. It should be understood that when different matching resistor arrays and digital potentiometers are used, it will affect the accuracy of the switching moment of the 485 self-transceiver circuit.

[0089] In this embodiment, the present invention collects the transceiver signals and transceiver data of the 485 chip through the feedback module to determine whether the switching of the transceiver signals is after the transmission of the transceiver data is completed. Then, the MCU sends a resistance adjustment signal to adjust the resistance in the delay adjustment module to an appropriate value. Next, the switching control module controls the timing of switching the transceiver signals of the 485 chip, and iterates multiple times to accurately control the moment when the 485 chip switches the transceiver signals, thereby achieving the effect of being compatible with the switching time and driving ability of the 485 self-transceiving circuit.

[0090] Furthermore, based on the above embodiments of the 485 self-transceiving circuit of the present invention, various embodiments of the control method of the 485 self-transceiving circuit of the present invention are proposed.

[0091] Please refer to Figure 3 , Figure 3 which is a schematic flowchart of an embodiment of the control method of the 485 self-transceiving circuit of the present invention. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than here.

[0092] In addition, in this embodiment, the execution subject of the control method of the 485 self-transceiving circuit of the present invention may be the above-mentioned 485 self-transceiving circuit of the present invention itself, or the execution subject of the control method of the 485 self-transceiving circuit of the present invention may also be a data processing terminal integrated and assembled inside the 485 self-transceiving circuit or a terminal device externally connected to the 485 self-transceiving circuit. For the convenience of elaboration and reading and understanding, the following will all use the terminal device as the execution subject to elaborate on the embodiments of the control method of the 485 self-transceiving circuit of the present invention.

[0093] As Figure 3 shown, in the first embodiment of the control method of the 485 self-transceiving circuit of the present invention, the control method of the 485 self-transceiving circuit of the present invention specifically includes the following steps:

[0094] Step S10: Transmit a control signal from the main control module to the delay adjustment module connected to the main control module to control the delay adjustment module to adjust the resistance value of a preset resistance according to the control signal;

[0095] Step S20: Transmit the adjusted resistance value from the delay adjustment module to the switching control module connected to the delay adjustment module to control the switching control module to control a preset transceiver signal according to the resistance value;

[0096] Step S30: Transmit the transceiver data to the communication module connected to the main control module through the main control module, and transmit the transceiver signal to the communication module connected to the switching control module through the switching control module, so as to control the communication module to perform transmission processing on the transceiver data according to the transceiver signal;

[0097] Step S40: Transmit the transceiver signal and the transceiver data to the feedback module connected to the communication module through the communication module, so as to control the feedback module to transmit the transceiver data and the transceiver signal to the main control module.

[0098] In this embodiment, the terminal device first transmits a control signal to the delay adjustment module through the main control module, then controls the delay adjustment module to adjust the resistance value of the preset resistor in the delay adjustment module, and then transmits the adjusted resistance value of the resistor to the switching control module through the delay adjustment module, so as to control the switching control module to control the duration of the preset transceiver signal according to the size of the resistance value. Then, the main control module transmits the data to be transmitted, that is, the transceiver data, to the communication module connected to the main control module, and transmits the transceiver signal to the communication module through the switching control module, so that the communication module can transmit the received transceiver data according to the transceiver signal. Finally, the feedback module connected to the communication module obtains the transceiver signal and the transceiver data in the communication module, and transmits the transceiver data and the transceiver signal to the main control module, so that the main control module can judge whether the resistance value in the current delay adjustment module is appropriate.

[0099] It should be noted that the transceiver signal includes a receive signal and a transmit signal. When the transceiver signal is a receive signal, the communication module will receive the transceiver data transmitted by the main control module. When the transceiver signal is a transmit signal, the communication module will transmit the transceiver data transmitted by the main control module. It should be understood that the main control module judges whether the resistance value in the current delay adjustment module is appropriate by judging whether the 485 switching moment is within 1-2 bits of the stop bit of the transceiver data.

[0100] Exemplarily, assuming that the terminal device determines that the resistance value in the delay adjustment module needs to be increased, the terminal device first transmits a signal indicating that the resistance value needs to be increased to the delay adjustment module through the main control module, and then controls the delay adjustment module to increase the resistance value according to the signal indicating that the resistance value needs to be increased. Then, the increased resistance value is transmitted to the switching control module through the delay adjustment module. The switching control module extends the duration of the transmitted and received signals according to the increased resistance value, and then transmits the transmitted and received data to the communication module through the main control module, and transmits the transmitted and received signals to the communication module through the switching control module. The communication module controls the data transmission according to the received transmitted and received data and transmitted and received signals, and then transmits the transmitted and received data and transmitted and received signals to the feedback module. The feedback module returns the stabilized transmitted and received data and transmitted and received signals to the main control module. The main control module determines whether the 485 switching moment is within 1-2 bits of the stop bit of the transmitted and received data. If so, the resistance value is not adjusted anymore. If not, the resistance value in the delay adjustment module is continuously adjusted.

[0101] Further, in a feasible embodiment, the control signal includes: a resistance increasing signal and a resistance decreasing signal. Controlling the delay adjustment module to adjust the resistance value of a preset resistance according to the control signal includes:

[0102] Step S50, adjusting the resistance value of the preset resistance to be larger by the delay adjustment module according to the resistance increasing signal;

[0103] Step S60, adjusting the resistance value of the resistance to be smaller by the delay adjustment module according to the resistance decreasing signal.

[0104] In this embodiment, when the terminal device determines that the preset resistance value in the delay adjustment module needs to be increased, the terminal device transmits a resistance increasing signal to the delay adjustment module through the main control module, and controls the delay adjustment module to increase the resistance value according to the resistance increasing signal. When the terminal device determines that the resistance value in the delay adjustment module needs to be decreased, the terminal device transmits a resistance decreasing signal to the delay adjustment module through the main control module, and controls the delay adjustment module to decrease the resistance value according to the resistance decreasing signal.

[0105] It should be noted that before the terminal device determines whether the resistance value in the delay adjustment module needs to be adjusted, the terminal device can roughly adjust the resistance value in the matching resistance array according to a pre-designed corresponding table of the required baud rate and the matching resistance, and then adjust the resistance of the digital potentiometer according to the transmitted and received data and transmitted and received signals fed back by the feedback module.

[0106] Exemplarily, Table 1 below is a schematic table of resistance matching for an embodiment of the 485 self-transmitting and receiving circuit of the present invention. Table 1 lists the corresponding relationship between the baud rate and the matching resistance. Figure 4Schematic diagram of the iterative process of an embodiment of the 485 self-transceiving circuit of the present invention. Among them, the terminal device first needs to obtain the current baud rate in the circuit. Assuming that the required baud rate of the circuit is 9600 baud, before the terminal device determines whether the resistor in the delay adjustment module needs to be adjusted, the matching resistor corresponding to 9600 baud can be obtained as 11.46 kΩ according to Table 1. The terminal device can set the resistance value of the matching resistor array in the delay adjustment module to 11 kΩ, and set the digital potentiometer to the adjacent value of the resistance value required for 9600 baud rate. Then, a test waveform of 0X55 is sent out, and the delay detection of the TXD and the EN switching signal of the 485 chip is performed according to the feedback pin. If the switching moment of the transceiving signal is after the TXD valid data is sent out, it is detected whether the switching moment of the transceiving signal is less than 2 bit widths from the TXD end bit, or whether it is less than 1 us. If it is less, the self-transceiving parameter configuration is completed. If it is greater, the terminal device will reduce the resistance value of the digital potentiometer. If the switching moment of the transceiving signal is before the TXD valid data is sent out, the terminal device calculates the resistance value that needs to be increased and increases the resistance value of the digital potentiometer, and sends out the 0X55 test waveform again for testing.

[0107] Required baud rate Matching resistor (unit: K) 4800 22.92 9600 11.46 19200 5.73 38400 2.86 115200 0.95 230400 0.48 460800 0.24 921600 0.12

[0108] Table 1

[0109] In this embodiment, the present invention first roughly adjusts the resistance value of the delay adjustment module through the baud rate - matching resistor table, and then realizes the effect of controlling the switching moment of the transceiving signal of the 485 self-transceiving circuit within 2 bits from the transceiving data stop bit, or controlling the switching moment within 1 us from the transceiving data stop bit by iteratively performing the step of finely adjusting the resistance value of the delay adjustment module through the feedback result of the feedback module.

[0110] In addition, the embodiment of the present invention also provides a storage medium, and the storage medium stores one or more programs, and the one or more programs can also be executed by one or more processors to be used to implement the steps of the control method of the 485 self-transceiving circuit described in any one of the above.

[0111] The specific implementation manner of the storage medium of the present invention is basically the same as that of each embodiment of the above control method of the 485 self-transceiving circuit, and will not be described in detail here.

Claims

1. A 485 self-transceiving circuit, characterized in that, The 485 self-transceiving circuit includes: a main control module, a communication module connected to the main control module, a delay adjustment module connected to the main control module, a switching control module connected to the delay adjustment module, the main control module, and the communication module, and a feedback module connected to the communication module, the main control module, and the switching control module; The delay adjustment module is configured to receive a control signal transmitted by the main control module and adjust the resistance value of a preset resistor according to the control signal; The switching control module is configured to receive the adjusted resistor value transmitted by the delay adjustment module and control a preset transceiving signal according to the resistor value; The communication module is configured to receive the transceiving data transmitted by the main control module and the transceiving signal transmitted by the switching control module, and perform transmission processing on the transceiving data according to the transceiving signal; The feedback module is configured to obtain the transceiving data and the transceiving signal, and transmit the transceiving data and the transceiving signal to the main control module; The main control module includes: A main control device, a communication interface of the main control device is connected to the communication module, a feedback interface of the main control device is connected to the feedback module, and a control interface of the main control device is connected to the delay adjustment module; The communication module includes: A 485 chip, RE and DE pins of the 485 chip are connected to the switching control module, and RO and DI pins of the 485 chip are connected to the main control module; The feedback module includes: A voltage follower unit, an input end of the voltage follower unit is connected to the communication module, and an output end of the voltage follower unit is connected to the main control module; The switching control module includes: A timing chip, an output pin of the timing chip is connected to the communication module, a trigger signal input pin of the timing chip is connected to the feedback module, the communication module, and the main control module, and a discharge pin and a threshold pin of the timing chip are connected to the delay adjustment module; The delay adjustment module includes: A decoder unit, an input pin of the decoder unit is connected to the main control module; A resistor matching unit, the resistor matching unit is connected to the decoder unit, and the resistor matching unit is configured to adjust the number and size of resistors according to the baud rate required by the circuit system; A digital potentiometer, the digital potentiometer is connected to the switching control module and the resistor matching unit, and the digital potentiometer is configured to adjust its own resistance value according to the baud rate required by the circuit system.

2. A control method for a 485 self-transceiving circuit, characterized in that, The control method is applied to the 485 self-transceiving circuit according to claim 1, and the control method includes: Transmitting a control signal from the main control module to a delay adjustment module connected to the main control module to control the delay adjustment module to adjust the resistance value of a preset resistor according to the control signal; Transmitting the adjusted resistor value from the delay adjustment module to a switching control module connected to the delay adjustment module to control the switching control module to control a preset transceiving signal according to the resistor value; Transmit the transceiver data to the communication module connected to the main control module through the main control module, and transmit the transceiver signal to the communication module connected to the switching control module through the switching control module, so as to control the communication module to perform transmission processing on the transceiver data according to the transceiver signal; Transmit the transceiver signal and the transceiver data to the feedback module connected to the communication module through the communication module, so as to control the feedback module to transmit the transceiver data and the transceiver signal to the main control module; The control signal includes: a resistance increasing signal and a resistance decreasing signal. The controlling the delay adjustment module to adjust the resistance value of the preset resistance according to the control signal includes: Adjust the resistance value of the preset resistance to be larger through the delay adjustment module according to the resistance increasing signal; Adjust the resistance value of the resistance to be smaller through the delay adjustment module according to the resistance decreasing signal.

3. A computer device, characterized in that, The computer device includes: a memory, a processor, and a control program of the 485 self-transceiver circuit stored on the memory and executable on the processor. When the control program of the 485 self-transceiver circuit is executed by the processor, the steps of the control method of the 485 self-transceiver circuit as described in claim 2 are implemented.

4. A storage medium, characterized in that, A control program of the 485 self-transceiver circuit is stored on the storage medium. When the control program of the 485 self-transceiver circuit is executed by the processor, the steps of the control method of the 485 self-transceiver circuit as described in claim 2 are implemented.

Citation Information

Patent Citations

  • Transmitting-receiving circuit

    CN107508613A

  • 485 bus automatic transceiving switching circuit based on NE555

    CN210518314U