CN113282035A - Communication device, electrical equipment and communication control method thereof - Google Patents

Communication device, electrical equipment and communication control method thereof Download PDF

Info

Publication number
CN113282035A
CN113282035A CN202110523658.0A CN202110523658A CN113282035A CN 113282035 A CN113282035 A CN 113282035A CN 202110523658 A CN202110523658 A CN 202110523658A CN 113282035 A CN113282035 A CN 113282035A
Authority
CN
China
Prior art keywords
communication
communication mode
module
control signal
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110523658.0A
Other languages
Chinese (zh)
Inventor
徐毛毛
刘文斌
王烨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Gree Electric Appliances Inc of Zhuhai
Original Assignee
Gree Electric Appliances Inc of Zhuhai
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Gree Electric Appliances Inc of Zhuhai filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN202110523658.0A priority Critical patent/CN113282035A/en
Publication of CN113282035A publication Critical patent/CN113282035A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0423Input/output
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/25Pc structure of the system
    • G05B2219/25257Microcontroller

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Telephone Function (AREA)

Abstract

The invention discloses a communication device, electrical equipment and a communication control method thereof, wherein the device comprises: the isolation unit receives the first control signal and performs isolation processing to obtain a first isolation control signal; the second control signal is received and isolated to obtain a second isolation control signal; the switching unit is used for switching the communication mode based on the first isolation control signal and determining the current communication mode so that the first control unit can communicate with other control units according to the current communication mode; the communication unit is used for carrying out communication according to a first communication mode in a power-off state; and under the power-on state, according to the second communication mode, carrying out communication by combining a second isolation control signal. According to the scheme, when the control unit selects the communication mode, the UART communication mode and the 485 communication mode are switched and used in a software setting mode, and the universality and compatibility of the control unit on hardware are improved.

Description

Communication device, electrical equipment and communication control method thereof
Technical Field
The invention belongs to the technical field of communication control, and particularly relates to a communication device, electric equipment and a communication control method thereof, in particular to a communication circuit capable of switching a UART communication mode and a 485 communication mode under software control, electric equipment with the communication circuit and a communication control method of the electric equipment.
Background
Communication between control units is often required in electrical equipment, and communication modes adopted in related schemes include a Universal Asynchronous Receiver/Transmitter (UART) communication mode and a 485 communication mode. The UART communication mode is often used in the case of short communication distance, and the 485 communication mode is often used in the case of long communication distance. The UART communication mode is a communication mode using a Universal Asynchronous Receiver/Transmitter (UART). The 485 communication mode is a communication mode which adopts an RS485 communication chip for communication.
In the related scheme, when the control unit of the electrical equipment selects the communication mode, the UART communication mode or the 485 communication mode needs to be distinguished by the difference of the control unit of the electrical equipment in hardware, so that the universality and the compatibility of the control unit of the electrical equipment in hardware are greatly reduced.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention aims to provide a communication device, electrical equipment and a communication control method thereof, which are used for solving the problems that when a control unit of the electrical equipment selects a communication mode, a UART communication mode or a 485 communication mode needs to be distinguished according to different hardware of the control unit of the electrical equipment, the universality and the compatibility of the control unit of the electrical equipment in the hardware are reduced, and the effects of improving the universality and the compatibility of the control unit of the electrical equipment on the hardware are achieved by arranging a communication circuit which has a UART communication function and a 485 communication function and can be switched to use and realizing the switching between the UART communication mode and the 485 communication mode by a software setting mode when the control unit of the electrical equipment selects the communication mode.
The invention provides a communication device, comprising: the system comprises an isolation unit, a conversion unit and a communication unit; the isolation unit, the conversion unit and the communication unit can form a communication circuit which has a first communication function and a second communication function and can be used for switching the first communication function and the second communication function; in the communication circuit: the isolation unit is configured to receive a first control signal sent by a first control unit, and perform isolation processing on the first control signal to obtain a first isolation control signal; the first control unit is configured to receive a first control signal sent by the first control unit, and perform isolation processing on the first control signal to obtain a first isolation control signal; the first control unit is a control unit of first electrical equipment needing communication; the first control signal is a control signal for selecting a communication mode of the communication circuit by controlling the on-off of the power supply of the communication unit; the second control signal is a control signal for controlling the communication unit to work; the communication mode of the communication circuit comprises the following steps: a first communication mode and a second communication mode; the first communication mode is a communication mode for communicating by utilizing a first communication function; the second communication mode is a communication mode for communicating by utilizing a second communication function; the conversion unit is configured to perform communication mode conversion based on the first isolation control signal, so that one of the first communication mode and the second communication mode corresponding to the first control signal is used as a current communication mode, and the first control unit can perform communication with other control units according to the current communication mode; the communication unit is configured to be in a power-off state when the current communication mode is the first communication mode, and to communicate with other control units according to the first communication mode in the power-off state; and under the condition that the current communication mode is the second communication mode, the communication unit is in a power-on state, so that under the power-on state, the communication between the first control unit and other control units is realized according to the second communication mode and in combination with the second isolation control signal.
In some embodiments, the isolation unit comprises: a first isolation module and a second isolation module; the conversion unit includes: the device comprises a first conversion module, a second conversion module and a third conversion module; the first isolation module is arranged among the input end of the first control signal, the control end of the first conversion module, the control end of the second conversion module and the control end of the third conversion module; the output end of the first conversion module is connected to one connecting end of the driver output end and the receiver input end of the communication module; the output end of the second conversion module is connected to the other connecting end of the driver output end and the receiver input end of the communication unit; the output end of the third conversion module is connected to the power supply end of the communication unit; the second isolation module is arranged between the input end of the second control signal and the driver output enabling end and the receiver enabling output end of the communication unit.
In some embodiments, the first isolation module comprises: a first optocoupler module; the second isolation module comprising: a second optocoupler module; the first conversion module includes: a first switch tube module; a second conversion module comprising: a second switch tube module; a third conversion module comprising: a third switch tube module; a cathode on a diode side of the first optical coupling module is used as an input end of the first optical coupling module and is connected to an input end of the first control signal; an emitter at the transistor side of the first optical coupling module is used as an output end of the first optical coupling module; a cathode on a diode side of the second optical coupling module is used as an input end of the second optical coupling module and is connected to an input end of the second control signal; an emitter at the transistor side of the second optical coupling module is used as an output end of the second optical coupling module; the base electrode of the first switch tube module is used as a control end of the first switch tube module; the collector of the first switch tube module is used as the output end of the first switch tube module; the base electrode of the second switch tube module is used as the control end of the second switch tube module; the emitting electrode of the second switch tube module is used as the output end of the second switch tube module; the base of the third switch tube module is used as the control end of the third switch tube module; and the collector of the third switch tube module is used as the output end of the third switch tube module.
In some embodiments, the isolation unit further comprises: a third isolation module and a fourth isolation module; the third isolation module is arranged between a signal receiving end of the first control unit and a receiver output end of the communication unit; and the fourth isolation module is arranged between the signal sending end of the first control unit and the receiver output end of the communication unit.
In some embodiments, the third isolation module comprises: a third optical coupling module; the fourth isolation module, comprising: a fourth optical coupling module; an emitter at the transistor side of the third optical coupling module is used as an input end of the third optical coupling module; an anode on the diode side of the third optocoupler module is used as an output end of the third optocoupler module; and the anode at the diode side of the fourth optical coupling module is used as the input end of the fourth optical coupling module.
In some embodiments, the communication unit comprises: 485 communication module; the first communication method includes: UART communication mode; the second communication method includes: 485 communication mode; the communication unit is in a power-on state under the condition that the current communication mode is the second communication mode, so that the communication between the first control unit and other control units is realized according to the second communication mode and the second isolation control signal under the power-on state; under the condition that the current communication mode is the first communication mode, the communication unit is in a power-off state so as to communicate with other control units under the power-off state, and the communication method comprises the following steps: under the condition that the current communication mode is a UART communication mode, the first control signal is a signal with a first set level, and the communication circuit communicates according to the UART communication mode; under the condition that the current communication mode is a 485 communication mode, the first control signal is a signal of a second set level, and the communication circuit communicates in the 485 communication mode; in the 485 communication mode, when the second control signal is a signal of a first set level, the 485 communication module can realize first set 485 communication; under the 485 communication mode, when the second control signal is a second signal with a set level, the 485 communication module can realize second set 485 communication.
In accordance with another aspect of the present invention, there is provided an electrical apparatus, including: the communication device is described above.
In another aspect, the present invention provides a communication control method for an electrical device, including: receiving a first control signal sent by a first control unit through an isolation unit, and carrying out isolation processing on the first control signal to obtain a first isolation control signal; the first control unit is configured to receive a first control signal sent by the first control unit, and perform isolation processing on the first control signal to obtain a first isolation control signal; the first control unit is a control unit of first electrical equipment needing communication; the first control signal is a control signal for selecting a communication mode of the communication circuit by controlling the on-off of the power supply of the communication unit; the second control signal is a control signal for controlling the communication unit to work; the communication mode of the communication circuit comprises the following steps: a first communication mode and a second communication mode; the first communication mode is a communication mode for communicating by utilizing a first communication function; the second communication mode is a communication mode for communicating by utilizing a second communication function; switching a communication mode based on the first isolation control signal through a switching unit to use one of the first communication mode and the second communication mode corresponding to the first control signal as a current communication mode so that the first control unit can communicate with other control units according to the current communication mode; through a communication unit, under the condition that the current communication mode is the first communication mode, the communication unit is in a power-off state so as to communicate with other control units under the power-off state; and under the condition that the current communication mode is the second communication mode, the communication unit is in a power-on state, so that under the power-on state, the communication between the first control unit and other control units is realized according to the second communication mode and in combination with the second isolation control signal.
In some embodiments, the communication unit comprises: 485 communication module; the first communication method includes: UART communication mode; the second communication method includes: 485 communication mode; through the communication unit, under the condition that the current communication mode is the second communication mode, the communication unit is in a power-on state, so that under the power-on state, the communication between the first control unit and other control units is realized according to the second communication mode and in combination with the second isolation control signal; under the condition that the current communication mode is the first communication mode, the communication unit is in a power-off state so as to communicate with other control units under the power-off state, and the communication method comprises the following steps: under the condition that the current communication mode is a UART communication mode, the first control signal is a signal with a first set level, and the communication circuit communicates according to the UART communication mode; under the condition that the current communication mode is a 485 communication mode, the first control signal is a signal of a second set level, and the communication circuit communicates in the 485 communication mode; in the 485 communication mode, when the second control signal is a signal of a first set level, the 485 communication module can realize first set 485 communication; under the 485 communication mode, when the second control signal is a second signal with a set level, the 485 communication module can realize second set 485 communication.
Therefore, according to the scheme of the invention, the communication circuit which has the UART communication function and the 485 communication function and can switch between the UART communication mode and the 485 communication mode is arranged by utilizing the isolation circuit, the conversion circuit and the RS485 communication module, and when the control unit of the electrical equipment selects the communication mode, the communication circuit is controlled by controlling the on-off of the power supply of the RS485 communication module only through software setting, so that the communication circuit can switch between the UART communication mode and the 485 communication mode; therefore, by arranging the communication circuit which has the UART communication function and the 485 communication function and can be switched to use, when the control unit of the electrical equipment selects the communication mode, the switching use of the UART communication mode and the 485 communication mode is realized by the software setting mode, and the universality and the compatibility of the control unit of the electrical equipment on hardware are favorably improved.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
Fig. 1 is a schematic structural diagram of a communication device according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an embodiment of a communication circuit capable of switching between a UART communication mode and a 485 communication mode under software control;
fig. 3 is a schematic structural diagram of an embodiment of a communication circuit capable of switching between a UART communication mode and a 485 communication mode under software control;
fig. 4 is a flowchart illustrating a communication control method according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the specific embodiments of the present invention and the accompanying drawings. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the communication circuit of the related scheme, a communication circuit which can realize the switching between the UART communication mode and the 485 communication mode through software control does not exist, so that the electric appliance equipment needs to distinguish the UART communication mode from the 485 communication mode by utilizing the difference of a mainboard on hardware. However, the communication modes are distinguished by using the difference of the mainboard on the hardware, so that the universality and the compatibility of the mainboard of the electrical equipment on the hardware are greatly reduced. Moreover, when the hardware of the whole machine is changed manually to switch the communication mode, the whole machine needs to be disassembled for operation, which is very inconvenient in operation and low in efficiency.
The components and parts used in the UART communication mode and the 485 communication mode are different, and the circuits are different. Even if the same circuit has the reserved position of the component for switching the communication mode in the related scheme, if the component is not changed on hardware, the UART communication mode or the 485 communication mode cannot be realized and distinguished. Therefore, a main board can only use a 485 communication mode or a UART communication mode, so that the universality and the compatibility are not realized. In addition, the motherboard requires batch manual hardware changes, which is impractical and inefficient.
In the communication circuit of the electrical equipment, the electrical equipment must distinguish whether to use a UART communication mode or a 485 communication mode according to the difference of hardware, so as to greatly reduce the problems of the universality and the compatibility of the mainboard of the electrical equipment on the hardware. According to an embodiment of the present invention, a communication device is provided. Referring to fig. 1, a schematic diagram of an embodiment of the apparatus of the present invention is shown. The communication device can be used as a communication device of electrical equipment and is used for realizing communication of the electrical equipment. The communication device of the electrical equipment comprises: the device comprises an isolation unit, a conversion unit and a communication unit. Isolation units such as isolation circuit 1, isolation circuit 2, isolation circuit 3, and isolation circuit 4. Conversion units such as a conversion circuit 1, a conversion circuit 2, and a conversion circuit 3. And a communication unit, such as a 485 communication module. The isolation unit, the conversion unit and the communication unit can form a communication circuit which has a first communication function and a second communication function and can be used for switching the first communication function and the second communication function. A first communication function, such as a UART communication function. And a second communication function, such as a 485 communication function.
In the communication circuit: the isolation unit is configured to receive a first control signal (such as a control signal Y) sent by a first control unit, and perform isolation processing on the first control signal to obtain a first isolation control signal. The isolation control unit is further configured to receive a second control signal (such as the control signal X) sent by the first control unit, and perform isolation processing on the second control signal to obtain a second isolation control signal.
The first control unit (for example, the control unit 1) is a control unit of a first electrical device that needs to communicate. The first control signal is a control signal for selecting a communication mode of the communication circuit by controlling the on-off of the power supply of the communication unit. The second control signal is a control signal for controlling the operation of the communication unit. The communication mode of the communication circuit comprises the following steps: a first communication mode and a second communication mode. The first communication mode is a communication mode for performing communication by using a first communication function. The second communication mode is a communication mode for performing communication by using a second communication function. For example: the control signal Y is a control signal for controlling the selection of the UART communication mode or the 485 communication mode by the control unit 1, and the control signal X is a control signal for controlling the RS485 communication chip to work by the control unit 1.
The conversion unit is configured to perform communication mode conversion based on the first isolation control signal, so that one of the first communication mode and the second communication mode corresponding to the first control signal is used as a current communication mode, and the first control unit can perform communication with other control units according to the current communication mode. That is, the communication unit may perform communication mode switching based on the communication mode switching signal to use one of the first communication function and the second communication function corresponding to the first control signal as a current communication function, so that the first control unit may perform communication with other control units according to the current communication function. The other control unit is a control unit of other electrical equipment which needs to communicate with the control unit of the first electrical equipment.
The communication unit is configured to be in a power-on state when the current communication mode is the second communication mode, so that communication between the first control unit and other control units is realized according to the second communication mode and the second isolation control signal in the power-on state. And under the condition that the current communication mode is the first communication mode, the communication unit is in a power-off state, so that the first control unit can communicate with other control units without passing through the communication unit under the power-off state.
Therefore, the scheme of the invention provides the communication device, such as the communication circuit which can realize the selection of the UART communication mode and the 485 communication mode through software control, and can realize the switching of the UART communication mode and the 485 communication mode only through software setting, thereby greatly improving the compatibility and the universality of the mainboard of the electric appliance product. In addition, the inconvenience in operation is reduced, the efficiency is improved, and the problems that when the hardware of the whole machine is manually changed to switch the communication mode, the whole machine needs to be disassembled for operation, the operation is very inconvenient, and the efficiency is low can be solved.
In some embodiments, the isolation unit comprises: a first isolation module (e.g., isolation circuit 1) and a second isolation module (e.g., isolation circuit 3).
The conversion unit includes: a first conversion module (e.g., conversion circuit 1), a second conversion module (e.g., conversion circuit 2), and a third conversion module (e.g., conversion circuit 3).
The first isolation module is disposed between the input terminal of the first control signal and the control terminal of the first conversion module (e.g., the base of the transistor Q1), the control terminal of the second conversion module (e.g., the base of the transistor Q2), and the control terminal of the third conversion module (e.g., the base of the transistor Q3). The output terminal of the first converting module (e.g. the collector of the transistor Q1) is connected to one of the driver output terminal and the receiver input terminal of the communication module, i.e. to the input terminal of the communication signal M between the first control unit and the other control units, e.g. to pin a of an RS485 chip. And the output end of a driver and the input end of a receiver of the communication module, such as the pin A and the pin B of the RS485 chip. The output terminal of the second converting module (for example, the emitter of the transistor Q2) is connected to the other of the driver output terminal and the receiver input terminal of the communication unit, that is, to the input terminal of the communication signal N between the first control unit and the other control units, for example, to the B pin of the RS485 chip. The communication signal M and the communication signal N are communication signals between the first control unit and other control units. An output terminal of the third converting module (e.g., a collector of the transistor Q3) is connected to a power supply terminal of the communication unit (e.g., a power supply pin of the RS485 chip).
The second isolation module is arranged between the input end of the second control signal and the driver output enabling end and the receiver enabling output end of the communication unit. And the driver output enable end and the receiver enable output end of the communication unit, such as a DE pin and a RE/pin of an RS485 communication chip.
According to the scheme, three conversion circuits are designed, wherein one control signal controls the on-off of two UART communication circuits and the on-off of a 485 chip power supply, and the fact that whether the communication mode is a UART communication mode or a 485 communication mode can be controlled and selected through software is achieved. Specifically, one path of control signal is designed to simultaneously control three conversion circuits, wherein the two paths of conversion circuits control the on-off of two paths of UART communication circuits, and the other path of conversion circuit controls the on-off of a 485 chip power supply pin power supply, so that the software is switched to use a UART communication mode or a 485 communication mode.
In some embodiments, the first isolation module (e.g., isolation circuit 1) includes: the first optical coupler module, such as an optical coupler B1 and a peripheral circuit thereof, and the peripheral circuit of the optical coupler B1 comprises a resistor R1 and a resistor R2. The second isolation module (e.g., isolation circuit 3) includes: and the second optical coupling module, such as an optical coupler B3 and a peripheral circuit thereof, and the peripheral circuit of the optical coupler B3 comprises a resistor R5 and a resistor R6.
The first conversion module (e.g., conversion circuit 1) includes: the first switch tube module, such as the transistor Q1 and its peripheral circuit, and the resistor R9, the resistor R10 and the resistor R11 form the peripheral circuit of the transistor Q1. A second conversion module (e.g., conversion circuit 2) comprising: the second switch transistor module, such as transistor Q2 and its peripheral circuit, resistor R12 and resistor R13 form the peripheral circuit of transistor Q1. A third conversion module (e.g., conversion circuit 3) comprising: the third switch transistor module, such as the transistor Q3 and its peripheral circuit, and the resistor R14, the resistor R15 and the resistor R16 form the peripheral circuit of the transistor Q1.
And a cathode at a diode side of the first optical coupling module (such as the optical coupler B1 and a peripheral circuit thereof) is used as an input end of the first optical coupling module (such as the optical coupler B1 and a peripheral circuit thereof) and is connected to an input end of the first control signal. And an emitter at the transistor side of the first optical coupling module (such as the optical coupler B1 and a peripheral circuit thereof) is used as an output end of the first optical coupling module (such as the optical coupler B1 and a peripheral circuit thereof).
And a cathode at the diode side of the second optical coupling module (such as the optical coupler B3 and a peripheral circuit thereof) is used as an input end of the second optical coupling module (such as the optical coupler B3 and a peripheral circuit thereof) and is connected to an input end of the second control signal. And an emitter at the transistor side of the second optical coupling module (such as the optical coupler B3 and a peripheral circuit thereof) is used as an output end of the second optical coupling module (such as the optical coupler B3 and a peripheral circuit thereof).
The base of the first switch tube module (such as the transistor Q1 and its peripheral circuit) is used as the control terminal of the first switch tube module (such as the transistor Q1 and its peripheral circuit). The collector of the first switch tube module (such as the transistor Q1 and its peripheral circuit) is used as the output terminal of the first switch tube module (such as the transistor Q1 and its peripheral circuit).
The base of the second switch tube module (such as the transistor Q2 and its peripheral circuit) is used as the control terminal of the second switch tube module (such as the transistor Q2 and its peripheral circuit). The emitter of the second switch tube module (such as the transistor Q2 and its peripheral circuit) is used as the output terminal of the second switch tube module (such as the transistor Q2 and its peripheral circuit).
The base of the third switch tube module (such as the transistor Q3 and its peripheral circuit) is used as the control terminal of the third switch tube module (such as the transistor Q3 and its peripheral circuit). The collector of the third switch tube module (such as the transistor Q3 and its peripheral circuit) is used as the output terminal of the third switch tube module (such as the transistor Q3 and its peripheral circuit).
In some embodiments, the isolation unit further comprises: a third isolation module (e.g., isolation circuit 2) and a fourth isolation module (e.g., isolation circuit 4).
The third isolation module (e.g., the isolation circuit 2) is disposed between a signal receiving end (e.g., a communication signal RX end) of the first control unit and a receiver output end (e.g., an RO pin of an RS485 communication chip) of the communication unit. The signal receiving end of the first control unit is, for example, the input end of the communication signal RX of the first control unit.
The fourth isolation module is arranged between a signal sending end (such as a communication signal TX end) of the first control unit and a receiver output end (such as a DI pin of an RS485 communication chip) of the communication unit. A signal sending end of the first control unit, for example, an input end of a communication signal TX of the first control unit.
In some embodiments, the third isolation module (e.g., isolation circuit 2) includes: and a third optical coupling module, such as an optical coupler B2 and a peripheral circuit thereof, wherein the peripheral circuit of the optical coupler B2 comprises a resistor R3 and a resistor R4. The fourth isolation module (e.g., isolation circuit 4) includes: and a fourth optical coupling module, such as an optical coupler B4 and a peripheral circuit thereof, wherein the peripheral circuit of the optical coupler B4 comprises a resistor R7 and a resistor R8.
An emitter of the third optical coupler module (e.g., the optical coupler B2 and its peripheral circuit) on the transistor side is used as an input end of the third optical coupler module (e.g., the optical coupler B2 and its peripheral circuit), and is connected to a signal receiving end of the first control unit, e.g., connected to an input end of a communication signal RX of the first control unit. And the anode at the diode side of the third optical coupling module (such as the optical coupler B2 and the peripheral circuit thereof) is used as the output end of the third optical coupling module (such as the optical coupler B2 and the peripheral circuit thereof).
An anode of a diode side of the fourth optical coupling module (such as the optical coupler B4 and its peripheral circuit) is used as an input end of the fourth optical coupling module (such as the optical coupler B4 and its peripheral circuit), and is connected to a signal sending end of the first control unit, such as an input end of a communication signal TX connected to the first control unit.
Fig. 2 is a schematic structural diagram of an embodiment of a communication circuit capable of switching between a UART communication mode and a 485 communication mode under software control. In the related scheme, either a UART communication part or a 485 communication part is required, or a UART communication mode or a 485 communication mode needs to be switched in the same circuit by manually switching hardware. In the example shown in fig. 2, the UART communication mode or the 485 communication mode can be selectively switched and used by software in control through three conversion circuits and corresponding optical coupling isolation circuits.
As shown in fig. 2, the communication circuit capable of switching between the UART communication method and the 485 communication method under software control includes: the first conversion circuit to the third conversion circuit (such as the conversion circuit 1, the conversion circuit 2 and the conversion circuit 3), the first isolation circuit to the fourth isolation circuit (such as the isolation circuit 1, the isolation circuit 2, the isolation circuit 3 and the isolation circuit 4), and the 485 communication module (such as the 485 communication circuit).
In the example shown in fig. 2, the input terminal of the isolation circuit 3 is connected to the control signal Y terminal and is capable of receiving the control signal Y.
A first output of the isolation circuit 3 is connected to a first input of the conversion circuit 1. The second input terminal of the conversion circuit 1 is connected to the communication signal M terminal and is capable of receiving the communication signal M. The communication signal M end can carry out two-way communication through the first input end of the 485 communication module and the first output end of the 485 communication module. The first output end of the 485 communication module is connected to the end of the communication signal M. The first input end of the 485 communication module is also connected to the end of the communication signal M. The output terminal of the conversion circuit 1 is connected to the first input terminal of the isolation circuit 1. The first output terminal of the isolation circuit 1 is connected to the communication signal RX terminal, and is capable of outputting the communication signal RX. And a second input end of the isolation circuit 1 is connected with a second output end of the 485 communication module.
A second output of the isolation circuit 3 is connected to a first input of the conversion circuit 3. And a first output end of the conversion circuit 3 is connected to a second input end of the 485 communication module.
A third output terminal of the isolation circuit 3 is connected to the first input terminal of the conversion circuit 2. The second input terminal of the conversion circuit 2 is connected to the first output terminal of the isolation circuit 2. And the second output end of the isolation circuit 2 is connected to the third input end of the 485 communication module. The input terminal of the isolation circuit 2 is connected to the communication signal TX terminal and is capable of receiving the communication signal TX. The output terminal of the conversion circuit 2 is connected to the communication signal N terminal, and is capable of outputting the communication signal N. And the communication signal N end can carry out two-way communication through the fourth input end of the 485 communication module and the third output end of the 485 communication module. And the third output end of the 485 communication module is connected to the N end of the communication signal. And the fourth input end of the 485 communication module is also connected to the N end of the communication signal.
The first input terminal of the isolation circuit 4 is connected to the control signal X terminal and is configured to receive the control signal X. And the first output end of the isolation circuit 4 is connected to the fifth input end of the 485 communication module.
Fig. 3 is a schematic structural diagram of an embodiment of a communication circuit capable of switching between a UART communication mode and a 485 communication mode under software control. As shown in fig. 3, by controlling the corresponding conversion circuit and the corresponding optical coupler isolation circuit, the UART communication mode or the 485 communication mode can be selectively switched and used by software. Specifically, the control signal Y can simultaneously control the on-off of two NPN triodes and one PNP triode through one optical coupler, so as to realize the switching of the UART communication mode or the 485 communication mode.
In the example shown in fig. 3, U1, U2, U3, U4, U5, U6, U7, and U8 are power supply voltages, and U1, U2, U3, U4, U5, U6, U7, and U8 may be the same voltage or different voltages. GND, GND2 are grounds, isolated from each other. B1, B2, B3 and B4 are optical couplers, Q1 and Q2 are NPN triodes, Q3 is a PNP triode, Z1 is an RS485 communication chip, D1 and D2 are TVS diodes, a communication signal TX is a communication signal output by the control unit 1, a communication signal RX is a communication signal received by the communication unit 1, and a communication signal M and a communication signal N are communication signals between the control unit 1 and the control unit 2. The control signal Y is a control signal for controlling the selection of the UART communication mode or the 485 communication mode by the control unit 1, the control signal X is a control signal for controlling the RS485 communication chip to work by the control unit 1, the DI pin of the RS485 communication chip is the input end of a driver of the RS485 communication chip, the RO pin of the RS485 communication chip is the output end of a receiver of the RS485 communication chip, the DE pin of the RS485 communication chip is the output enable end of the driver of the RS485 communication chip, the RE/pin of the RS485 communication chip is the output enable end of the receiver of the RS485 communication chip, the A pin and the B pin of the RS485 communication chip are the output end of the driver of the RS485 communication chip or the input end of the receiver of the RS485 communication chip. The control unit 1 and the control unit 2 are control units of different electrical appliances.
In the example shown in fig. 3, the anode of the diode side of the optocoupler B1 is connected to the power supply U1 via a resistor R1. And the cathode of the diode side of the optical coupler B1 is used as an input end of the control signal Y. And a collector electrode on the transistor side of the optical coupler B1 is connected with a power supply U4. An emitter at the transistor side of the optocoupler B1 is grounded GND2 through a resistor R2, connected with the base of a triode Q3 through a resistor R15, connected with the base of a triode Q1 through a resistor R10, and connected with the base of a triode Q2 through a resistor R12.
The emitter of the triode Q3 is connected with the power supply U7 through the resistor R14. The collector of the transistor Q3 is grounded to GND2 through a resistor R16. And the collector of the triode Q3 is also connected to a power supply pin of the RS485 communication chip Z1. The grounding pin of the RS485 communication chip Z1 is grounded to GND 2.
The emitter of the transistor Q1 is connected to GND2 through a resistor R11. The collector of the transistor Q1 is connected to GND2 through a resistor R9 and to the input terminal of the signal M through a resistor R17.
The emitter of the transistor Q2 is connected to GND2 through a resistor R13 and is connected to the input terminal of the signal N through a resistor R20. And the collector of the transistor Q2 is connected to the DI pin of the RS485 communication chip Z1.
In the example shown in fig. 3, the transistor-side collector of the optocoupler B2 is connected to the power supply U2. The emitter of the transistor side of the optical coupler B2 is grounded GND through a resistor R3, and also serves as an input end of a communication signal RX. The cathode of the diode side of the optical coupler B2 is grounded to GND2 through a resistor R4. And the diode side anode of the optical coupler B2 is connected to the RO pin of the RS485 communication chip Z1.
In the example shown in fig. 3, the diode-side cathode of the optocoupler B3 serves as the input for the control signal X. And the anode of the diode side of the optical coupler B3 is connected with a power supply U3 through a resistor R5. And a collector electrode on the transistor side of the optical coupler B3 is connected with a power supply U5. And a transistor side emitter of the optical coupler B3 is grounded GND2 through a resistor R6 and is also connected to an RE/pin of an RS485 communication chip Z1 and a DE pin of the RS485 communication chip Z1.
In the example shown in fig. 3, the cathode of the diode side of the optical coupler B4 is grounded GND. And an anode at the diode side of the optocoupler B4 is connected with the input end of the signal TX after passing through a resistor R7. And the collector electrode of the transistor side of the optical coupler B4 is connected with a power supply U6. An emitter at the transistor side of the optical coupler B4 is grounded GND2 through a resistor R8 and is also connected to a DI pin of an RS485 communication chip Z1.
The pin B of the RS485 communication chip Z1 is grounded GND2 through a resistor R18, and is connected with the cathode of a TVS tube D1 through a resistor R21, and the anode of the TVS tube D1 is grounded GND 2. The cathode of the TVS tube D1 is also connected to the input terminal of the communication signal M. The pin A of the RS485 communication chip Z1 is connected with a power supply U8 through a resistor R19, and is connected with the cathode of a TVS tube D2 through a resistor R22, and the anode of the TVS tube D2 is grounded GND 2. The cathode of the TVS tube D2 is also connected to the input terminal of the communication signal N.
In the example shown in fig. 3, when the levels of the DE pin and the RE/pin of the RS485 communication chip are both low (no matter what level the level of the DI pin is):
if the voltage of the pin A of the RS485 communication chip is higher than the voltage of the pin B of the RS485 communication chip by more than a first set voltage value u1 at the same time, the pin RO of the RS485 communication chip outputs a high level.
If the voltage of the pin A of the RS485 communication chip is lower than the voltage of the pin B of the RS485 communication chip by more than a first set voltage value u1 at the same time, the pin RO of the RS485 communication chip outputs a low level.
When the electrical equipment is just powered on, the level of the pin A of the RS485 communication chip is pulled to a high level through the pull-up resistor. The level of the B pin of the RS485 communication chip is pulled to be low level through a pull-down resistor.
In the example shown in fig. 3, when the electrical levels of the DE pin and the RE/pin of the RS485 communication chip are both high levels, the pin a and the pin B of the RS485 communication chip respectively output a voltage signal that satisfies the logical relationship of a certain 485 communication mode along with the change of the high and low electrical levels of the DI pin of the RS485 communication chip.
Wherein, the logical relation of certain 485 communication modes means: the voltage waveform of the 485 communication function is met. The waveform description of the pin A and the pin B output by the RS485 communication chip is complex, the signal sent by the 485 module is the difference value between the signals of the pin A and the pin B, and after the receiving end receives the signals of the pin A and the pin B, the corresponding identification state is corresponding to the signals of the pin A and the pin B if the signals of the pin A and the pin B meet a certain difference value relation. Similarly, the RS485 communication chip receives signals of the pin A and the pin B, and the communication signals are identified by difference of the signals of the pin A and the pin B. Such as: when the RE/DE pin and RE pin are logic level 0, if A-B + 0.2V, the R pin outputs logic level 1. If A-B < -0.2V, then the R pin outputs a logic level of 0.
In some embodiments, the communication unit comprises: 485 communication module. The 485 communication module comprises a 485 communication chip, namely an RS485 communication chip and a peripheral circuit thereof. Peripheral circuit of RS485 communication chip includes: a resistor R19, a resistor R20, a resistor R21, a resistor R22, a TVS tube D1 and a TVS tube D2. The DI pin of the RS485 communication chip is the input end of a driver of the RS485 communication chip, the RO pin of the RS485 communication chip is the output end of a receiver of the RS485 communication chip, the DE pin of the RS485 communication chip is the output enable end of the driver of the RS485 communication chip, the RE/pin of the RS485 communication chip is the output enable end of the receiver of the RS485 communication chip, and the A pin and the B pin of the RS485 communication chip are the output end of the driver of the RS485 communication chip or the input end of the receiver of the RS485 communication chip.
The first communication method includes: UART communication mode. The second communication method includes: 485 communication mode. For example: after the electrical equipment is powered on, the control unit 1 controls the output of the signal Y to be a high level or a low level according to actual needs, so as to select whether to use the UART communication mode or the 485 communication mode. The communication signal TX is a communication signal output by the control unit 1, the communication signal RX is a communication signal received by the communication unit 1, and the communication signals M and N are communication signals between the control unit 1 and other control units such as the control unit 2.
And the communication unit is in a power-on state under the condition that the current communication mode is the second communication mode, so that the communication between the first control unit and other control units is realized according to the second communication mode and the second isolation control signal under the power-on state. Under the condition that the current communication mode is the first communication mode, the communication unit is in a power-off state, so that the first control unit can communicate with other control units without passing through the communication unit under the power-off state, wherein the communication state comprises any one of the following communication conditions:
the first communication scenario: and under the condition that the current communication mode is a UART communication mode, the first control signal is a signal with a first set level, the second control signal is a signal with a first set level or a second set level, and the communication circuit communicates according to the UART communication mode.
Second communication scenario: and under the condition that the current communication mode is a 485 communication mode, the first control signal is a signal of a second set level, and the communication circuit communicates in the 485 communication mode.
Under the 485 communication mode, when the second control signal is a signal of a first set level, the 485 communication module can realize first set 485 communication.
Under the 485 communication mode, when the second control signal is a second signal with a set level, the 485 communication module can realize second set 485 communication.
By using the example shown in fig. 3, in operation, after the electrical device is powered on, the control unit 1 controls the signal Y output to be a high level or a low level according to actual needs to select whether to use the UART communication mode or the 485 communication mode, which specifically includes the following steps:
step 1, when a UART communication mode is selected to be used:
when the control signal Y is low (no matter what level the control signal X is input), the bases of the transistor Q1, the transistor Q2, and the transistor Q3 will be changed from low to high. At this time, since the on voltage drop of the transistor inside the optocoupler is much smaller than 0.7V, the transistor Q3 is turned off when the control signal Y is input to a low level. The power supply pin of the RS485 communication chip Z1 is grounded to be at a low level, and the RS485 communication chip Z1 does not work.
The whole communication circuit, only part of the UART communication circuit is in operation at the moment.
Step 11, when the communication signal TX inputs a high level:
the collector of transistor Q2 changes from low to high. Since the collector of the transistor Q2 is at a low level, the base of the transistor Q2 is at a high level, and the emitter of the transistor Q2 is at a low level, the transistor Q2 will be turned on from off, the emitter of the transistor Q2 will be turned from low level to high level, and the output of the communication signal N will be turned from low level to high level. That is, the transistor Q2 will change from off to on due to the high level of the base of the transistor Q2 and the low level of the emitter of the transistor Q2.
When the communication signal TX is input low:
the collector of transistor Q2 changes from high to low. The transistor Q2 will be turned off, the emitter of the transistor Q2 will be changed from high to low, and the output of the communication signal N will be changed from high to low.
Thus, the communication signal TX input changes in high and low levels, which causes the communication signal N to also change in high and low levels, and the operation is repeated.
Step 12, when the communication signal M is input to a low level:
the collector of the transistor Q1 is low, the transistor Q1 is turned off, the emitter of the transistor Q1 is low, and the communication signal RX outputs low.
When the communication signal M is input to high level:
the collector of the transistor Q1 changes from low level to high level, because the base of the transistor Q1 is high level and the emitter of the transistor Q1 is low level when the collector of the transistor Q1 is low level, the transistor Q1 will change from cut-off to on, the emitter of the transistor Q1 will change from low level to high level, and the communication signal RX outputs high level. That is, the transistor Q1 will change from off to on due to the high level of the base of the transistor Q1 and the low level of the emitter of the transistor Q1. The collector of transistor Q2 will be described as low when the collector of transistor Q2 is low, which is the condition for conduction.
Thus, the communication signal RX also generates a corresponding high/low level change due to the high/low level change of the communication signal M input, and the operation is repeated.
And 2, when a 485 communication mode is selected:
when the control signal Y is input to high level, the base electrodes of the triode Q1, the triode Q2 and the triode Q3 are all low level at the moment, and the triode Q1 and the triode Q2 are kept to be cut off and are not conducted. Specifically, the transistor Q1 and the transistor Q2 are kept in the off state after the control signal Y is inputted with a high level. Because the base voltages of the transistor Q1 and the transistor Q2 are always 0 at this time. The triode Q3 is conducted, the power supply pin of the RS485 communication chip Z1 is electrified, and the RS485 communication chip Z1 starts to work.
The whole communication circuit, only the 485 communication circuit part is in operation.
Step 21, when the control signal X is input to low level:
the DE pin of the RS485 communication chip and the RE/pin of the RS485 communication chip are changed from low level to high level:
at this time, if the communication signal TX inputs a low level, the DI pin of the RS485 communication chip is at a low level.
At this time, if the communication signal TX inputs a high level, the DI pin of the RS485 communication chip changes from a low level to a high level.
Along with the high-low level change of the DI pin of the RS485 communication chip, the pin A of the RS485 communication chip and the pin B of the RS485 communication chip respectively output a voltage signal meeting a certain 485 communication logic relationship.
Step 22, when the control signal X is input to a high level:
the DE pin of the RS485 communication chip and the RE/pin of the RS485 communication chip are low levels:
at this time, if the voltage of the pin a of the RS485 communication chip is higher than the voltage of the pin B of the RS485 communication chip by more than the first set voltage value u1, the pin RO of the RS485 communication chip will output a high level, and the communication signal RX will change from the output low level to the high level.
At this time, if the voltage of the a pin of the RS485 communication chip is lower than the voltage of the BRS485 communication chip by more than the first set voltage value u1, the output at the RO of the RS485 communication chip will be changed from high level to low level, and the communication signal RX will be changed from high level to low level.
Therefore, when the control signal X is input to a high level, the voltage difference between the pin A of the RS485 communication chip and the pin B of the RS485 communication chip changes, so that the communication signal RX also generates corresponding high and low level changes, and the operation is repeatedly circulated.
Therefore, the UART communication mode or the 485 communication mode can be selected by software, and the circuit can normally carry out UART communication or 485 communication.
Therefore, the current communication mode can be selected to be the UART communication mode or the 485 communication mode through the first control signal. Through the second control signal, the work of the 485 communication module can be controlled. Therefore, the UART communication mode or the 485 communication mode is selected by software, and the circuit can normally carry out UART communication or 485 communication.
Through a large number of tests, the technical scheme of the invention is adopted, and the isolation circuit, the conversion circuit and the RS485 communication module are utilized to arrange the communication circuit which has the UART communication function and the 485 communication function and can switch the UART communication mode or the 485 communication mode, when the control unit of the electrical equipment selects the communication mode, the communication circuit is controlled by controlling the on-off of the power supply of the RS485 communication module through software setting, so that the communication circuit can switch the UART communication mode or the 485 communication mode. Therefore, by arranging the communication circuit which has the UART communication function and the 485 communication function and can be switched to use, when the control unit of the electrical equipment selects the communication mode, the switching use of the UART communication mode and the 485 communication mode is realized by the software setting mode, and the universality and the compatibility of the control unit of the electrical equipment on hardware are favorably improved.
According to the embodiment of the invention, the electrical equipment corresponding to the communication device is also provided. The electric device may include: the communication device is described above.
Since the processes and functions implemented by the electrical apparatus of this embodiment substantially correspond to the embodiments, principles, and examples of the foregoing devices, reference may be made to the related descriptions in the foregoing embodiments without being detailed in the description of this embodiment.
Through a large number of tests, the technical scheme of the invention is adopted, and the isolation circuit, the conversion circuit and the RS485 communication module are utilized to arrange the communication circuit which has the UART communication function and the 485 communication function and can switch and use the UART communication mode or the 485 communication mode, when the control unit of the electrical equipment selects the communication mode, the communication circuit is controlled by controlling the on-off of the power supply of the RS485 communication module through software setting, so that the communication circuit can switch and use the UART communication mode or the 485 communication mode, the inconvenience in operation is reduced, and the efficiency is improved.
According to an embodiment of the present invention, a communication control method for an electrical device corresponding to the electrical device is also provided, as shown in fig. 4, which is a schematic flow chart of an embodiment of the method of the present invention. The communication control method of the electrical equipment can comprise the following steps: step S110 to step S130.
In step S110, a first control signal (e.g., control signal Y) sent by the first control unit is received by the isolation unit, and the first control signal is isolated to obtain a first isolation control signal. The isolation control unit is further configured to receive a second control signal (such as the control signal X) sent by the first control unit, and perform isolation processing on the second control signal to obtain a second isolation control signal.
The first control unit (for example, the control unit 1) is a control unit of a first electrical device that needs to communicate. The first control signal is a control signal for selecting a communication mode of the communication circuit by controlling the on-off of the power supply of the communication unit. The second control signal is a control signal for controlling the operation of the communication unit. The communication mode of the communication circuit comprises the following steps: a first communication mode and a second communication mode. The first communication mode is a communication mode for performing communication by using a first communication function. The second communication mode is a communication mode for performing communication by using a second communication function. For example: the control signal Y is a control signal for controlling the selection of the UART communication mode or the 485 communication mode by the control unit 1, and the control signal X is a control signal for controlling the RS485 communication chip to work by the control unit 1.
In step S120, a switching unit switches a communication mode based on the first isolation control signal, so as to use one of the first communication mode and the second communication mode corresponding to the first control signal as a current communication mode, so that the first control unit can communicate with other control units according to the current communication mode. That is, the communication unit may perform communication mode switching based on the communication mode switching signal to use one of the first communication function and the second communication function corresponding to the first control signal as a current communication function, so that the first control unit may perform communication with other control units according to the current communication function. The other control unit is a control unit of other electrical equipment which needs to communicate with the control unit of the first electrical equipment.
In step S130, if the current communication mode is the second communication mode, the communication unit is in a power-on state, so as to implement communication between the first control unit and other control units according to the second communication mode and in combination with the second isolation control signal in the power-on state. And under the condition that the current communication mode is the first communication mode, the communication unit is in a power-off state, so that the first control unit can communicate with other control units without passing through the communication unit under the power-off state.
Therefore, the scheme of the invention provides the communication device, such as the communication circuit which can realize the selection of the UART communication mode and the 485 communication mode through software control, and can realize the switching of the UART communication mode and the 485 communication mode only through software setting, thereby greatly improving the compatibility and the universality of the mainboard of the electric appliance product. In addition, the inconvenience in operation is reduced, the efficiency is improved, and the problems that when the hardware of the whole machine is manually changed to switch the communication mode, the whole machine needs to be disassembled for operation, the operation is very inconvenient, and the efficiency is low can be solved.
In some embodiments, the communication unit comprises: 485 communication module. The 485 communication module comprises a 485 communication chip, namely an RS485 communication chip and a peripheral circuit thereof. Peripheral circuit of RS485 communication chip includes: a resistor R19, a resistor R20, a resistor R21, a resistor R22, a TVS tube D1 and a TVS tube D2. The DI pin of the RS485 communication chip is the input end of a driver of the RS485 communication chip, the RO pin of the RS485 communication chip is the output end of a receiver of the RS485 communication chip, the DE pin of the RS485 communication chip is the output enable end of the driver of the RS485 communication chip, the RE/pin of the RS485 communication chip is the output enable end of the receiver of the RS485 communication chip, and the A pin and the B pin of the RS485 communication chip are the output end of the driver of the RS485 communication chip or the input end of the receiver of the RS485 communication chip.
The first communication method includes: UART communication mode. The second communication method includes: 485 communication mode. For example: after the electrical equipment is powered on, the control unit 1 controls the output of the signal Y to be a high level or a low level according to actual needs, so as to select whether to use the UART communication mode or the 485 communication mode. The communication signal TX is a communication signal output by the control unit 1, the communication signal RX is a communication signal received by the communication unit 1, and the communication signals M and N are communication signals between the control unit 1 and other control units such as the control unit 2.
In step S130, the communication unit is in a power-on state when the current communication mode is the second communication mode, so that the communication between the first control unit and the other control units is realized in the power-on state according to the second communication mode and in combination with the second isolation control signal. Under the condition that the current communication mode is the first communication mode, the communication unit is in a power-off state, so that the first control unit can communicate with other control units without passing through the communication unit under the power-off state, wherein the communication state comprises any one of the following communication conditions:
the first communication scenario: and under the condition that the current communication mode is a UART communication mode, the first control signal is a signal with a first set level, the second control signal is a signal with a first set level or a second set level, and the communication circuit communicates according to the UART communication mode.
Second communication scenario: and under the condition that the current communication mode is a 485 communication mode, the first control signal is a signal of a second set level, and the communication circuit communicates in the 485 communication mode.
Under the 485 communication mode, when the second control signal is a signal of a first set level, the 485 communication module can realize first set 485 communication.
Under the 485 communication mode, when the second control signal is a second signal with a set level, the 485 communication module can realize second set 485 communication.
By using the example shown in fig. 3, in operation, after the electrical device is powered on, the control unit 1 controls the signal Y output to be a high level or a low level according to actual needs to select whether to use the UART communication mode or the 485 communication mode, which specifically includes the following steps:
step 1, when a UART communication mode is selected to be used:
when the control signal Y is low (no matter what level the control signal X is input), the bases of the transistor Q1, the transistor Q2, and the transistor Q3 will be changed from low to high. At this time, since the on voltage drop of the transistor inside the optocoupler is much smaller than 0.7V, the transistor Q3 is turned off when the control signal Y is input to a low level. The power supply pin of the RS485 communication chip Z1 is grounded to be at a low level, and the RS485 communication chip Z1 does not work.
The whole communication circuit, only part of the UART communication circuit is in operation at the moment.
Step 11, when the communication signal TX inputs a high level:
the collector of transistor Q2 changes from low to high. Since the collector of the transistor Q2 is at a low level, the base of the transistor Q2 is at a high level, and the emitter of the transistor Q2 is at a low level, the transistor Q2 will be turned on from off, the emitter of the transistor Q2 will be turned from low level to high level, and the output of the communication signal N will be turned from low level to high level. That is, the transistor Q2 will change from off to on due to the high level of the base of the transistor Q2 and the low level of the emitter of the transistor Q2.
When the communication signal TX is input low:
the collector of transistor Q2 changes from high to low. The transistor Q2 will be turned off, the emitter of the transistor Q2 will be changed from high to low, and the output of the communication signal N will be changed from high to low.
Thus, the communication signal TX input changes in high and low levels, which causes the communication signal N to also change in high and low levels, and the operation is repeated.
Step 12, when the communication signal M is input to a low level:
the collector of the transistor Q1 is low, the transistor Q1 is turned off, the emitter of the transistor Q1 is low, and the communication signal RX outputs low.
When the communication signal M is input to high level:
the collector of the transistor Q1 changes from low level to high level, because the base of the transistor Q1 is high level and the emitter of the transistor Q1 is low level when the collector of the transistor Q1 is low level, the transistor Q1 will change from cut-off to on, the emitter of the transistor Q1 will change from low level to high level, and the communication signal RX outputs high level. That is, the transistor Q1 will change from off to on due to the high level of the base of the transistor Q1 and the low level of the emitter of the transistor Q1. The collector of transistor Q2 will be described as low when the collector of transistor Q2 is low, which is the condition for conduction.
Thus, the communication signal RX also generates a corresponding high/low level change due to the high/low level change of the communication signal M input, and the operation is repeated.
And 2, when a 485 communication mode is selected:
when the control signal Y is input to high level, the base electrodes of the triode Q1, the triode Q2 and the triode Q3 are all low level at the moment, and the triode Q1 and the triode Q2 are kept to be cut off and are not conducted. Specifically, the transistor Q1 and the transistor Q2 are kept in the off state after the control signal Y is inputted with a high level. Because the base voltages of the transistor Q1 and the transistor Q2 are always 0 at this time. The triode Q3 is conducted, the power supply pin of the RS485 communication chip Z1 is electrified, and the RS485 communication chip Z1 starts to work.
The whole communication circuit, only the 485 communication circuit part is in operation.
Step 21, when the control signal X is input to low level:
the DE pin of the RS485 communication chip and the RE/pin of the RS485 communication chip are changed from low level to high level:
at this time, if the communication signal TX inputs a low level, the DI pin of the RS485 communication chip is at a low level.
At this time, if the communication signal TX inputs a high level, the DI pin of the RS485 communication chip changes from a low level to a high level.
Along with the high-low level change of the DI pin of the RS485 communication chip, the pin A of the RS485 communication chip and the pin B of the RS485 communication chip respectively output a voltage signal meeting a certain 485 communication logic relationship.
Step 22, when the control signal X is input to a high level:
the DE pin of the RS485 communication chip and the RE/pin of the RS485 communication chip are low levels:
at this time, if the voltage of the pin a of the RS485 communication chip is higher than the voltage of the pin B of the RS485 communication chip by more than the first set voltage value u1, the pin RO of the RS485 communication chip will output a high level, and the communication signal RX will change from the output low level to the high level.
At this time, if the voltage of the a pin of the RS485 communication chip is lower than the voltage of the BRS485 communication chip by more than the first set voltage value u1, the output at the RO of the RS485 communication chip will be changed from high level to low level, and the communication signal RX will be changed from high level to low level.
Therefore, when the control signal X is input to a high level, the voltage difference between the pin A of the RS485 communication chip and the pin B of the RS485 communication chip changes, so that the communication signal RX also generates corresponding high and low level changes, and the operation is repeatedly circulated.
Therefore, the UART communication mode or the 485 communication mode can be selected by software, and the circuit can normally carry out UART communication or 485 communication.
Therefore, the current communication mode can be selected to be the UART communication mode or the 485 communication mode through the first control signal. Through the second control signal, the work of the 485 communication module can be controlled. Therefore, the UART communication mode or the 485 communication mode is selected by software, and the circuit can normally carry out UART communication or 485 communication.
Since the processes and functions implemented by the method of the present embodiment substantially correspond to the embodiments, principles, and examples of the electrical apparatus, reference may be made to the related descriptions in the foregoing embodiments without being detailed in the description of the present embodiment.
Through a large number of tests, the technical scheme of the embodiment is adopted, the isolation circuit, the conversion circuit and the RS485 communication module are utilized, the communication circuit with the UART communication function and the 485 communication function and capable of switching between the UART communication mode and the 485 communication mode is arranged, when the control unit of the electrical equipment selects the communication mode, the communication circuit is controlled by controlling the on-off of the power supply of the RS485 communication module through software setting, so that the communication circuit can switch between the UART communication mode and the 485 communication mode, the UART communication mode and the 485 communication mode can be selectively used through software switching, the compatibility and the universality of a mainboard of the electrical equipment are greatly improved, and the replacement cost of devices is also saved.
In summary, it is readily understood by those skilled in the art that the advantageous modes described above can be freely combined and superimposed without conflict.
The above description is only an example of the present invention, and is not intended to limit the present invention, and it is obvious to those skilled in the art that various modifications and variations can be made in the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.

Claims (9)

1. A communication device, comprising: the system comprises an isolation unit, a conversion unit and a communication unit; the isolation unit, the conversion unit and the communication unit can form a communication circuit which has a first communication function and a second communication function and can be used for switching the first communication function and the second communication function; in the communication circuit:
the isolation unit is configured to receive a first control signal sent by a first control unit, and perform isolation processing on the first control signal to obtain a first isolation control signal; the first control unit is configured to receive a first control signal sent by the first control unit, and perform isolation processing on the first control signal to obtain a first isolation control signal;
the first control unit is a control unit of first electrical equipment needing communication; the first control signal is a control signal for selecting a communication mode of the communication circuit by controlling the on-off of the power supply of the communication unit; the second control signal is a control signal for controlling the communication unit to work; the communication mode of the communication circuit comprises the following steps: a first communication mode and a second communication mode; the first communication mode is a communication mode for communicating by utilizing a first communication function; the second communication mode is a communication mode for communicating by utilizing a second communication function;
the conversion unit is configured to perform communication mode conversion based on the first isolation control signal, so that one of the first communication mode and the second communication mode corresponding to the first control signal is used as a current communication mode, and the first control unit can perform communication with other control units according to the current communication mode;
the communication unit is configured to be in a power-off state when the current communication mode is the first communication mode, and to communicate with other control units according to the first communication mode in the power-off state; and under the condition that the current communication mode is the second communication mode, the communication unit is in a power-on state, so that under the power-on state, the communication between the first control unit and other control units is realized according to the second communication mode and in combination with the second isolation control signal.
2. The communication device of claim 1, wherein the isolation unit comprises: a first isolation module and a second isolation module;
the conversion unit includes: the device comprises a first conversion module, a second conversion module and a third conversion module;
wherein the content of the first and second substances,
the first isolation module is arranged among the input end of the first control signal, the control end of the first conversion module, the control end of the second conversion module and the control end of the third conversion module; the output end of the first conversion module is connected to one connecting end of the driver output end and the receiver input end of the communication module; the output end of the second conversion module is connected to the other connecting end of the driver output end and the receiver input end of the communication unit; the output end of the third conversion module is connected to the power supply end of the communication unit;
the second isolation module is arranged between the input end of the second control signal and the driver output enabling end and the receiver enabling output end of the communication unit.
3. The communication device of claim 2, wherein the first isolation module comprises: a first optocoupler module; the second isolation module comprising: a second optocoupler module;
the first conversion module includes: a first switch tube module; a second conversion module comprising: a second switch tube module; a third conversion module comprising: a third switch tube module;
wherein the content of the first and second substances,
a cathode on a diode side of the first optical coupling module is used as an input end of the first optical coupling module and is connected to an input end of the first control signal; an emitter at the transistor side of the first optical coupling module is used as an output end of the first optical coupling module;
a cathode on a diode side of the second optical coupling module is used as an input end of the second optical coupling module and is connected to an input end of the second control signal; an emitter at the transistor side of the second optical coupling module is used as an output end of the second optical coupling module;
the base electrode of the first switch tube module is used as a control end of the first switch tube module; the collector of the first switch tube module is used as the output end of the first switch tube module;
the base electrode of the second switch tube module is used as the control end of the second switch tube module; the emitting electrode of the second switch tube module is used as the output end of the second switch tube module;
the base of the third switch tube module is used as the control end of the third switch tube module; and the collector of the third switch tube module is used as the output end of the third switch tube module.
4. The communication device according to claim 2 or 3, wherein the isolation unit further comprises: a third isolation module and a fourth isolation module;
wherein the content of the first and second substances,
the third isolation module is arranged between the signal receiving end of the first control unit and the receiver output end of the communication unit;
and the fourth isolation module is arranged between the signal sending end of the first control unit and the receiver output end of the communication unit.
5. The communication device of claim 4, wherein the third isolation module comprises: a third optical coupling module; the fourth isolation module, comprising: a fourth optical coupling module;
wherein the content of the first and second substances,
an emitter at the transistor side of the third optical coupling module is used as an input end of the third optical coupling module; an anode on the diode side of the third optocoupler module is used as an output end of the third optocoupler module;
and the anode at the diode side of the fourth optical coupling module is used as the input end of the fourth optical coupling module.
6. The communication device according to any one of claims 1 to 3 and 5, wherein the communication unit comprises: 485 communication module;
the first communication method includes: UART communication mode; the second communication method includes: 485 communication mode;
the communication unit is in a power-on state under the condition that the current communication mode is the second communication mode, so that the communication between the first control unit and other control units is realized according to the second communication mode and the second isolation control signal under the power-on state; under the condition that the current communication mode is the first communication mode, the communication unit is in a power-off state so as to communicate with other control units under the power-off state, and the communication method comprises the following steps:
under the condition that the current communication mode is a UART communication mode, the first control signal is a signal with a first set level, and the communication circuit communicates according to the UART communication mode;
under the condition that the current communication mode is a 485 communication mode, the first control signal is a signal of a second set level, and the communication circuit communicates in the 485 communication mode;
wherein the content of the first and second substances,
in the 485 communication mode, when the second control signal is a signal of a first set level, the 485 communication module can realize first set 485 communication;
under the 485 communication mode, when the second control signal is a second signal with a set level, the 485 communication module can realize second set 485 communication.
7. An electrical device, comprising: the communication device of any one of claims 1 to 6.
8. A communication control method of an electric appliance according to claim 7, comprising:
receiving a first control signal sent by a first control unit through an isolation unit, and carrying out isolation processing on the first control signal to obtain a first isolation control signal; the first control unit is configured to receive a first control signal sent by the first control unit, and perform isolation processing on the first control signal to obtain a first isolation control signal;
the first control unit is a control unit of first electrical equipment needing communication; the first control signal is a control signal for selecting a communication mode of the communication circuit by controlling the on-off of the power supply of the communication unit; the second control signal is a control signal for controlling the communication unit to work; the communication mode of the communication circuit comprises the following steps: a first communication mode and a second communication mode; the first communication mode is a communication mode for communicating by utilizing a first communication function; the second communication mode is a communication mode for communicating by utilizing a second communication function;
switching a communication mode based on the first isolation control signal through a switching unit to use one of the first communication mode and the second communication mode corresponding to the first control signal as a current communication mode so that the first control unit can communicate with other control units according to the current communication mode;
through a communication unit, under the condition that the current communication mode is the first communication mode, the communication unit is in a power-off state so as to communicate with other control units under the power-off state; and under the condition that the current communication mode is the second communication mode, the communication unit is in a power-on state, so that under the power-on state, the communication between the first control unit and other control units is realized according to the second communication mode and in combination with the second isolation control signal.
9. The communication control method of an electric appliance according to claim 8, wherein the communication unit includes: 485 communication module;
the first communication method includes: UART communication mode; the second communication method includes: 485 communication mode;
through the communication unit, under the condition that the current communication mode is the second communication mode, the communication unit is in a power-on state, so that under the power-on state, the communication between the first control unit and other control units is realized according to the second communication mode and in combination with the second isolation control signal; under the condition that the current communication mode is the first communication mode, the communication unit is in a power-off state so as to communicate with other control units under the power-off state, and the communication method comprises the following steps:
under the condition that the current communication mode is a UART communication mode, the first control signal is a signal with a first set level, and the communication circuit communicates according to the UART communication mode;
under the condition that the current communication mode is a 485 communication mode, the first control signal is a signal of a second set level, and the communication circuit communicates in the 485 communication mode;
wherein the content of the first and second substances,
in the 485 communication mode, when the second control signal is a signal of a first set level, the 485 communication module can realize first set 485 communication;
under the 485 communication mode, when the second control signal is a second signal with a set level, the 485 communication module can realize second set 485 communication.
CN202110523658.0A 2021-05-13 2021-05-13 Communication device, electrical equipment and communication control method thereof Pending CN113282035A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110523658.0A CN113282035A (en) 2021-05-13 2021-05-13 Communication device, electrical equipment and communication control method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110523658.0A CN113282035A (en) 2021-05-13 2021-05-13 Communication device, electrical equipment and communication control method thereof

Publications (1)

Publication Number Publication Date
CN113282035A true CN113282035A (en) 2021-08-20

Family

ID=77278776

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110523658.0A Pending CN113282035A (en) 2021-05-13 2021-05-13 Communication device, electrical equipment and communication control method thereof

Country Status (1)

Country Link
CN (1) CN113282035A (en)

Similar Documents

Publication Publication Date Title
US20130181660A1 (en) Charge control circuit for usb device
US7359433B1 (en) Data transmission system
CN101820314B (en) Single-line bidirectional communication optical coupling isolation circuit
CN113606761A (en) Current loop communication circuit and air conditioner
CN214954605U (en) Communication device and electrical equipment
CN113282035A (en) Communication device, electrical equipment and communication control method thereof
CN215067796U (en) Communication device and electrical equipment
CN111976415B (en) Outdoor unit electric control device and vehicle-mounted air conditioner
CN113341790A (en) Communication device, electrical equipment and communication control method thereof
CN107888183B (en) NPN/PNP sensor access device in low-voltage system
CN215581226U (en) Exchanger capable of customizing protocol line sequence
CN217037179U (en) Communication circuit and communication board
CN106372025B (en) Bus type communicating circuit
CN213304962U (en) DALI signal power supply protection circuit
CN204442329U (en) A kind of mechanical switch remote-control module and intelligent switch
CN101626201B (en) Switch power supply circuit
CN212289727U (en) Vehicle power-on and power-off control circuit
CN109960677B (en) Extension circuit for USB interface
CN207460126U (en) A kind of switching circuit carried out through same interface signal input and output
CN217880548U (en) Circuit device for realizing infrared remote control receiving function through RS232 serial port
CN215412412U (en) Variable frequency air conditioner and communication device thereof
CN217335574U (en) Communication circuit and equipment
CN106888396B (en) Separated television control circuit and method and separated television
CN216599583U (en) Communication circuit, electronic equipment and communication system
CN219891316U (en) Multifunctional input and output port of electric energy meter

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination