Control circuit and method for multi-chip microcomputer communication, and electronic equipment
By designing a control circuit for multi-microcontrollers, using voltage control circuits to reduce the power supply, and optimizing the data transmission mode through communication control circuits, the problem of multiple lines and low efficiency in traditional communication methods is solved, and efficient and low-cost communication is achieved Effect.
Patent Information
- Application Number
- CN202411496422.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-10-25
AI Technical Summary
The communication methods between traditional microcontrollers use many communication lines, complex circuits, high costs, and components interfere with each other, reducing communication efficiency and easily affecting the communication effect.
A control circuit for multi-sized microcontroller communication is designed, including a communication control circuit and a voltage control circuit, which is powered by a voltage control circuit. The communication control circuit controls the data transmission mode according to the state of the data transmission terminal to reduce communication lines.
It has achieved the reduction of communication lines between microcontrollers, improved communication efficiency, improved communication effect, simplified circuit structure, and reduced costs.
Smart Images

Figure CN119002382B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication control technology, and in particular to a control circuit and method and electronic equipment for multi-chip microcomputer communication. Background Art
[0002] Currently, two microcontrollers usually communicate through four lines: power line, ground line, clock line and data line.
[0003] However, practice has found that the traditional communication method between two single-chip microcomputers uses more communication lines, more complex circuits, and higher costs. The components on the circuit will interfere with each other, reduce the communication efficiency between single-chip microcomputers, and easily affect the communication effect. It can be seen that it is particularly important to propose a technical solution to reduce the communication lines used between single-chip microcomputers to improve communication efficiency. Summary of the invention
[0004] The present invention provides a control circuit and method and electronic equipment for multi-chip microcomputer communication, which can reduce the communication lines used between the single-chip microcomputers, thereby improving the communication efficiency and the communication effect.
[0005] In order to solve the above technical problems, the first aspect of the present invention discloses a control circuit for multi-chip microcomputer communication, the control circuit comprising a communication control circuit and a voltage control circuit, wherein:
[0006] The voltage input terminal of the voltage control circuit and the common terminal of the communication control circuit are both used to electrically connect to a power supply, the voltage output terminal of the voltage control circuit is used to electrically connect to the voltage input terminal of the first single-chip microcomputer and the voltage input terminal of the second single-chip microcomputer, all the communication terminals included in the communication control circuit are used to electrically connect to the corresponding data transmission terminals of the first single-chip microcomputer and the corresponding data transmission terminals of the second single-chip microcomputer, each of the data transmission terminals includes a data output terminal or a data input terminal, and the common terminal is a port shared by power supply and signal;
[0007] The voltage control circuit is used to step down the first power supply voltage received from the power supply to obtain a second power supply voltage, and provide the second power supply voltage to the first single-chip microcomputer and the second single-chip microcomputer, so that the first single-chip microcomputer and the second single-chip microcomputer work;
[0008] The communication control circuit is used to determine the states of all the communication terminals of the communication control circuit according to the data transmission terminals to which all the communication terminals of the communication control circuit are connected under the control of the first single-chip microcomputer and the second single-chip microcomputer; and control the data transmission mode of the first single-chip microcomputer and the data transmission mode of the second single-chip microcomputer according to the states of all the communication terminals of the communication control circuit;
[0009] Wherein, when the first communication terminal of the communication control circuit is electrically connected to the data output terminal of the first single-chip microcomputer and the second communication terminal of the communication control circuit is electrically connected to the data input terminal of the second single-chip microcomputer, the state of the first communication terminal is an output state, the state of the second communication terminal is an input state, the first single-chip microcomputer is in a data sending mode, and the second single-chip microcomputer is in a data receiving mode; when the third communication terminal of the communication control circuit is electrically connected to the data input terminal of the first single-chip microcomputer and the fourth communication terminal of the communication control circuit is electrically connected to the data output terminal of the second single-chip microcomputer, the state of the third communication terminal is an input state, the state of the fourth communication terminal is an output state, the first single-chip microcomputer is in a data receiving mode, and the second single-chip microcomputer is in a data sending mode;
[0010] The communication control circuit is also used to transmit the data sent by the data output terminal of the first single-chip microcomputer to the second single-chip microcomputer via the communication control circuit when the state of the first communication terminal is the output state and the state of the second communication terminal is the input state; and when the state of the third communication terminal is the input state and the state of the fourth communication terminal is the output state, transmit the data sent by the data output terminal of the second single-chip microcomputer to the first single-chip microcomputer via the communication control circuit.
[0011] As an optional implementation, in the first aspect of the present invention, the communication control circuit includes a first communication control module and a second communication control module, wherein:
[0012] The common end of the first communication control module is electrically connected to the common end of the second communication control module, the voltage input end of the voltage control circuit and the power supply. The first communication end of the first communication control module is used to electrically connect to the data output end of the first single-chip microcomputer, the second communication end of the first communication control module is used to electrically connect to the data input end of the first single-chip microcomputer, the first communication end of the second communication control module is used to electrically connect to the data output end of the second single-chip microcomputer, and the second communication end of the second communication control module is used to electrically connect to the data input end of the second single-chip microcomputer.
[0013] As an optional implementation, in the first aspect of the present invention, the first communication control module includes a first switch device, a first resistor and a second resistor, wherein:
[0014] The first pole of the first switching device is electrically connected to one end of the first resistor, and the second pole of the first switching device is electrically connected to one end of the second resistor, the common end of the second communication control module, the voltage input end of the voltage control circuit and the power supply. The other end of the first resistor is used to electrically connect to the data output end of the first single-chip microcomputer, and the other end of the second resistor is used to electrically connect to the data input end of the first single-chip microcomputer. The third pole of the first switching device is used for grounding.
[0015] As an optional implementation, in the first aspect of the present invention, the second communication control module includes a second switch device, a third resistor and a fourth resistor, wherein:
[0016] The first pole of the second switching device is electrically connected to one end of the third resistor, and the second pole of the second switching device is electrically connected to one end of the fourth resistor, the second pole of the first switching device, the voltage input end of the voltage control circuit and the power supply. The other end of the third resistor is used to electrically connect to the data output end of the second single-chip microcomputer, the other end of the fourth resistor is used to electrically connect to the data input end of the second single-chip microcomputer, and the third pole of the second switching device is used to be grounded.
[0017] As an optional implementation, in the first aspect of the present invention, the voltage control circuit includes a voltage stabilizer, a first capacitor and a second capacitor, wherein:
[0018] The voltage input end of the voltage regulator is electrically connected to one end of the first capacitor, the second pole of the first switching device included in the first communication control module, the second pole of the second switching device included in the second communication control module and the power supply; the voltage output end of the voltage regulator is used to electrically connect one end of the second capacitor, the voltage input end of the first single-chip microcomputer and the voltage input end of the second single-chip microcomputer; the ground end of the voltage regulator, the other end of the first capacitor and the other end of the second capacitor are all used for grounding.
[0019] As an optional implementation, in the first aspect of the present invention, the voltage control circuit further includes a clamping element, wherein:
[0020] The first electrode of the clamping element is electrically connected to the second electrode of the first switching device, the second electrode of the second switching device and the power supply, and the second electrode of the clamping element is electrically connected to the voltage input terminal of the regulator and one end of the first capacitor;
[0021] The clamping element is used to clamp the voltage output by the second pole of the first switching device and / or the voltage output by the second pole of the second switching device.
[0022] As an optional implementation, in the first aspect of the present invention, the control circuit further includes a voltage division module, wherein:
[0023] The first end of the voltage divider module is electrically connected to the second pole of the first switch device, the second pole of the second switch device and the first pole of the clamping element, and the second end of the voltage divider module is used to electrically connect to the power supply;
[0024] The voltage dividing module is used to divide the voltage of the second electrode of the first switching device and the second electrode of the second switching device.
[0025] The second aspect of the present invention discloses a control method for multi-microcontroller communication, the method is applied to a control circuit for multi-microcontroller communication, wherein the control circuit includes a communication control circuit and a voltage control circuit, wherein the voltage input terminal of the voltage control circuit and the common terminal of the communication control circuit are both used to electrically connect to a power supply, the voltage output terminal of the voltage control circuit is used to electrically connect to the voltage input terminal of a first microcontroller and the voltage input terminal of a second microcontroller, all communication terminals included in the communication control circuit are used to electrically connect to the corresponding data transmission terminal of the first microcontroller and the corresponding data transmission terminal of the second microcontroller, each of the data transmission terminals includes a data output terminal or a data input terminal, and the common terminal is a port shared by a power supply and a signal; the method includes:
[0026] The voltage control circuit steps down the first power supply voltage received from the power supply to obtain a second power supply voltage, and provides the second power supply voltage to the first single-chip microcomputer and the second single-chip microcomputer, so that the first single-chip microcomputer and the second single-chip microcomputer operate;
[0027] The communication control circuit, under the control of the first single-chip microcomputer and the second single-chip microcomputer, determines the states of all the communication terminals of the communication control circuit according to the data transmission terminals to which all the communication terminals of the communication control circuit are connected; and controls the data transmission mode of the first single-chip microcomputer and the data transmission mode of the second single-chip microcomputer according to the states of all the communication terminals of the communication control circuit;
[0028] When the state of the first communication terminal is an output state and the state of the second communication terminal is an input state, the communication control circuit transmits the data sent by the data output terminal of the first single-chip microcomputer to the second single-chip microcomputer via the communication control circuit;
[0029] When the state of the third communication terminal is an input state and the state of the fourth communication terminal is an output state, the communication control circuit transmits the data sent by the data output terminal of the second single-chip microcomputer to the first single-chip microcomputer via the communication control circuit.
[0030] As an optional implementation, in the second aspect of the present invention, when the first communication terminal of the communication control circuit is electrically connected to the data output terminal of the first single-chip microcomputer and the second communication terminal of the communication control circuit is electrically connected to the data input terminal of the second single-chip microcomputer, the state of the first communication terminal is an output state, the state of the second communication terminal is an input state, the first single-chip microcomputer is in a data sending mode, and the second single-chip microcomputer is in a data receiving mode;
[0031] When the third communication terminal of the communication control circuit is electrically connected to the data input terminal of the first single-chip microcomputer and the fourth communication terminal of the communication control circuit is electrically connected to the data output terminal of the second single-chip microcomputer, the state of the third communication terminal is an input state, the state of the fourth communication terminal is an output state, the first single-chip microcomputer is in a data receiving mode, and the second single-chip microcomputer is in a data sending mode.
[0032] As an optional embodiment, in the second aspect of the present invention, the communication control circuit includes a first communication control module and a second communication control module, wherein the common end of the first communication control module is electrically connected to the common end of the second communication control module, the voltage input end of the voltage control circuit and the power supply, the first communication end of the first communication control module is used to electrically connect to the data output end of the first single-chip microcomputer, the second communication end of the first communication control module is used to electrically connect to the data input end of the first single-chip microcomputer, the first communication end of the second communication control module is used to electrically connect to the data output end of the second single-chip microcomputer, and the second communication end of the second communication control module is used to electrically connect to the data input end of the second single-chip microcomputer.
[0033] As an optional embodiment, in the second aspect of the present invention, the first communication control module includes a first switching device, a first resistor and a second resistor, wherein the first pole of the first switching device is electrically connected to one end of the first resistor, and the second pole of the first switching device is electrically connected to one end of the second resistor, the common end of the second communication control module, the voltage input end of the voltage control circuit and the power supply, the other end of the first resistor is used to electrically connect to the data output end of the first single-chip microcomputer, the other end of the second resistor is used to electrically connect to the data input end of the first single-chip microcomputer, and the third pole of the first switching device is used to be grounded.
[0034] As an optional embodiment, in the second aspect of the present invention, the second communication control module includes a second switching device, a third resistor and a fourth resistor, wherein the first pole of the second switching device is electrically connected to one end of the third resistor, and the second pole of the second switching device is electrically connected to one end of the fourth resistor, the second pole of the first switching device, the voltage input end of the voltage control circuit and the power supply, the other end of the third resistor is used to electrically connect to the data output end of the second single-chip microcomputer, the other end of the fourth resistor is used to electrically connect to the data input end of the second single-chip microcomputer, and the third pole of the second switching device is used to be grounded.
[0035] As an optional embodiment, in the second aspect of the present invention, the voltage control circuit includes a voltage stabilizer, a first capacitor and a second capacitor, wherein the voltage input terminal of the voltage stabilizer is electrically connected to one end of the first capacitor, the second pole of the first switching device included in the first communication control module, the second pole of the second switching device included in the second communication control module and the power supply, the voltage output terminal of the voltage stabilizer is used to electrically connect one end of the second capacitor, the voltage input terminal of the first single-chip microcomputer and the voltage input terminal of the second single-chip microcomputer, and the ground terminal of the voltage stabilizer, the other end of the first capacitor and the other end of the second capacitor are all used for grounding.
[0036] As an optional implementation, in the second aspect of the present invention, the voltage control circuit further includes a clamping element, wherein a first electrode of the clamping element is electrically connected to a second electrode of the first switching device, a second electrode of the second switching device and the power supply, and a second electrode of the clamping element is electrically connected to a voltage input terminal of the regulator and one end of the first capacitor; the method further includes:
[0037] The clamping element clamps a voltage output by the second electrode of the first switching device and / or a voltage output by the second electrode of the second switching device.
[0038] As an optional implementation, in the second aspect of the present invention, the control circuit further includes a voltage divider module, wherein a first end of the voltage divider module is electrically connected to a second pole of the first switching device, a second pole of the second switching device and a first pole of the clamping element, and a second end of the voltage divider module is used to electrically connect to the power supply; the method further includes:
[0039] The voltage dividing module divides the voltage of the second electrode of the first switching device and the second electrode of the second switching device.
[0040] The third aspect of the present invention discloses an electronic device, which includes a device body, and the electronic device also includes the control circuit for multi-chip microcomputer communication disclosed in the first aspect of the present invention.
[0041] The implementation of the present invention has the following beneficial effects:
[0042] The present invention provides a control circuit for multi-microcontroller communication, the control circuit comprising a communication control circuit and a voltage control circuit, wherein the voltage input terminal of the voltage control circuit and the common terminal of the communication control circuit are both used to electrically connect to a power supply, the voltage output terminal of the voltage control circuit is used to electrically connect to the voltage input terminal of a first microcontroller and the voltage input terminal of a second microcontroller, all communication terminals included in the communication control circuit are used to electrically connect to the corresponding data transmission terminals of the first microcontroller and the corresponding data transmission terminals of the second microcontroller, each data transmission terminal comprises a data output terminal or a data input terminal, and the common terminal is a port shared by a power supply and a signal; the voltage control circuit is used to step down a first power supply voltage received from a power supply to obtain a second power supply voltage, and provide the second power supply voltage to the first microcontroller and the second microcontroller, so that the first microcontroller and the second microcontroller work; the communication control circuit is used to determine the states of all communication terminals of the communication control circuit according to the data transmission terminals to which all communication terminals of the communication control circuit are connected; and according to the states of all communication terminals of the communication control circuit, control the data transmission mode of the first microcontroller and the second microcontroller A data transmission mode of a single-chip microcomputer; wherein, when the first communication terminal of the communication control circuit is electrically connected to the data output terminal of the first single-chip microcomputer and the second communication terminal of the communication control circuit is electrically connected to the data input terminal of the second single-chip microcomputer, the state of the first communication terminal is an output state, the state of the second communication terminal is an input state, the first single-chip microcomputer is in a data sending mode, and the second single-chip microcomputer is in a data receiving mode; when the third communication terminal of the communication control circuit is electrically connected to the data input terminal of the first single-chip microcomputer and the fourth communication terminal of the communication control circuit is electrically connected to the data output terminal of the second single-chip microcomputer, the state of the third communication terminal is an input state, the state of the fourth communication terminal is an output state, the first single-chip microcomputer is in a data receiving mode, and the second single-chip microcomputer is in a data sending mode; the communication control circuit is also used for transmitting the data sent by the data output terminal of the first single-chip microcomputer to the second single-chip microcomputer via the communication control circuit when the state of the first communication terminal is an output state and the state of the second communication terminal is an input state; and when the state of the third communication terminal is an input state and the state of the fourth communication terminal is an output state, transmitting the data sent by the data output terminal of the second single-chip microcomputer to the first single-chip microcomputer via the communication control circuit.It can be seen that the present invention can accurately provide the second power supply voltage obtained by stepping down the first power supply voltage to the first single-chip microcomputer and the second single-chip microcomputer through the voltage control circuit, thereby triggering the first single-chip microcomputer and the second single-chip microcomputer to work normally, and can more accurately determine the states of all communication terminals of the communication control circuit according to the data transmission terminals to which all communication terminals are connected under the control of all single-chip microcomputers through the communication control circuit, which is conducive to improving the accuracy and efficiency of determining the states of the communication terminals, and more accurately controlling the data transmission modes of all single-chip microcomputers according to the accurately determined states of all communication terminals, which is conducive to improving the accuracy and efficiency of the communication control circuit's control over the data transmission mode, and can reduce the communication lines used between single-chip microcomputers by setting a control circuit that integrates the voltage control circuit and the communication control circuit, thereby helping to shorten the communication time between single-chip microcomputers, improve communication efficiency, and enhance communication effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0044] Figure 1 It is a structural schematic diagram of a control circuit for multi-chip microcomputer communication disclosed in an embodiment of the present invention;
[0045] Figure 2 It is a structural schematic diagram of another control circuit for multi-chip microcomputer communication disclosed in an embodiment of the present invention;
[0046] Figure 3 It is a structural schematic diagram of another control circuit for multi-MCU communication disclosed in an embodiment of the present invention;
[0047] Figure 4 It is a structural schematic diagram of another control circuit for multi-MCU communication disclosed in an embodiment of the present invention;
[0048] Figure 5 It is a flow chart of a control method for multi-MCU communication disclosed in an embodiment of the present invention;
[0049] Figure 6 It is a flow chart of another control method for multi-MCU communication disclosed in an embodiment of the present invention;
[0050] Figure 7 It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present invention. DETAILED DESCRIPTION
[0051] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0052] It should be noted that, unless otherwise clearly specified and limited, the term "electrical connection" in the specification and claims of the present invention and the above-mentioned drawings should be understood in a broad sense. For example, it can be a fixed electrical connection, a detachable electrical connection, or an integral electrical connection; it can be a mechanical electrical connection, an electrical electrical connection, or mutual communication; it can be a direct connection, or an indirect connection through an intermediate medium, and it can be the internal connection of two elements or the interaction relationship between two elements.
[0053] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product or end including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or ends.
[0054] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0055] The present invention discloses a control circuit and method for multi-chip microcomputer communication, and an electronic device, which can accurately provide a second power supply voltage obtained by stepping down a first power supply voltage to a first single-chip microcomputer and a second single-chip microcomputer through a voltage control circuit, thereby triggering the first single-chip microcomputer and the second single-chip microcomputer to work normally, and can more accurately determine the state of all communication terminals of the communication control circuit according to the data transmission terminals connected to all communication terminals under the control of all single-chip microcomputers through a communication control circuit, which is conducive to improving the accuracy and efficiency of determining the state of the communication terminal, and more accurately controlling the data transmission mode of all single-chip microcomputers according to the accurately determined state of all communication terminals, which is conducive to improving the control accuracy and efficiency of the communication control circuit on the data transmission mode, and can reduce the communication lines used between single-chip microcomputers by setting a control circuit that integrates a voltage control circuit and a communication control circuit, thereby shortening the communication time between single-chip microcomputers, improving communication efficiency, and improving communication effects. The following are detailed descriptions.
[0056] Embodiment 1
[0057] See also Figure 1 , Figure 1 1 is a schematic diagram of a control circuit for multi-MCU communication disclosed in an embodiment of the present invention. Figure 1 The control circuit for multi-MCU communication described above can be applied to any electronic device that needs to communicate, such as: a smart home device integrated with multiple MCUs (such as a smart hanging iron), or a smart home device integrated with at least one MCU and a smart control device integrated with at least one MCU (the smart control device can be used to control the smart home device, and the smart control device can include a smart terminal, a smart remote control, etc.), etc., and the embodiments of the present invention are not limited. Figure 1 As shown, the control circuit for multi-MCU communication may include a communication control circuit 101 and a voltage control circuit 102, wherein:
[0058] The voltage input terminal of the voltage control circuit 102 and the common terminal of the communication control circuit 101 are used to electrically connect to a power supply, the voltage output terminal of the voltage control circuit 102 is used to electrically connect to the voltage input terminal of the first single-chip microcomputer and the voltage input terminal of the second single-chip microcomputer, and all the communication terminals included in the communication control circuit 101 are used to electrically connect to the corresponding data transmission terminals of the first single-chip microcomputer and the corresponding data transmission terminals of the second single-chip microcomputer;
[0059] The voltage control circuit 102 is used to step down the first power supply voltage received from the power supply to obtain a second power supply voltage, and provide the second power supply voltage to the first single-chip microcomputer and the second single-chip microcomputer, so that the first single-chip microcomputer and the second single-chip microcomputer work;
[0060] The communication control circuit 101 is used to determine the status of all communication terminals of the communication control circuit 101 according to the data transmission terminals to which all communication terminals of the communication control circuit 101 are connected under the control of the first single-chip microcomputer and the second single-chip microcomputer; and control the data transmission mode of the first single-chip microcomputer and the data transmission mode of the second single-chip microcomputer according to the status of all communication terminals of the communication control circuit 101;
[0061] Among them, when the first communication terminal of the communication control circuit 101 is electrically connected to the data output terminal of the first single-chip microcomputer and the second communication terminal of the communication control circuit 101 is electrically connected to the data input terminal of the second single-chip microcomputer, the state of the first communication terminal is the output state, the state of the second communication terminal is the input state, the first single-chip microcomputer is in the data sending mode, and the second single-chip microcomputer is in the data receiving mode; when the third communication terminal of the communication control circuit 101 is electrically connected to the data input terminal of the first single-chip microcomputer and the fourth communication terminal of the communication control circuit 101 is electrically connected to the data output terminal of the second single-chip microcomputer, the state of the third communication terminal is the input state, the state of the fourth communication terminal is the output state, the first single-chip microcomputer is in the data receiving mode, and the second single-chip microcomputer is in the data sending mode;
[0062] The communication control circuit 101 is also used to transmit the data sent by the data output terminal of the first single-chip microcomputer to the second single-chip microcomputer via the communication control circuit 101 when the state of the first communication terminal is the output state and the state of the second communication terminal is the input state; and when the state of the third communication terminal is the input state and the state of the fourth communication terminal is the output state, transmit the data sent by the data output terminal of the second single-chip microcomputer to the first single-chip microcomputer via the communication control circuit 101.
[0063] In an embodiment of the present invention, each of the data transmission terminals may include a data output terminal or a data input terminal, and the common terminal is a port shared by power supply and signal. The state of each communication terminal may include an input state or an output state, and the data transmission mode of each single-chip microcomputer in the first single-chip microcomputer and the second single-chip microcomputer may include a data receiving mode or a data sending mode. When the first single-chip microcomputer is in the data receiving mode, the second single-chip microcomputer is in the data sending mode; when the first single-chip microcomputer is in the data sending mode, the second single-chip microcomputer is in the data receiving mode.
[0064] In the embodiment of the present invention, optionally, the first power supply voltage may be 12 volts, and the second power supply voltage may be 5 volts or 3 volts, which is not limited in the embodiment of the present invention.
[0065] Exemplarily, after the control circuit for multi-MCU communication is powered on, the first power supply voltage from the power supply is stepped down by the voltage control circuit 102 to obtain the second power supply voltage, and the second power supply voltage is provided to the first MCU and the second MCU, thereby triggering the first MCU to set the first communication terminal of the communication control circuit 101 to the output state through the data output terminal of the first MCU, and triggering the second MCU to set the second communication terminal of the communication control circuit 101 to the input state through the data input terminal of the second MCU. At this time, the first MCU enters the data sending mode, and the first MCU updates the data and sends the data to the second MCU through the communication control circuit 101. After the data is sent, the first MCU enters the data receiving mode (at this time, the first MCU sets the third communication terminal of the communication control circuit 101 to the input state through the data input terminal of the first MCU), and prepares to receive the data returned by the second MCU;
[0066] When the data input terminal of the second single-chip microcomputer receives the data from the first single-chip microcomputer, the second single-chip microcomputer processes and updates the system state of the second single-chip microcomputer, and then triggers the second single-chip microcomputer to set the fourth communication terminal of the communication control circuit 101 to the output state through the data output terminal of the second single-chip microcomputer. At this time, the second single-chip microcomputer enters the data sending mode, and the second single-chip microcomputer updates the data and sends the data to the first single-chip microcomputer through the communication control circuit 101. After sending the data, the second single-chip microcomputer enters the data receiving mode and waits to receive the data returned by the first single-chip microcomputer;
[0067] When the data input terminal of the first single chip microcomputer receives the data from the second single chip microcomputer, the first single chip microcomputer is triggered to execute the above-mentioned operation of setting the first communication terminal of the communication control circuit 101 to an output state through the data output terminal of the first single chip microcomputer.
[0068] It can be seen that implementation Figure 1The control circuit for multi-MCU communication described herein reduces the first power supply voltage received from the power supply to obtain a second power supply voltage through the voltage control circuit 102, and provides the second power supply voltage to the first MCU and the second MCU, so that the first MCU and the second MCU work, and determines the state of all communication terminals of the communication control circuit 101 according to the data transmission terminals to which all communication terminals of the communication control circuit 101 are connected under the control of the first MCU and the second MCU through the communication control circuit 101; and controls the data transmission mode of the first MCU and the data transmission mode of the second MCU according to the state of all communication terminals of the communication control circuit 101, and can accurately provide the second power supply voltage obtained by reducing the first power supply voltage through the voltage control circuit 102 to the first MCU. The communication control circuit 101 can more accurately determine the states of all communication terminals of the communication control circuit 101 according to the data transmission terminals to which all communication terminals are connected under the control of all single-chip microcomputers, thereby triggering the normal operation of the first single-chip microcomputer and the second single-chip microcomputer, and can more accurately determine the states of all communication terminals of the communication control circuit 101 according to the data transmission terminals to which all communication terminals are connected under the control of all single-chip microcomputers, which is beneficial to improving the accuracy and efficiency of determining the states of the communication terminals, and more accurately controlling the data transmission modes of all single-chip microcomputers according to the accurately determined states of all communication terminals, which is beneficial to improving the accuracy and efficiency of the communication control circuit 101 in controlling the data transmission mode, and can reduce the communication lines used between single-chip microcomputers by setting a control circuit that integrates the voltage control circuit 102 and the communication control circuit 101, thereby shortening the communication time between single-chip microcomputers, improving communication efficiency, and improving communication effects.
[0069] Combination Figure 1 , the working principle of the control circuit for multi-MCU communication in the present invention is described in detail as follows:
[0070] In the embodiment of the present invention, when the power supply is powered on, the first power supply voltage received from the power supply is stepped down by the voltage control circuit 102 to obtain a second power supply voltage, and the second power supply voltage is provided to the first single-chip microcomputer and the second single-chip microcomputer respectively, so that the first single-chip microcomputer and the second single-chip microcomputer work; when the data output terminal of the first single-chip microcomputer is electrically connected to the first communication terminal of the communication control circuit 101, the first communication terminal of the communication control circuit 101 is set to an output state by the first single-chip microcomputer. At this time, the first single-chip microcomputer is in a data sending mode. When the data input terminal of the second single-chip microcomputer is electrically connected to the communication control circuit When the first single-chip microcomputer sends data to the communication control circuit 101, the data sent by the first single-chip microcomputer is sent to the second single-chip microcomputer through the communication control circuit 101; after the first single-chip microcomputer sends the data, if the data input terminal of the first single-chip microcomputer is electrically connected to the third communication terminal of the communication control circuit 101, the third communication terminal of the communication control circuit 101 is set to the input state through the first single-chip microcomputer, and at this time, the second single-chip microcomputer is in the data receiving mode. The first single-chip microcomputer is in a data receiving mode; when the second single-chip microcomputer receives data from the first single-chip microcomputer, after a series of processing of the data by the second single-chip microcomputer, if the data output terminal of the second single-chip microcomputer is electrically connected to the fourth communication terminal of the communication control circuit 101, the fourth communication terminal of the communication control circuit 101 is set to an output state through the second single-chip microcomputer. At this time, the second single-chip microcomputer is in a data receiving mode. When the second single-chip microcomputer sends data to the communication control circuit 101, the data sent by the second single-chip microcomputer is sent to the first single-chip microcomputer through the communication control circuit 101; in the second single-chip microcomputer, the data output terminal of the second single-chip microcomputer is electrically connected to the fourth communication terminal of the communication control circuit 101. After the microcontroller finishes sending the data, the second microcontroller enters the data receiving mode and repeats the above-mentioned cycle process in which when the first microcontroller sends data to the communication control circuit 101, the data sent by the first microcontroller is sent to the second microcontroller through the communication control circuit 101, thereby realizing communication between the first microcontroller and the second microcontroller. By setting a control circuit that integrates the voltage control circuit 102 and the communication control circuit 101, the communication lines used between the microcontrollers can be reduced, thereby shortening the communication time between the microcontrollers, improving communication efficiency, and improving communication effects.
[0071] Embodiment 2
[0072] See also Figure 2 , Figure 2 1 is a schematic diagram of another control circuit for multi-MCU communication disclosed in an embodiment of the present invention. Figure 2The control circuit for multi-MCU communication described above can be applied to any electronic device that needs to communicate, such as: a smart home device integrated with multiple MCUs (such as a smart hanging iron), or a smart home device integrated with at least one MCU and a smart control device integrated with at least one MCU (the smart control device can be used to control the smart home device, and the smart control device can include a smart terminal, a smart remote control, etc.), etc., and the embodiments of the present invention are not limited. Figure 2 As shown, the control circuit for multi-MCU communication may include a communication control circuit 101 and a voltage control circuit 102, and the communication control circuit 101 may include a first communication control module 1011 and a second communication control module 1012, wherein the common end of the first communication control module 1011 is electrically connected to the common end of the second communication control module 1012, the voltage input end of the voltage control circuit 102 and the power supply, the first communication end of the first communication control module 1011 is used to electrically connect to the data output end of the first MCU, the second communication end of the first communication control module 1011 is used to electrically connect to the data input end of the first MCU, the first communication end of the second communication control module 1012 is used to electrically connect to the data output end of the second MCU, and the second communication end of the second communication control module 1012 is used to electrically connect to the data input end of the second MCU.
[0073] In the embodiment of the present invention, the first communication control module 1011 is used to determine that the first communication end of the first communication control module 1011 is in an output state when the first communication end of the first communication control module 1011 is electrically connected to the data output end of the first single-chip microcomputer, and to determine that the second communication end of the first communication control module 1011 is in an input state when the second communication end of the first communication control module 1011 is electrically connected to the data input end of the first single-chip microcomputer;
[0074] The second communication control module 1012 is used to determine that the first communication end of the second communication control module 1012 is in an output state when the first communication end of the second communication control module 1012 is electrically connected to the data output end of the second single-chip microcomputer, and to determine that the second communication end of the second communication control module 1012 is in an input state when the second communication end of the second communication control module 1012 is electrically connected to the data input end of the second single-chip microcomputer;
[0075] The first communication control module 1011 is further used to transmit data from the first single-chip microcomputer to the second single-chip microcomputer through the first communication control module 1011 and the second communication control module 1012 in sequence when the first communication terminal of the first communication control module 1011 is in an output state and the second communication terminal of the second communication control module 1012 is in an input state;
[0076] The second communication control module 1012 is also used to transmit data from the second single-chip microcomputer to the first single-chip microcomputer through the second communication control module 1012 and the first communication control module 1011 in sequence when the first communication end of the second communication control module 1012 is in an output state and the second communication end of the first communication control module 1011 is in an input state.
[0077] It should be noted that, for the voltage control circuit 102 and the communication control circuit 101 in the control circuit for multi-MCU communication, wherein the communication control circuit 101 includes a first communication control module 1011 and a second communication control module 1012, please refer to the description of the relevant contents in the above-mentioned embodiment 1, which will not be repeated here.
[0078] For example, Figure 3 As shown, Figure 3 is a schematic diagram of the structure of another control circuit for multi-chip microcomputer communication disclosed in an embodiment of the present invention, such as Figure 3 As shown, the first communication control module 1011 and the voltage control circuit 102 included in the control circuit can be integrated in the display panel, and the second communication control module 1012 included in the control circuit and the power supply connected to the control circuit can be integrated in the power board. In this way, the communication lines used between the single-chip microcomputers can be further reduced through the control circuit for multi-chip microcomputer communication integrated in the display board and the power board, and the complexity of the control circuit can be reduced.
[0079] It can be seen that this optional embodiment uses the voltage control circuit 102 to step down the first power supply voltage received from the power supply to obtain the second power supply voltage, and provides the second power supply voltage to the first single-chip microcomputer and the second single-chip microcomputer, so that the first single-chip microcomputer and the second single-chip microcomputer can work, and the voltage control circuit 102 can accurately provide the second power supply voltage obtained by stepping down the first power supply voltage to the first single-chip microcomputer and the second single-chip microcomputer, thereby triggering the first single-chip microcomputer and the second single-chip microcomputer to work normally, and when the first communication end of the first communication control module 1011 is electrically connected to the data output end of the first single-chip microcomputer, the first communication control module 1011 determines that The first communication terminal is in an output state, and when the second communication terminal of the first communication control module 1011 is electrically connected to the data input terminal of the first single-chip microcomputer, the first communication control module 1011 determines that the second communication terminal is in an input state. When the first communication terminal of the second communication control module 1012 is electrically connected to the data output terminal of the second single-chip microcomputer, the second communication control module 1012 determines that the first communication terminal is in an output state. When the second communication terminal of the second communication control module 1012 is electrically connected to the data input terminal of the second single-chip microcomputer, the second communication control module 1012 determines that the second communication terminal is in an input state. When the first communication terminal of the second communication control module 1012 is in the output state and the second communication terminal of the second communication control module 1012 is in the input state, the first communication control module 1011 transmits the data from the first single-chip microcomputer to the second single-chip microcomputer through the first communication control module 1011 and the second communication control module 1012 in sequence; when the first communication terminal of the second communication control module 1012 is in the output state and the second communication terminal of the first communication control module 1011 is in the input state, the second communication control module 1012 transmits the data from the second single-chip microcomputer to the first single-chip microcomputer through the second communication control module 1012 and the first communication control module 1011 in sequence. The microcontroller can more accurately control the data transmission mode between the first microcontroller and the second microcontroller by controlling the state of the corresponding communication terminal of the first microcontroller through the first communication control module 1011 and controlling the state of the corresponding communication terminal of the second microcontroller through the second communication control module 1012, thereby efficiently and accurately controlling the communication direction between the first microcontroller and the second microcontroller, which is beneficial to improving the communication efficiency and communication accuracy between the microcontrollers, and is beneficial to improving the communication effect. In addition, the communication lines used between the microcontrollers can be reduced by setting a control circuit that integrates the voltage control circuit 102 and the communication control circuit 101, which is beneficial to reducing costs.
[0080] In an optional embodiment, if Figure 4 As shown, Figure 4 is a schematic diagram of the structure of another control circuit for multi-chip microcomputer communication disclosed in an embodiment of the present invention, such as Figure 4As shown, the first communication control module 1011 in the communication control circuit 101 of the control circuit includes a first switch device Q1, a first resistor R1 and a second resistor R2, wherein:
[0081] The first pole of the first switching device Q1 is electrically connected to one end of the first resistor R1, and the second pole of the first switching device Q1 is electrically connected to one end of the second resistor R2, the common end of the second communication control module 1012, the voltage input end of the voltage control circuit 102 and the power supply. The other end of the first resistor R1 is used to electrically connect to the data output end of the first single-chip microcomputer, and the other end of the second resistor R2 is used to electrically connect to the data input end of the first single-chip microcomputer. The third pole of the first switching device Q1 is used for grounding.
[0082] In the embodiment of the present invention, the first switch device Q1 may include a triode, a MOS tube or any other component that can play an equivalent switch control role, which is not limited in the embodiment of the present invention. Specifically, when the first switch device Q1 is a triode, the first electrode of the first switch device Q1 is the base, the second electrode of the first switch device Q1 is the collector, and the third electrode of the first switch device Q1 is the emitter; when the first switch device Q1 is a MOS tube, the first electrode of the first switch device Q1 is the gate, the second electrode of the first switch device Q1 is the drain, and the third electrode of the first switch device Q1 is the source.
[0083] It can be seen that this optional embodiment can control the first switching device Q1 to be turned on according to the data sent by the first single-chip microcomputer when the first pole of the first switching device Q1 receives the data sent by the first single-chip microcomputer, and transmit the data sent by the first single-chip microcomputer to the second single-chip microcomputer through the first resistor R1, the first switching device Q1 and the second communication control module 1012 in sequence. The first single-chip microcomputer can quickly and accurately transmit the data of the first single-chip microcomputer to the second single-chip microcomputer through the conduction control of the first switching device Q1 by the first single-chip microcomputer, which is beneficial to improving the data transmission efficiency and data transmission accuracy of the first single-chip microcomputer.
[0084] In this optional embodiment, as an optional implementation, as Figure 4As shown, the second communication control module 1012 includes a second switch device Q2, a third resistor R3 and a fourth resistor R4, wherein the first pole of the second switch device Q2 is electrically connected to one end of the third resistor R3, and the second pole of the second switch device Q2 is electrically connected to one end of the fourth resistor R4, the second pole of the first switch device Q1, the voltage input end of the voltage control circuit 102 and the power supply, the other end of the third resistor R3 is used to electrically connect to the data output end of the second single-chip microcomputer, the other end of the fourth resistor R4 is used to electrically connect to the data input end of the second single-chip microcomputer, and the third pole of the second switch device Q2 is used to be grounded.
[0085] In the embodiment of the present invention, the second switch device Q2 may include a triode, a MOS tube or any other component that can play an equivalent switch control role, which is not limited in the embodiment of the present invention. Specifically, when the second switch device Q2 is a triode, the first electrode of the second switch device Q2 is the base, the second electrode of the second switch device Q2 is the collector, and the third electrode of the second switch device Q2 is the emitter; when the second switch device Q2 is a MOS tube, the first electrode of the second switch device Q2 is the gate, the second electrode of the second switch device Q2 is the drain, and the third electrode of the second switch device Q2 is the source.
[0086] It can be seen that this optional implementation can control the conduction of the second single-chip microcomputer according to the data sent by the second switching device Q2 when the first electrode of the second switching device Q2 receives the data sent by the second single-chip microcomputer, and transmit the data sent by the second single-chip microcomputer to the first single-chip microcomputer through the third resistor R3, the second switching device Q2 and the first resistor R1 in sequence. The conduction control of the second switching device Q2 by the second single-chip microcomputer can quickly and accurately realize the transmission of the data of the second single-chip microcomputer to the first single-chip microcomputer, which is beneficial to improving the data transmission efficiency and data transmission accuracy of the second single-chip microcomputer.
[0087] In another optional embodiment, Figure 4As shown, the voltage control circuit 102 in the control circuit includes a voltage stabilizer U1, a first capacitor C1 and a second capacitor C2, wherein the voltage input end of the voltage stabilizer U1 is electrically connected to one end of the first capacitor C1, the second pole of the first switch device Q1 included in the first communication control module 1011, the second pole of the second switch device Q2 included in the second communication control module 1012 and the power supply, the voltage output end of the voltage stabilizer U1 is used to electrically connect one end of the second capacitor C2, the voltage input end of the first single-chip microcomputer and the voltage input end of the second single-chip microcomputer, and the ground end of the voltage stabilizer U1, the other end of the first capacitor C1 and the other end of the second capacitor C2 are all used for grounding. The voltage stabilizer U1 may include a low voltage difference linear regulator U1 (i.e., LDO voltage stabilizer U1) or a combination of the LDO voltage stabilizer U1 and other components (such as resistors) and any other device that can play a voltage stabilizing role. In this way, the first supply voltage can be accurately stepped down to the second supply voltage through the voltage regulator U1 and the capacitors at its input and output ends, which is beneficial to provide stable and reliable supply voltage for the first microcontroller and the second microcontroller, thereby ensuring the normal operation of the first microcontroller and the second microcontroller.
[0088] In this optional embodiment, as an optional implementation, as Figure 4 As shown, the voltage control circuit 102 also includes a clamping element D1, wherein the first pole of the clamping element D1 is electrically connected to the second pole of the first switching device Q1, the second pole of the second switching device Q2 and the power supply, and the second pole of the clamping element D1 is electrically connected to the voltage input terminal of the voltage regulator U1 and one end of the first capacitor C1; wherein the clamping element D1 is used to clamp the voltage output by the second pole of the first switching device Q1 and / or the voltage output by the second pole of the second switching device Q2. The clamping element D1 may include a diode or a resistor or any other component that can have an equivalent clamping effect, which is not limited in the embodiment of the present invention. wherein, when the clamping element D1 is a diode (such as Figure 4As shown in FIG. 1 , the first pole of the clamping element D1 is a positive pole, and the second pole of the clamping element D1 is a negative pole. In this way, the voltage output by the second pole of the first switching device Q1 and / or the voltage output by the second pole of the second switching device Q2 can be clamped by the clamping element D1, which is beneficial to improving the accuracy of the voltage at the voltage input end of the input voltage regulator U1, thereby facilitating the improvement of the accuracy of the second power supply voltage output after the voltage reduction processing of the voltage regulator U1 based on the accurate input voltage, and further facilitating the normal and stable operation of the single-chip microcomputer based on the second power supply voltage accurately provided to the single-chip microcomputer. In addition, when the clamping element D1 is a diode, the first capacitor C1 can also be charged by the unidirectional conductivity of the diode, and the storage of the first capacitor C1 by the diode can reduce the situation that the output voltage of the voltage regulator U1 is unstable due to uneven signals caused by data transmission between the first communication control module 1011 and the second communication control module 1012, which is beneficial to maintaining a stable output voltage of the voltage regulator U1.
[0089] In this optional embodiment, optionally, as Figure 4 As shown, the control circuit further includes a voltage dividing module, wherein the first end of the voltage dividing module is electrically connected to the second pole of the first switch device Q1, the second pole of the second switch device Q2 and the first pole of the clamping element D1, and the second end of the voltage dividing module is used to electrically connect the power supply; the voltage dividing module is used to divide the voltage of the second pole of the first switch device Q1 and the second pole of the second switch device Q2. Optionally, the voltage dividing module may include a small resistor, multiple resistors (such as Figure 4 The embodiment of the present invention does not limit the components R5, R6) connected in parallel or other components that can play the same voltage division role. In this way, the voltage of the first switch device Q1 and the second switch device Q2 is divided by the voltage division module, so that after the power supply is powered on, the voltage is directly connected to the second pole of the first switch device Q1 and the second pole of the second switch device Q2, which reduces the voltage obtained by the second pole of the first switch device Q1 and the second pole of the second switch device Q2, reduces the occurrence of the first switch device Q1 and the second switch device Q2 being burned, is conducive to protecting the first switch device Q1 and the second switch device Q2, and can cope with the situation when the voltage of the power supply is relatively high in actual applications, facilitates the selection of the first switch device Q1 and the second switch device Q2, expands the selection range of the first switch device Q1 and the second switch device Q2, and improves the applicability of the circuit.
[0090] In the present invention, Figure 5 As shown, Figure 5 FIG. 1 is a flow chart showing the working principle of a control circuit for multi-MCU communication disclosed in an embodiment of the present invention. Figure 5 As shown, the working principle of the control circuit is as follows:
[0091] For the Dashboard program:
[0092] 201. The display board program starts.
[0093] In an embodiment of the present invention, when the power supply is powered on, the first power supply voltage output by the power supply passes through a voltage divider module and is input into a voltage control circuit for voltage reduction processing to obtain a second power supply voltage, and the second power supply voltage is provided to the first single-chip microcomputer so that the display panel program corresponding to the first single-chip microcomputer starts.
[0094] 202. Initialization.
[0095] Specifically, the display panel program is initialized.
[0096] 203. Communication port OUT_1 is set to output state, data is updated, and data is sent.
[0097] Among them, the communication port of the communication control circuit that is electrically connected to the data output terminal (i.e., OUT_1 terminal) of the first single-chip microcomputer is set to an output state, and the data of the first single-chip microcomputer is updated, and the data of the first single-chip microcomputer is sent to the communication control circuit.
[0098] 204. Communication port IN_1 is set to input state.
[0099] Specifically, after the first single-chip microcomputer has finished sending the data, the communication port of the communication control circuit that is electrically connected to the data input terminal (ie, the IN_1 terminal) of the first single-chip microcomputer is set to an input state.
[0100] 205. Wait for receiving data and count the Tr time.
[0101] When the first single-chip microcomputer enters the data receiving mode, it waits to receive the data returned by the second single-chip microcomputer, and takes the time when the first single-chip microcomputer enters the data receiving mode as the starting time, and accumulates the time Tr for waiting to receive data.
[0102] 206. Whether data is received and decoded successfully.
[0103] Specifically, it is determined whether the first single-chip microcomputer receives data from the second single-chip microcomputer and whether the data can be decoded successfully when received. When the determination result of step 206 is yes, step 207 is triggered; when the determination result of step 206 is no, step 208 is triggered.
[0104] 207. Tr is cleared and the system status is updated.
[0105] In the embodiment of the present invention, after step 207 is executed, step 203 may be executed again.
[0106] 208. Determine whether Tr is greater than a preset time (eg, 2 seconds).
[0107] In the embodiment of the present invention, when the judgment result of step 208 is yes, step 203 is repeated; when the judgment result of step 208 is no, step 205 is repeated.
[0108] For the power board:
[0109] 301. The power board program starts.
[0110] In an embodiment of the present invention, when the power supply is powered on, the first power supply voltage output by the power supply passes through a voltage divider module and is input into a voltage control circuit for voltage reduction processing to obtain a second power supply voltage, and the second power supply voltage is provided to the second single-chip microcomputer so that the power board program corresponding to the second single-chip microcomputer starts.
[0111] 302. Initialization.
[0112] Specifically, the power board program is initialized.
[0113] 303. Communication port IN_2 is set to input state.
[0114] Among them, the communication port of the communication control circuit that is electrically connected to the data input terminal (ie, the IN_2 terminal) of the second single-chip microcomputer is set to an input state.
[0115] 304. Waiting for receiving data.
[0116] Specifically, the second single-chip microcomputer waits to receive data sent by the first single-chip microcomputer.
[0117] 305. Whether data is received and decoded successfully.
[0118] Specifically, it is determined whether the second single-chip microcomputer receives the data of the first single-chip microcomputer and whether the second single-chip microcomputer can decode the data successfully when receiving the data. When the determination result of step 305 is yes, step 306 is triggered; when the determination result of step 305 is no, step 304 is repeated.
[0119] 306. Update system status.
[0120] 307. The communication port OUT_2 is set to output state and the data is updated.
[0121] In an embodiment of the present invention, after the second single-chip microcomputer completes updating the system state, the communication port in the communication control circuit that is electrically connected to the data output end (i.e., OUT_2 end) of the second single-chip microcomputer is set to an output state, and the data of the second single-chip microcomputer is updated.
[0122] In the embodiment of the present invention, after step 307 is executed, step 303 may be re-executed. Optionally, after step 203 is executed, step 304 may be triggered to execute; after step 307 is executed, step 205 may be triggered to execute.
[0123] Combination Figure 2-Figure 5 , the working principle of the control circuit for multi-MCU communication in the present invention is described in detail as follows:
[0124] In the embodiment of the present invention, after the power supply is powered on, the voltage output by the power supply passes through the voltage divider module and the voltage obtained is lower than the on-state voltage of the first switch device Q1 and the second switch device Q2, so the first switch device Q1 and the second switch device Q2 are turned off, and the voltage control circuit 102 in the control circuit steps down the voltage of the power supply after passing through the voltage divider module to obtain a second power supply voltage (for example, 5 volts or 3 volts), and provides the second power supply voltage to the first single-chip microcomputer and the second single-chip microcomputer, so that the first single-chip microcomputer and the second single-chip microcomputer work; when the first single-chip microcomputer connects the data output terminal (such as Figure 4 The other end of the first resistor R1 electrically connected to OUT_1 in FIG. 1 is set to an output state, and the second single-chip microcomputer is connected to its data input terminal (such as Figure 4 When the other end of the fourth resistor R4 electrically connected to IN_2 in the first microcontroller is set to an input state, the data sent by the first microcontroller (such as Figure 4 The voltage corresponding to SNG1 in the circuit is higher than the conduction voltage of the first switch device Q1, so the first switch device Q1 is turned on, and the data sent by the first single-chip microcomputer flows through the first resistor R1, the first switch device Q1 and the third resistor R3 in sequence and is transmitted to the data input terminal of the second single-chip microcomputer (i.e. Figure 4 IN_2 in the figure), the first single-chip microcomputer enters the data receiving mode after sending the above data, and the first switch device Q1 is turned off. At this time, the first single-chip microcomputer will connect to its data input terminal (such as Figure 4 The other end of the second resistor R2 electrically connected to IN_1 in the figure is set to an input state, ready to receive data returned by the second single-chip microcomputer; when the second single-chip microcomputer receives the data sent by the first single-chip microcomputer, it processes / updates the system state of the second single-chip microcomputer according to the data to obtain the data to be returned to the first single-chip microcomputer, and then the second single-chip microcomputer connects to its data output terminal (such as Figure 4 The other end of the third resistor R3 electrically connected to OUT_2 in the figure is set to an output state. At this time, the voltage corresponding to the data to be returned sent by the second single-chip microcomputer is higher than the turn-on voltage of the second switch device Q2. Therefore, the second switch device Q2 is turned on, and the data to be returned sent by the second single-chip microcomputer flows through the third resistor R3, the second switch device Q2 and the second resistor R2 in sequence and is transmitted to the data input terminal of the first single-chip microcomputer (i.e. Figure 4IN_1 in the figure), the second single-chip microcomputer enters the data receiving mode after sending the above-mentioned data to be returned, the second switch device Q2 is turned off, and the data returned by the first single-chip microcomputer is accurately received, and the data sent by the first single-chip microcomputer is repeated to control the conduction of the first switch device Q1 to transmit the data sent by the first single-chip microcomputer. The communication between the first single-chip microcomputer and the second single-chip microcomputer is realized, and the communication lines used between the single-chip microcomputers can be reduced by setting a control circuit that integrates the voltage control circuit 102 and the communication control circuit 101, thereby shortening the communication time between the single-chip microcomputers, improving the communication efficiency, and improving the communication effect.
[0125] Embodiment 3
[0126] See also Figure 6 , Figure 6 1 is a flow chart of a control method for multi-MCU communication disclosed in an embodiment of the present invention. Figure 6 The control method for multi-microcontroller communication described can be applied to an electronic device (such as a hanging iron) provided with a control circuit for multi-microcontroller communication, wherein the control circuit includes a communication control circuit and a voltage control circuit, wherein the voltage input terminal of the voltage control circuit and the common terminal of the communication control circuit are both used to electrically connect to a power supply, the voltage output terminal of the voltage control circuit is used to electrically connect to the voltage input terminal of the first microcontroller and the voltage input terminal of the second microcontroller, all communication terminals included in the communication control circuit are used to electrically connect to the corresponding data transmission terminal of the first microcontroller and the corresponding data transmission terminal of the second microcontroller, each of the data transmission terminals includes a data output terminal or a data input terminal, and the common terminal is a port shared by power supply and signal; Figure 6 As shown, the control method for multi-MCU communication may include the following steps:
[0127] 401. A voltage control circuit steps down a first power supply voltage received from a power supply to obtain a second power supply voltage.
[0128] 402. The voltage control circuit provides a second supply voltage to the first single-chip microcomputer and the second single-chip microcomputer, so that the first single-chip microcomputer and the second single-chip microcomputer operate.
[0129] 403. The communication control circuit, under the control of the first single-chip microcomputer and the second single-chip microcomputer, determines the states of all the communication terminals of the communication control circuit according to the data transmission terminals to which all the communication terminals of the communication control circuit are connected.
[0130] 404. The communication control circuit controls the data transmission mode of the first single-chip microcomputer and the data transmission mode of the second single-chip microcomputer according to the states of all the communication terminals of the communication control circuit.
[0131] In an embodiment of the present invention, when the first communication terminal of the communication control circuit is electrically connected to the data output terminal of the first single-chip microcomputer and the second communication terminal of the communication control circuit is electrically connected to the data input terminal of the second single-chip microcomputer, the state of the first communication terminal is an output state, the state of the second communication terminal is an input state, the first single-chip microcomputer is in a data sending mode, and the second single-chip microcomputer is in a data receiving mode. When the third communication terminal of the communication control circuit is electrically connected to the data input terminal of the first single-chip microcomputer and the fourth communication terminal of the communication control circuit is electrically connected to the data output terminal of the second single-chip microcomputer, the state of the third communication terminal is an input state, the state of the fourth communication terminal is an output state, the first single-chip microcomputer is in a data receiving mode, and the second single-chip microcomputer is in a data sending mode.
[0132] In the embodiment of the present invention, when the state of the first communication terminal is the output state and the state of the second communication terminal is the input state, step 405 is triggered; when the state of the third communication terminal is the input state and the state of the fourth communication terminal is the output state, step 406 is triggered.
[0133] 405. The communication control circuit transmits the data sent by the data output terminal of the first single-chip microcomputer to the second single-chip microcomputer via the communication control circuit.
[0134] 406. The communication control circuit transmits the data sent by the data output terminal of the second single-chip microcomputer to the first single-chip microcomputer via the communication control circuit.
[0135] It can be seen that the implementation Figure 6The control method for multi-MCU communication described herein can reduce the voltage of a first power supply voltage received from a power supply source to obtain a second power supply voltage through a voltage control circuit, and provide the second power supply voltage to the first MCU and the second MCU so that the first MCU and the second MCU can work, and determine the states of all communication terminals of the communication control circuit according to the data transmission terminals to which all communication terminals of the communication control circuit are connected under the control of the first MCU and the second MCU through the communication control circuit; and control the data transmission mode of the first MCU and the data transmission mode of the second MCU according to the states of all communication terminals of the communication control circuit, and can accurately provide the second power supply voltage obtained by reducing the first power supply voltage through the voltage control circuit to the first MCU. The invention relates to a single-chip microcomputer and a second single-chip microcomputer, thereby triggering the normal operation of the first single-chip microcomputer and the second single-chip microcomputer, and being able to more accurately determine the states of all communication terminals of the communication control circuit according to the data transmission terminals to which all communication terminals are connected under the control of all single-chip microcomputers through the communication control circuit, which is beneficial to improving the accuracy and efficiency of determining the states of the communication terminals, and more accurately controlling the data transmission modes of all single-chip microcomputers according to the accurately determined states of all communication terminals, which is beneficial to improving the accuracy and efficiency of the communication control circuit over the data transmission mode, and being able to reduce the communication lines used between single-chip microcomputers by setting a control circuit that integrates a voltage control circuit and a communication control circuit, thereby being beneficial to shortening the communication time between single-chip microcomputers, improving communication efficiency, and improving communication effects.
[0136] In an optional embodiment, the method may further include:
[0137] When the first single-chip microcomputer and the second single-chip microcomputer are respectively integrated in different electronic devices, and one of the electronic devices is an intelligent control device and the other electronic device is a smart home device, the intelligent control device obtains the user's usage habits for the smart home device;
[0138] The intelligent control device generates device operation control parameters for the smart home device according to the user's usage habits, and sends the device operation control parameters corresponding to the smart home device to the smart home device through a control circuit for multi-MCU communication connected between the intelligent control device and the smart home device;
[0139] The smart home device receives the device operation control parameters, and controls the smart home device to perform corresponding control operations according to the device operation control parameters.
[0140] In the embodiment of the present invention, optionally, the smart home device may be a smart hanging steamer, or a smart water dispenser, or other smart home devices integrated with a single-chip microcomputer. For example, assuming that the smart home device is a smart hanging steamer, the user's usage habits for the smart home device may include the user's habitual usage mode for the smart home device, the habitual usage temperature corresponding to the corresponding habitual usage mode, and the habitual usage duration corresponding to the corresponding habitual usage temperature. Optionally, the device operation control parameters may include one or more combinations of the device operation mode, the temperature adjustment gear of the corresponding device operation mode, and the duration of the corresponding temperature adjustment gear. Optionally, the control operation may include one or more combinations of temperature control operation, display control operation, and timing control operation, which are not limited in the embodiment of the present invention.
[0141] It can be seen that this optional embodiment can be based on the specific communication data communicated by different electronic devices integrated with single-chip microcomputers through the control circuit for multi-chip microcomputer communication (such as the device operation control parameters corresponding to another electronic device generated by one of the electronic devices according to the user's usage habits for another electronic device), and control the operations that need to be performed by another electronic device according to the specific communication data. In this way, when different electronic devices integrated with single-chip microcomputers interact, the communication time is reduced and the communication efficiency is improved through the control circuit for multi-chip microcomputer communication by the user, thereby improving the interaction efficiency and interaction accuracy between different electronic devices, and is conducive to improving the intelligence of communication between different electronic devices by collecting single-chip microcomputers and the control circuits required for communication.
[0142] In another optional embodiment, the communication control circuit includes a first communication control module and a second communication control module, wherein the common end of the first communication control module is electrically connected to the common end of the second communication control module, the voltage input end of the voltage control circuit and the power supply, the first communication end of the first communication control module is used to electrically connect to the data output end of the first single-chip microcomputer, the second communication end of the first communication control module is used to electrically connect to the data input end of the first single-chip microcomputer, the first communication end of the second communication control module is used to electrically connect to the data output end of the second single-chip microcomputer, and the second communication end of the second communication control module is used to electrically connect to the data input end of the second single-chip microcomputer.
[0143] It can be seen that this optional embodiment can determine that the first communication end of the first communication control module is in an output state through the first communication control module when the first communication end is electrically connected to the data output end of the first single-chip microcomputer, and determine that the second communication end of the first communication control module is in an input state through the first communication control module when the second communication end of the first communication control module is electrically connected to the data input end of the first single-chip microcomputer; when the first communication end of the second communication control module is electrically connected to the data output end of the second single-chip microcomputer, determine that the first communication end of the second communication control module is in an output state through the second communication control module; when the second communication end of the second communication control module is electrically connected to the data input end of the second single-chip microcomputer, determine that the second communication end of the second communication control module is in an input state through the second communication control module; when the first communication end of the first communication control module is in an output state and the second communication end of the second communication control module is in an input state, the first communication control module transmits the data from the first single-chip microcomputer in sequence through the first communication control module. and the second communication control module transmits it to the second single-chip microcomputer. When the first communication end of the second communication control module is in the output state and the second communication end of the first communication control module is in the input state, the second communication control module transmits the data from the second single-chip microcomputer to the first single-chip microcomputer through the second communication control module and the first communication control module in sequence. The data transmission mode of the first single-chip microcomputer and the second single-chip microcomputer can be more accurately controlled by the state control of the corresponding communication end of the first single-chip microcomputer by the first communication control module and the state control of the corresponding communication end of the second single-chip microcomputer by the second communication control module, so as to efficiently and accurately realize the control of the communication direction of the first single-chip microcomputer and the second single-chip microcomputer, which is beneficial to improving the communication efficiency and communication accuracy between the single-chip microcomputers, and is beneficial to improving the communication effect. Moreover, the communication lines used between the single-chip microcomputers can be reduced by setting a control circuit integrating a voltage control circuit and a communication control circuit, which is beneficial to reducing costs.
[0144] In this optional embodiment, as an optional implementation, the first communication control module includes a first switching device, a first resistor and a second resistor, wherein the first pole of the first switching device is electrically connected to one end of the first resistor, and the second pole of the first switching device is electrically connected to one end of the second resistor, the common end of the second communication control module, the voltage input end of the voltage control circuit and the power supply, the other end of the first resistor is used to electrically connect to the data output end of the first microcontroller, the other end of the second resistor is used to electrically connect to the data input end of the first microcontroller, and the third pole of the first switching device is used to be grounded.
[0145] It can be seen that this optional implementation can control the first switching device to conduct according to the data sent by the first single-chip microcomputer when the first pole of the first switching device receives the data sent by the first single-chip microcomputer, and transmit the data sent by the first single-chip microcomputer to the second single-chip microcomputer through the first resistor, the first switching device and the second communication control module in sequence. The first single-chip microcomputer can quickly and accurately transmit the data of the first single-chip microcomputer to the second single-chip microcomputer through the conduction control of the first switching device by the first single-chip microcomputer, which is beneficial to improving the data transmission efficiency and data transmission accuracy of the first single-chip microcomputer.
[0146] In this optional embodiment, optionally, the second communication control module includes a second switching device, a third resistor and a fourth resistor, wherein the first pole of the second switching device is electrically connected to one end of the third resistor, and the second pole of the second switching device is electrically connected to one end of the fourth resistor, the second pole of the first switching device, the voltage input end of the voltage control circuit and the power supply, the other end of the third resistor is used to electrically connect to the data output end of the second single-chip microcomputer, the other end of the fourth resistor is used to electrically connect to the data input end of the second single-chip microcomputer, and the third pole of the second switching device is used to be grounded.
[0147] It can be seen that this optional implementation can also control the conduction of the second single-chip microcomputer according to the data sent by the second switching device when the first pole of the second switching device receives the data sent by the second single-chip microcomputer, and transmit the data sent by the second single-chip microcomputer to the first single-chip microcomputer through the third resistor, the second switching device and the first resistor in sequence. The conduction control of the second switching device by the second single-chip microcomputer can quickly and accurately realize the transmission of the data of the second single-chip microcomputer to the first single-chip microcomputer, which is beneficial to improving the data transmission efficiency and data transmission accuracy of the second single-chip microcomputer.
[0148] In another optional embodiment, the voltage control circuit includes a voltage stabilizer, a first capacitor and a second capacitor, wherein the voltage input terminal of the voltage stabilizer is electrically connected to one end of the first capacitor, the second pole of the first switching device included in the first communication control module, the second pole of the second switching device included in the second communication control module and the power supply, and the voltage output terminal of the voltage stabilizer is used to electrically connect one end of the second capacitor, the voltage input terminal of the first single-chip microcomputer and the voltage input terminal of the second single-chip microcomputer, and the ground terminal of the voltage stabilizer, the other end of the first capacitor and the other end of the second capacitor are all used for grounding.
[0149] It can be seen that this optional embodiment can accurately step down the first power supply voltage to the second power supply voltage through the voltage regulator and the capacitors at its input and output ends, which is beneficial to provide stable and reliable power supply voltage for the first microcontroller and the second microcontroller, thereby facilitating the normal operation of the first microcontroller and the second microcontroller.
[0150] In this optional embodiment, as an optional implementation, the voltage control circuit further includes a clamping element, wherein a first electrode of the clamping element is electrically connected to a second electrode of the first switching device, a second electrode of the second switching device and the power supply, and a second electrode of the clamping element is electrically connected to a voltage input terminal of the regulator and one end of the first capacitor; the method may further include:
[0151] The clamping element clamps a voltage output by the second electrode of the first switching device and / or a voltage output by the second electrode of the second switching device.
[0152] Specifically, when the voltage input end of the voltage control circuit includes, in addition to the first power supply voltage provided by the power supply, the voltage output by the second pole of the first switching device and / or the voltage output by the second pole of the second switching device, the remaining voltage except the first power supply voltage is obtained by the clamping element to obtain a clamped voltage, and the clamped voltage is input into the voltage regulator for voltage reduction processing to obtain a second power supply voltage.
[0153] It can be seen that this optional implementation can clamp the voltage at the voltage input end of the regulator through the clamping element, which is beneficial to improving the accuracy of the voltage at the voltage input end of the input regulator, thereby facilitating improving the accuracy of the second power supply voltage output after the voltage step-down processing of the regulator based on the accurate input voltage, and further facilitating the normal and stable operation of the single-chip microcomputer based on the second power supply voltage accurately provided to the single-chip microcomputer. In addition, when the clamping element is a diode, the first capacitor can also be charged through the unidirectional conductivity of the diode, and the storage of electricity in the first capacitor through the diode can reduce the signal unevenness caused by the data transmission between the first communication control module and the second communication control module, resulting in unstable output voltage of the regulator, which is beneficial to maintaining a stable output voltage of the regulator.
[0154] In this optional implementation, optionally, the control circuit further includes a voltage divider module, wherein a first end of the voltage divider module is electrically connected to the second pole of the first switching device, the second pole of the second switching device and the first pole of the clamping element, and a second end of the voltage divider module is used to electrically connect to the power supply; the method may further include:
[0155] The voltage dividing module divides the voltage of the second electrode of the first switching device and the second electrode of the second switching device.
[0156] It can be seen that this optional implementation can also divide the voltage of the first switch device and the second switch device through the voltage divider module, and can place the voltage directly connected to the second pole of the first switch device and the second pole of the second switch device after the power supply is powered on, thereby reducing the voltage obtained by the second pole of the first switch device and the second pole of the second switch device, reducing the occurrence of burning out of the first switch device and the second switch device, which is beneficial to protecting the first switch device and the second switch device, and can cope with the situation when the voltage of the power supply is relatively high in actual applications, facilitate the selection of the first switch device and the second switch device, expand the selection range of the first switch device and the second switch device, and improve the applicability of the circuit.
[0157] Embodiment 4
[0158] See also Figure 7 , Figure 7 Schematic diagram of the structure of the electronic device disclosed in the embodiment of the present invention. Figure 7 As shown, the electronic device is an electronic device provided with a control circuit capable of being used for multi-MCU communication, and the electronic device includes a device body, the electronic device also includes a control circuit for multi-MCU communication as in Embodiment 1 or Embodiment 2, and the electronic device is used to implement a control method for multi-MCU communication as in Embodiment 3, and the device body is used to place the control circuit for multi-MCU communication. It should be noted that for a detailed description of the control circuit for multi-MCU communication, please refer to the specific description of the relevant contents in Embodiment 1 and Embodiment 2, and the embodiments of the present invention will not be repeated.
[0159] It can be seen that the implementation Figure 7The electronic device described can reduce the voltage of a first power supply voltage received from a power supply source to obtain a second power supply voltage through a voltage control circuit, and provide the second power supply voltage to a first single-chip microcomputer and a second single-chip microcomputer so that the first single-chip microcomputer and the second single-chip microcomputer can work, and determine the states of all communication terminals of the communication control circuit according to the data transmission terminals to which all communication terminals of the communication control circuit are connected under the control of the first single-chip microcomputer and the second single-chip microcomputer through a communication control circuit; and control the data transmission mode of the first single-chip microcomputer and the data transmission mode of the second single-chip microcomputer according to the states of all communication terminals of the communication control circuit, and can accurately provide the second power supply voltage obtained by reducing the first power supply voltage through the voltage control circuit to the first single-chip microcomputer and the second single-chip microcomputer. The single-chip microcomputer can trigger the normal operation of the first single-chip microcomputer and the second single-chip microcomputer, and can more accurately determine the states of all communication terminals of the communication control circuit according to the data transmission terminals to which all communication terminals are connected under the control of all single-chip microcomputers through the communication control circuit, which is beneficial to improving the accuracy and efficiency of determining the states of the communication terminals, and more accurately control the data transmission modes of all single-chip microcomputers according to the accurately determined states of all communication terminals, which is beneficial to improving the accuracy and efficiency of the communication control circuit over the data transmission mode. The communication lines used between the single-chip microcomputers can be reduced by setting a control circuit that integrates a voltage control circuit and a communication control circuit, which is beneficial to shortening the communication time between the single-chip microcomputers, improving the communication efficiency, and improving the communication effect.
[0160] Finally, it should be noted that the control circuit and method and electronic device for multi-microcontroller communication disclosed in the embodiments of the present invention are only preferred embodiments of the present invention, which are only used to illustrate the technical solution of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, it should be understood by those skilled in the art that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A control circuit for multi-chip microcomputer communication, characterized in that: The control circuit includes a communication control circuit and a voltage control circuit, and the communication control circuit includes a first communication control module and a second communication control module, wherein: The common end of the first communication control module is electrically connected to the common end of the second communication control module, the voltage input end of the voltage control circuit and the power supply; the voltage output end of the voltage control circuit is used to electrically connect the voltage input end of the first single-chip microcomputer and the voltage input end of the second single-chip microcomputer; the first communication end of the first communication control module is used to electrically connect the data output end of the first single-chip microcomputer; the second communication end of the first communication control module is used to electrically connect the data input end of the first single-chip microcomputer; the first communication end of the second communication control module is used to electrically connect the data output end of the second single-chip microcomputer; the second communication end of the second communication control module is used to electrically connect the data input end of the second single-chip microcomputer; the common end is a port shared by power supply and signal; The voltage control circuit is used to step down the first power supply voltage received from the power supply to obtain a second power supply voltage, and provide the second power supply voltage to the first single-chip microcomputer and the second single-chip microcomputer, so that the first single-chip microcomputer and the second single-chip microcomputer work; The communication control circuit is used to determine the states of all the communication terminals of the communication control circuit according to the data transmission terminals to which all the communication terminals of the communication control circuit are connected, each of the data transmission terminals including a data output terminal or a data input terminal, under the control of the first single-chip microcomputer and the second single-chip microcomputer; and control the data transmission mode of the first single-chip microcomputer and the data transmission mode of the second single-chip microcomputer according to the states of all the communication terminals of the communication control circuit; Wherein, when the first communication terminal of the communication control circuit is electrically connected to the data output terminal of the first single-chip microcomputer and the second communication terminal of the communication control circuit is electrically connected to the data input terminal of the second single-chip microcomputer, the state of the first communication terminal is an output state, the state of the second communication terminal is an input state, the first single-chip microcomputer is in a data sending mode, and the second single-chip microcomputer is in a data receiving mode; when the third communication terminal of the communication control circuit is electrically connected to the data input terminal of the first single-chip microcomputer and the fourth communication terminal of the communication control circuit is electrically connected to the data output terminal of the second single-chip microcomputer, the state of the third communication terminal is an input state, the state of the fourth communication terminal is an output state, the first single-chip microcomputer is in a data receiving mode, and the second single-chip microcomputer is in a data sending mode; The communication control circuit is also used for transmitting the data sent by the data output terminal of the first single-chip microcomputer to the second single-chip microcomputer via the communication control circuit when the state of the first communication terminal is the output state and the state of the second communication terminal is the input state; and for transmitting the data sent by the data output terminal of the second single-chip microcomputer to the first single-chip microcomputer via the communication control circuit when the state of the third communication terminal is the input state and the state of the fourth communication terminal is the output state, wherein the first communication terminal of the communication control circuit is the first communication terminal of the first communication control module, the second communication terminal of the communication control circuit is the second communication terminal of the second communication control module, the third communication terminal of the communication control circuit is the second communication terminal of the first communication control module, and the fourth communication terminal of the communication control circuit is the first communication terminal of the second communication control module; Wherein, the communication control circuit, under the control of the first single-chip microcomputer and the second single-chip microcomputer, determines the states of all the communication terminals of the communication control circuit according to the data transmission terminals to which all the communication terminals of the communication control circuit are connected, and controls the data transmission mode of the first single-chip microcomputer and the data transmission mode of the second single-chip microcomputer according to the states of all the communication terminals of the communication control circuit, specifically including: The first single-chip microcomputer sets the first communication terminal of the communication control circuit to an output state through the data output terminal of the first single-chip microcomputer, and the second single-chip microcomputer sets the second communication terminal of the communication control circuit to an input state through the data input terminal of the second single-chip microcomputer, and the first single-chip microcomputer enters a data sending mode; The first single-chip microcomputer updates data and sends data to the second single-chip microcomputer through the communication control circuit. After sending the data, the first single-chip microcomputer sets the third communication terminal of the communication control circuit to the input state through the data input terminal of the first single-chip microcomputer, and the first single-chip microcomputer enters a data receiving mode; and is ready to receive data returned by the second single-chip microcomputer; When the data input terminal of the second single-chip microcomputer receives the data from the first single-chip microcomputer, the second single-chip microcomputer processes and updates the system state of the second single-chip microcomputer; the second single-chip microcomputer sets the fourth communication terminal of the communication control circuit to the output state through the data output terminal of the second single-chip microcomputer, and the second single-chip microcomputer enters the data sending mode; The second single-chip microcomputer updates data and sends data to the first single-chip microcomputer through the communication control circuit. After sending the data, the second single-chip microcomputer enters the data receiving mode to wait for receiving the data returned by the first single-chip microcomputer. When the data input end of the first single-chip microcomputer receives the data from the second single-chip microcomputer, the first single-chip microcomputer is triggered to execute the above-mentioned operation of setting the first communication end of the communication control circuit to an output state through the data output end of the first single-chip microcomputer.
2. The control circuit for multi-chip microcomputer communication according to claim 1, characterized in that: The first communication control module includes a first switch device, a first resistor and a second resistor, wherein: The first pole of the first switching device is electrically connected to one end of the first resistor, and the second pole of the first switching device is electrically connected to one end of the second resistor, the common end of the second communication control module, the voltage input end of the voltage control circuit and the power supply. The other end of the first resistor is used to electrically connect to the data output end of the first single-chip microcomputer, and the other end of the second resistor is used to electrically connect to the data input end of the first single-chip microcomputer. The third pole of the first switching device is used for grounding.
3. The control circuit for multi-chip microcomputer communication according to claim 2, characterized in that: The second communication control module includes a second switch device, a third resistor and a fourth resistor, wherein: The first pole of the second switching device is electrically connected to one end of the third resistor, and the second pole of the second switching device is electrically connected to one end of the fourth resistor, the second pole of the first switching device, the voltage input end of the voltage control circuit and the power supply. The other end of the third resistor is used to electrically connect to the data output end of the second single-chip microcomputer, the other end of the fourth resistor is used to electrically connect to the data input end of the second single-chip microcomputer, and the third pole of the second switching device is used to be grounded.
4. The control circuit for multi-chip microcomputer communication according to any one of claims 1 to 3, characterized in that: The voltage control circuit includes a voltage stabilizer, a first capacitor and a second capacitor, wherein: The voltage input end of the voltage regulator is electrically connected to one end of the first capacitor, the second pole of the first switching device included in the first communication control module, the second pole of the second switching device included in the second communication control module and the power supply; the voltage output end of the voltage regulator is used to electrically connect one end of the second capacitor, the voltage input end of the first single-chip microcomputer and the voltage input end of the second single-chip microcomputer; the ground end of the voltage regulator, the other end of the first capacitor and the other end of the second capacitor are all used for grounding.
5. The control circuit for multi-chip microcomputer communication according to claim 4, characterized in that: The voltage control circuit further comprises a clamping element, wherein: The first electrode of the clamping element is electrically connected to the second electrode of the first switching device, the second electrode of the second switching device and the power supply, and the second electrode of the clamping element is electrically connected to the voltage input terminal of the regulator and one end of the first capacitor; The clamping element is used to clamp the voltage output by the second pole of the first switching device and / or the voltage output by the second pole of the second switching device.
6. The control circuit for multi-chip microcomputer communication according to claim 5, characterized in that: The control circuit also includes a voltage dividing module, wherein: The first end of the voltage divider module is electrically connected to the second pole of the first switch device, the second pole of the second switch device and the first pole of the clamping element, and the second end of the voltage divider module is used to electrically connect to the power supply; The voltage dividing module is used to divide the voltage of the second electrode of the first switching device and the second electrode of the second switching device.
7. A control method for multi-chip microcomputer communication, characterized in that: The method is applied to a control circuit for multi-MCU communication, wherein the control circuit includes a communication control circuit and a voltage control circuit, and the communication control circuit includes a first communication control module and a second communication control module, wherein a common end of the first communication control module is electrically connected to a common end of the second communication control module, a voltage input end of the voltage control circuit and a power supply, a voltage output end of the voltage control circuit is used to electrically connect a voltage input end of a first MCU and a voltage input end of a second MCU, a first communication end of the first communication control module is used to electrically connect a data output end of the first MCU, a second communication end of the first communication control module is used to electrically connect a data input end of the first MCU, a first communication end of the second communication control module is used to electrically connect a data output end of the second MCU, a second communication end of the second communication control module is used to electrically connect a data input end of the second MCU, and the common end is a port shared by a power supply and a signal; the method includes: The voltage control circuit steps down the first power supply voltage received from the power supply to obtain a second power supply voltage, and provides the second power supply voltage to the first single-chip microcomputer and the second single-chip microcomputer, so that the first single-chip microcomputer and the second single-chip microcomputer operate; The communication control circuit, under the control of the first single-chip microcomputer and the second single-chip microcomputer, determines the states of all the communication terminals of the communication control circuit according to the data transmission terminals to which all the communication terminals of the communication control circuit are connected, each of the data transmission terminals including a data output terminal or a data input terminal; and controls the data transmission mode of the first single-chip microcomputer and the data transmission mode of the second single-chip microcomputer according to the states of all the communication terminals of the communication control circuit; When the state of the first communication terminal is an output state and the state of the second communication terminal is an input state, the communication control circuit transmits the data sent by the data output terminal of the first single-chip microcomputer to the second single-chip microcomputer via the communication control circuit; When the state of the third communication terminal is the input state and the state of the fourth communication terminal is the output state, the communication control circuit transmits the data sent by the data output terminal of the second single-chip microcomputer to the first single-chip microcomputer via the communication control circuit, the first communication terminal of the communication control circuit is the first communication terminal of the first communication control module, the second communication terminal of the communication control circuit is the second communication terminal of the second communication control module, the third communication terminal of the communication control circuit is the second communication terminal of the first communication control module, and the fourth communication terminal of the communication control circuit is the first communication terminal of the second communication control module; Wherein, the communication control circuit, under the control of the first single-chip microcomputer and the second single-chip microcomputer, determines the states of all the communication terminals of the communication control circuit according to the data transmission terminals to which all the communication terminals of the communication control circuit are connected, and controls the data transmission mode of the first single-chip microcomputer and the data transmission mode of the second single-chip microcomputer according to the states of all the communication terminals of the communication control circuit, specifically including: The first single-chip microcomputer sets the first communication terminal of the communication control circuit to an output state through the data output terminal of the first single-chip microcomputer, and the second single-chip microcomputer sets the second communication terminal of the communication control circuit to an input state through the data input terminal of the second single-chip microcomputer, and the first single-chip microcomputer enters a data sending mode; The first single-chip microcomputer updates data and sends data to the second single-chip microcomputer through the communication control circuit. After sending the data, the first single-chip microcomputer sets the third communication terminal of the communication control circuit to the input state through the data input terminal of the first single-chip microcomputer, and the first single-chip microcomputer enters a data receiving mode; and is ready to receive data returned by the second single-chip microcomputer; When the data input terminal of the second single-chip microcomputer receives the data from the first single-chip microcomputer, the second single-chip microcomputer processes and updates the system state of the second single-chip microcomputer; the second single-chip microcomputer sets the fourth communication terminal of the communication control circuit to the output state through the data output terminal of the second single-chip microcomputer, and the second single-chip microcomputer enters the data sending mode; The second single-chip microcomputer updates data and sends data to the first single-chip microcomputer through the communication control circuit. After sending the data, the second single-chip microcomputer enters the data receiving mode to wait for receiving the data returned by the first single-chip microcomputer. When the data input end of the first single-chip microcomputer receives the data from the second single-chip microcomputer, the first single-chip microcomputer is triggered to execute the above-mentioned operation of setting the first communication end of the communication control circuit to an output state through the data output end of the first single-chip microcomputer.
8. The control method for multi-chip microcomputer communication according to claim 7, characterized in that: When the first communication terminal of the communication control circuit is electrically connected to the data output terminal of the first single-chip microcomputer and the second communication terminal of the communication control circuit is electrically connected to the data input terminal of the second single-chip microcomputer, the state of the first communication terminal is an output state, the state of the second communication terminal is an input state, the first single-chip microcomputer is in a data sending mode, and the second single-chip microcomputer is in a data receiving mode; When the third communication terminal of the communication control circuit is electrically connected to the data input terminal of the first single-chip microcomputer and the fourth communication terminal of the communication control circuit is electrically connected to the data output terminal of the second single-chip microcomputer, the state of the third communication terminal is an input state, the state of the fourth communication terminal is an output state, the first single-chip microcomputer is in a data receiving mode, and the second single-chip microcomputer is in a data sending mode.
9. An electronic device, comprising a device body, characterized in that: The electronic device further comprises a control circuit for multi-microcontroller communication as claimed in any one of claims 1 to 6.
Citation Information
Patent Citations
Power supply communication circuit of cooking utensil and cooking utensil
CN216647139U