CN116360328A - MCU-based control device and method - Google Patents

MCU-based control device and method Download PDF

Info

Publication number
CN116360328A
CN116360328A CN202310452972.3A CN202310452972A CN116360328A CN 116360328 A CN116360328 A CN 116360328A CN 202310452972 A CN202310452972 A CN 202310452972A CN 116360328 A CN116360328 A CN 116360328A
Authority
CN
China
Prior art keywords
control
mcu
power supply
expander
output
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310452972.3A
Other languages
Chinese (zh)
Inventor
庄惠明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Rockchip Electronics Co Ltd
Original Assignee
Rockchip Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Rockchip Electronics Co Ltd filed Critical Rockchip Electronics Co Ltd
Priority to CN202310452972.3A priority Critical patent/CN116360328A/en
Publication of CN116360328A publication Critical patent/CN116360328A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0423Input/output
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/24Pc safety
    • G05B2219/24215Scada supervisory control and data acquisition
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a control device and a control method based on an MCU, which are characterized in that an I/O expander receives a control signal and then sends a wake-up instruction to the MCU to wake up the MCU, the MCU wakes up to acquire the control signal, and rewrites configuration information of the I/O expander according to the control signal, so that the I/O expander can output according to the updated configuration information to realize different control modes.

Description

MCU-based control device and method
Technical Field
The invention relates to the technical field of electronic circuits, in particular to a control device and a control method based on an MCU.
Background
Along with the development of intelligent home, intelligent home appliances and intelligent management and control integrated technologies, more and more home appliances and electronic products all adopt an MCU (Microcontroller Unit, microcontroller) mode to control the functional modules. That is, the power source such as the battery or the power supply terminal is required to supply power not only to the functional device or the home appliance but also to the MCU, resulting in an increase in the overall power consumption.
Aiming at the problems, the MCU does not work for a long time in most scenes, and only needs to wake up to process data when a user uses the MCU. In the prior art, two operation modes, namely a standby mode and a working mode, are usually set for the MCU, and the problem of excessive power consumption of the MCU is solved through switching between the standby mode and the working mode. However, even in standby mode, the MCU has standby power consumption. In addition, for an electric appliance such as a dimming color lamp, a water dispenser, etc., which needs to be in an operating state for a long period of time, the operating interval of the MCU may be short, so that it is difficult to enter a standby mode, resulting in an increase in power consumption.
Disclosure of Invention
The invention provides a control device and a control method based on an MCU, which can enable the MCU in a non-working state to achieve zero power consumption, thereby reducing the overall power consumption of equipment.
In one aspect of the invention, an MCU-based control device. The device comprises: an I/O extender configured to output a wake-up signal via a control output in response to receiving a control signal via a control signal input; a power supply control circuit configured to receive the wake-up signal via a first control input and to output a power supply voltage via an output in accordance with the wake-up signal; and the MCU is configured to receive the power supply voltage through a power supply input end, wake up according to the power supply voltage, and write configuration information into the configuration input end of the I/O expander through a configuration output end according to the control signal, so that the I/O expander outputs according to the configuration information.
In some embodiments, the MCU is further configured to save the configuration information of the I/O expander after writing the configuration information is completed and output a power down signal via a control terminal, the power supply control circuit is further configured to receive the power down signal via a second control input terminal and stop providing the power supply voltage to the MCU according to the power down signal, such that the MCU enters a power down state.
In some embodiments, the I/O extender is further configured to initialize and output a start signal via the control output in response to a power-up signal, the power supply control circuit is further configured to receive the start signal via the first control input and output the power supply voltage via the output in accordance with the start signal, the MCU is further configured to receive the power supply voltage via the power supply input, to be started in accordance with the power supply voltage, and to write the configuration information to the configuration input of the I/O extender via the configuration output.
In some embodiments, the MCU is configured to output a hold signal via a control terminal after being woken up or started up, and to output the configuration information to the I/O extender, the power supply control circuit is configured to continuously provide the power supply voltage to the MCU based on the hold signal.
In some embodiments, the I/O extender is further configured to convert the I2C signal to a GPIO signal.
In some embodiments, a configuration input of the I/O extender is connected with a configuration output of the MCU; the control output end of the I/O expander is connected with the first control input end of the power supply control circuit; the state output end of the I/O expander is connected with equipment to be controlled, and the control signal input end of the I/O expander is used for receiving a control signal; the control end of the MCU is connected with the second control input end of the power supply control circuit; the power supply input end of the MCU is connected with the output end of the power supply control circuit; the power supply input end of the I/O expander and the power supply end of the power supply control circuit are respectively connected with a total power supply.
In some embodiments, the power control circuit includes a first transistor, a second transistor, a first diode, and a first resistor; the first transmission end of the first transistor is respectively connected with one end of the first resistor and the total power supply; the control end of the first transistor is respectively connected with the other end of the first resistor, the second transmission end of the second transistor and the positive electrode of the first diode; the negative electrode of the first diode is connected with the control output end of the I/O expander; the second transmission end of the first transistor is connected with the power supply input end of the MCU; the control end of the second transistor is connected with the control end of the MCU, and the first end of the second transistor is grounded.
In some embodiments, the power control circuit further comprises a second resistor; one end of the second resistor is connected with the control end of the first transistor; the other end of the second resistor is connected with the control end of the second transistor.
In some embodiments, the power control circuit further comprises a third resistor; one end of the third resistor is connected with the control end of the second transistor; the other end of the third resistor is connected with the control end of the MCU.
In some embodiments, the first transistor and the second transistor are both MOS transistors or transistors, a first transmission end of the MOS transistor is a source electrode, a control end is a gate electrode, a second transmission end is a drain electrode, a first transmission end of the transistor is an emitter electrode, a control end is a base electrode, and a second transmission end is a collector electrode.
In some embodiments, the configuration input of the I/O extender and the configuration output of the MCU are I2C signal lines.
In some embodiments, the status outputs of the I/O expander include at least one output for connection to a device to be controlled; and the control signal input end of the I/O expander comprises at least one input end used for being connected with a control.
In another aspect of the invention, a control method based on MCU. The method comprises the following steps: receiving a control signal through an I/O expander, and sending out a wake-up instruction after receiving the control signal; receiving a wake-up instruction sent by the I/O expander through the MCU, acquiring the control signal, rewriting the configuration information of the I/O expander according to the control signal, and entering a power-off state after storing the configuration signal; and outputting an operation control signal to the equipment to be controlled according to the configuration information through the I/O expander.
In some embodiments, the method further comprises: receiving a control instruction sent by the MCU and the wake-up instruction sent by the I/O expander through a power supply control circuit, and generating a power supply control signal according to the wake-up instruction and the control instruction; and entering an awakening state or a power-off state by the MCU according to the control signal.
According to the embodiment of the invention, after the control signal input end of the I/O expander receives the control signal, a wake-up instruction is sent to the power supply input end of the MCU through the I/O expander, the first control input end of the power supply control circuit and the output end of the power supply control circuit in sequence, so that the MCU is waken up, the control signal is acquired after the MCU waken up, and configuration information rewritten according to the control signal is written into the I/O expander, so that the I/O expander can output according to the updated configuration information, and different control modes are realized. And, make MCU only produce the consumption in the wake-up time period to reduce the whole consumption of equipment.
Drawings
FIG. 1 is a schematic diagram of an MCU-based control device according to an embodiment of the present invention;
FIG. 2 is a schematic circuit diagram of an MCU-based control device according to an embodiment of the present invention applied to an automatic water dispenser control scenario;
fig. 3 is a flowchart illustrating steps of a control method based on an MCU according to an embodiment of the present invention.
Detailed Description
In order to describe the technical contents, the achieved objects and effects of the present invention in detail, the following description will be made with reference to the embodiments in conjunction with the accompanying drawings.
In the prior art, the energy consumption of the electronic device in the non-working period is reduced only by setting the standby mode for the electronic device, but even in the standby state, the device continuously consumes the electric energy, and the effective electricity saving effect cannot be achieved.
In order to solve at least the technical problems, the present disclosure provides a control device based on an MCU. According to the embodiment of the disclosure, the I/O expander, the MCU and the power supply control circuit are connected, after the control signal is received by the I/O expander, the power supply circuit is controlled to wake up the MCU, so that the MCU obtains the control signal and rewrites the configuration information of the I/O expander according to the control signal, and the I/O expander can output according to the updated configuration information, thereby realizing different control modes. In addition, through respectively supplying power to the I/O expander and the MCU, when the MCU enters a power-off state after finishing rewriting and storing the configuration information of the I/O expander, peripheral circuits such as the I/O expander and the like can keep a working state, and the MCU only generates power consumption in a short time after waking up, so that the overall power consumption of the equipment is greatly reduced. In this way, the technical scheme disclosed by the invention can be applied to the scenes of controlling the switch of an external power supply, the start and stop of equipment, a relay, the output of an alarm signal and the like.
Hereinafter, a technical scheme according to the present disclosure will be described with reference to specific embodiments and with reference to the accompanying drawings.
Fig. 1 is a schematic diagram illustrating an MCU-based control device 100 according to an embodiment of the present disclosure. Referring to FIG. 1, the apparatus 100 includes an I/O extender 102, an MCU104, and a power control circuit 106.
The I/O extender 102 is configured to output a wake-up signal via the control output in response to receiving the control signal via the control signal input. The power supply control circuit 106 is configured to receive the wake-up signal via a first control input and to output a power supply voltage (vcc_3v3) via an output according to the wake-up signal. Furthermore, the MCU104 is configured to receive the supply voltage via a supply input, to wake up in accordance with the supply voltage, and to write configuration information to a configuration input of the I/O extender 102 via a configuration output in accordance with the control signal, such that the I/O extender 102 outputs in accordance with the configuration information.
In some embodiments, the MCU104 is further configured to save the configuration information after completion of writing the configuration information to the I/O expander 102 and output a power down signal via a control terminal. The power supply control circuit 106 is further configured to receive the power down signal via a second control input and to stop providing the power supply voltage to the MCU104 according to the power down signal, such that the MCU104 enters a power down state. In this way, after the MCU104 completes rewriting and saving the configuration information of the I/O expander 102, the control end of the MCU104 outputs a power-down instruction to the second control input end of the power supply control circuit, so that the MCU104 enters a power-off state, and the MCU104 generates power consumption only in a short time after waking up, thereby greatly reducing the overall power consumption of the device.
In some embodiments, the I/O expander 102 is further configured to initialize and output a start signal via the control output in response to a power-on signal. The power supply control circuit 106 is further configured to receive the start-up signal via the first control input and to output the power supply voltage via the output according to the start-up signal. The MCU104 is further configured to receive the supply voltage via the supply input, to be activated in accordance with the supply voltage, and to write the configuration information to the configuration input of the I/O extender 102 via the configuration output.
In some embodiments, the MCU104 is configured to output a hold signal via a control terminal after being woken up or started, and to output the configuration information to the I/O extender 102. The power supply control circuit 106 is configured to continuously provide the supply voltage to the MCU104 based on the hold signal. In some embodiments, the I/O extender 102 is further configured to convert the I2C signal to a GPIO signal.
In some embodiments, a configuration input of the I/O expander 102 is connected to a configuration output of the MCU104, a control output of the I/O expander 102 is connected to a first control input of the power supply control circuit 106, a status output of the I/O expander 102 is connected to a device to be controlled, and a control signal input of the I/O expander 102 is configured to receive a control signal. The control end of the MCU104 is connected to the second control input end of the power supply control circuit 106, and the power supply input end of the MCU104 is connected to the output end of the power supply control circuit 106. The power supply input terminal of the I/O extender 102 and the power supply terminal of the power supply control circuit 106 are respectively connected with the total power supply. In this way, after receiving the control signal through the control signal input end of the I/O expander, the wake-up instruction is sent to the power supply input end of the MCU through the I/O expander, the first control input end of the power supply control circuit and the output end of the power supply control circuit in sequence, so that the MCU is waken up, the control signal is obtained after the MCU waken up, and the configuration information rewritten according to the control signal is written into the I/O expander, so that the I/O expander can output according to the updated configuration information, and different control modes are realized. Meanwhile, after the MCU is used for rewriting and storing the configuration information of the I/O expander, the control end of the MCU outputs a power-down instruction to the second control input end of the power supply control circuit so that the MCU enters a power-down state, and the I/O expander is directly powered through total power supply and is not influenced by the power supply of the MCU, so that the peripheral circuits such as the I/O expander are not influenced to keep a working state when the MCU enters the power-down state. Namely, the MCU is awakened to enter the working state only when the configuration of the I/O expander is required to be modified, and enters the power-off state after the configuration of the I/O expander is modified, and the MCU only generates power consumption in a short time after the configuration of the I/O expander is completed, so that the overall power consumption of the device is greatly reduced.
In some embodiments, the power control circuit 106 includes a first transistor Q1, a second transistor Q2, a first diode D2, and a first resistor R4. The emitter of the first transistor Q1 is connected to one end of the first resistor R4 and to a total power supply (vcc_3v3), respectively. The base electrode of the first triode Q1 is respectively connected with the other end of the first resistor R4, the collector electrode of the second triode Q2 and the anode of the first diode D2. The negative pole of the first diode D2 is connected to the control output (INT) of the I/O extender 102. The collector of the first triode Q1 is connected to the power supply input terminal (vcc_cpu) of the MCU 104. The base of the second triode Q2 is connected to the control terminal (GPIO 2) of the MCU104, and the emitter of the second triode Q2 is grounded. In this way, by setting the first resistor R4 between the base and the emitter of the first triode Q1 to form a resistor voltage division, providing a static operating point of the triode base, ensuring that the triode is reliably turned off, and by matching the first triode Q1, the second triode Q2 and the first diode D2, when the control output terminal (INT) of the I/O expander 102 outputs a low level, the first diode D2 is turned on and the base voltage of the first triode Q1 is pulled down, so that the first triode Q1 is also turned on to supply power to the MCU104, and when the MCU104 is operating normally, the base of the second triode Q2 is controlled through its control terminal (GPIO 2) to realize the on control of the second triode Q2 and the first triode Q1.
In some embodiments, the power control circuit 106 further includes a second resistor R5. One end of the second resistor R5 is connected to the base of the first triode Q1, and the other end of the second resistor R5 is connected to the emitter of the second triode Q2. In this way, the first triode Q1 can be prevented from being affected by the noise signal to generate misoperation, so that the first triode Q1 is more reliable to switch.
In some embodiments, the power control circuit 106 further includes a third resistor R6. One end of the third resistor R6 is connected to the base of the second triode Q2, and the other end of the third resistor R6 is connected to the control terminal (GPIO 2) of the MCU 104. In this way, the second triode Q2 can be prevented from being affected by the noise signal to generate misoperation, so that the second triode Q2 is more reliable to switch.
In some embodiments, the first transistor Q1 and the second transistor Q2 are replaced with a first MOS transistor and a second MOS transistor, respectively. The source electrode of the first MOS tube is respectively connected with one end of the first resistor R4 and the total power supply (VCC_3V3). The grid electrode of the first MOS tube is respectively connected with the other end of the first resistor R4, the drain electrode of the second MOS tube and the anode of the first diode D2. The drain electrode of the first MOS tube is connected with the power supply input end of the MCU104, the grid electrode of the second MOS tube is connected with the control end (GPIO 2) of the MCU104, and the source electrode of the second MOS tube is grounded. In this way, the device is provided with a plurality of optional circuit composition modes, so that different components can be selected according to different use scenes.
In some embodiments, the first diode D2 comprises a switch-mode transistor. In this way, the adoption of the switch type triode can effectively reduce reverse leakage current and improve circuit stability.
In some embodiments, the configuration input (SDA & SCL) of the I/O extender 102 and the configuration output (i2c_sda & i2c_scl) of the MCU104 are I2C signal lines. In this way, data transfer need only be achieved through the data lines and clock lines, simplifying the transmission line design.
In some embodiments, the status outputs of the I/O extender 102 include at least one output for connection to a device to be controlled, and the control signal inputs of the I/O extender 102 include at least one input for connection to a control. The control signal input end can be used for inputting a control signal from a touch screen, a signal of a wireless signal receiver or the on and off states of a key switch. In this way, the functions of controlling the switch of the external power supply, starting and stopping the equipment, the relay, the alarm signal output and the like can be realized by selecting different control modes according to the increase of the required functional circuits and the increase of the corresponding controls of the actual application scene, the requirements of the required control and the functional circuits in different scenes are met, and the practicability of the device is improved.
In the example of fig. 1, the above-described apparatus may be applied to, for example, control of LED lamps.
The model of the I/O expander 102 includes TCA955. The state output terminals (P00 and P01) of the I/O extender 102 are connected to the two LED lamps LED1 and LED2, respectively, and the control signal input terminals (P10 and P11) of the I/O extender 102 are connected to the first key SW1 and the second key SW2, respectively, i.e., the control signal input terminals are used for inputting the pressed state of the key switch. The status output terminal and the control signal input terminal of the I/O expander 102 may select corresponding pins from the pins P00 to P17 as the status output terminal or the control signal input terminal of the I/O expander 102 according to design requirements. The specific working principle of the circuit is as follows:
after the device 100 is powered up, i.e., vcc_3v3, the system is powered. At this time, the I/O expander 102 is not initialized, and its control output terminal (INT) outputs a low level. The negative pole of current first diode D2 is low level, and first diode D2 switches on for first triode Q1's base is pulled to low level, and thereby first triode Q1 switches on, makes total power supply provide 3.3V voltage for MCU 104's power supply input (VCC_CPU) through first triode Q1, and MCU104 normally works this moment.
After the MCU104 is powered on and operates normally, its control terminal (GPIO 2) outputs a high level to the base of the second transistor Q2, so that the second transistor Q2 is turned on and pulls the base of the first transistor Q1 to a low level. At this time, the first triode Q1 is kept in a conducting state, and the power supply input terminal (vcc_cpu) of the MCU104 is not controlled by the first diode D2, so as to keep stable operation.
MCU104 initializes I/O expander 102 via configuration outputs (I2C_SDA and I2C_SCL), and configures the state outputs (P00 and P01) of I/O expander 102 to be high or low as needed, the state of I/O expander 102 being configurable only via I2C. After the configuration of the MCU104 is completed, the configuration information is stored in the FLASH. Configuration information such as: the state output P00 of the I/O expander 102 is low, and the LED1 is lighted; the state output terminal P01 is high and the LED2 is not lit. At the same time, the control output (INT) of the I/O expander 102 returns to a high level, and the state of the first transistor Q1 is no longer controlled.
MCU104 enters the power-down flow after finishing the configuration information storage. The control terminal (GPIO 2) of the MCU104 outputs a low level again, so that the second transistor Q2 is turned off, and after the base of the first transistor Q1 is restored to a high level, the first transistor Q1 is turned off, so that the total power supply cannot supply voltage to the MCU 104. That is, the MCU104 does not consume power at present, only the I/O extender 102 and LEDs 1 and 2 are consuming power.
The MCU104 wakes up through the first key SW1 and the second key SW 2. After the first key SW1 and the second key SW2 are pressed, the state output end (P00 & P01) of the I/O extender 102 can be turned over, for example, from high to low or from low to high, and the specific working principle is as follows.
After the first key SW1 is pressed, the control output terminal (INT) of the I/O extender 102 outputs a low level signal, and at this time, the first diode, the first triode and the second triode are all turned on, i.e. the total power supply provides 3.3V for the MCU104, and at this time, the MCU104 works normally. MCU104 is according to the configuration information of U1 that FLASH preserved: p00 is low, P01 is high, and the state output terminal P00 of the I/O expander 102 is inverted, i.e., turned to P00 high. Subsequently, the MCU104 enters a power-down process after completing the configuration information storage, and stops consuming power. That is, the MCU104 performs the state detection of the first key SW1 and the second key SW2 only for a short time after waking up, and the rest of the time is in the off state, thereby achieving the effect of reducing the operation power consumption of the device. By adopting the scheme, the working current and the standby current of the equipment can be obviously reduced. When both the LED1 and the LED2 are in the off state, since the MCU104 does not work and consumes power, only the I/O expander 102 is in the standby state, so that the working current in the standby state is reduced to within 30 uA.
Fig. 2 is a schematic circuit diagram illustrating a control scenario in which the MCU-based control device 200 according to an embodiment of the present disclosure is applied to an automatic water dispenser. Referring to fig. 2, in the device 200, a state output terminal P00 of the I/O expander 102 is connected to a water outlet module of the water dispenser, a state output terminal P01 is connected to the LED3, and control signal input terminals (P10 and P11) of the I/O expander 102 are respectively connected to the first key SW1 and the second key SW2, i.e. the control signal input terminals are used for inputting the pressing state of the key switch. And is set to realize the following functions.
Function 1: lightly pressing the first key SW1 to discharge water for 5 seconds; continuously discharging water by long-time pressing of the first key SW 1; releasing the first button SW1 stops the water discharge.
Function 2: when the second key SW2 is pressed, the illumination lamp of the water dispenser is turned on, and when the second key SW2 is pressed again, the illumination lamp of the water dispenser is turned off.
The specific working principle is as follows.
When the first key SW1 is pressed, the MCU104 is powered to work normally; the MUC 104 configures the state output end P00 of the I/O expander 102 to output a high level through the I2C interface, so that after the triode Q5 is conducted, the contact of the relay RE1 is attracted, and the power supply (VCC_12V) supplies power to the water outlet module of the water dispenser through the relay RE1 to control the water outlet of the water outlet.
After the internal clock of the MCU104 is clocked for 5 seconds, the state output end P00 of the I/O expander 102 is configured through the I2C interface to output a low level, so that after the triode Q5 is cut off, the contact of the relay RE1 is disconnected, and the power supply (VCC_12V) stops supplying power to the water outlet module of the water dispenser, and water outlet is stopped. Subsequently, the MCU104 enters a power-down process after completing the configuration information storage, and stops consuming power. The whole device only has the I/O expander 102 in an operating state, and consumes electric energy.
The implementation of the function 2 is the same as the control of the LEDs 1 and 2 described above, and the transistor Q6 is added to make the operation of the LED3 more stable.
In another aspect of the present invention, fig. 3 is a schematic diagram illustrating an MCU-based control method 300 according to an embodiment of the present invention. Referring to fig. 3, the method 300 includes the following steps S302 to S306.
In step S302, a control signal is received through the I/O expander 102, and a wake-up instruction is issued after the control signal is received.
In step S304, a wake-up instruction sent from the I/O extender 102 is received by the MCU104, the control signal is obtained, the configuration information of the I/O extender 102 is rewritten according to the control signal, and the power-off state is entered after the configuration signal is saved.
In a substep S306, an operation control signal is output to the device to be controlled through the I/O expander 102 according to the configuration information.
In some embodiments, the method 300 may further include receiving, by the power control circuit 106, a control instruction from the MCU104 and the wake-up instruction from the I/O extender 102, generating a power control signal according to the wake-up instruction and the control instruction, and entering, by the MCU104, a wake-up state or a power-off state according to the control signal.
In summary, the invention provides a control device and a method based on an MCU, which are characterized in that after receiving a control signal, an I/O expander sends a wake-up instruction to the MCU to wake up the MCU, the MCU obtains the control signal after waking up, and rewrites configuration information of the I/O expander according to the control signal, so that the I/O expander can output according to the updated configuration information, and different control modes are realized. Meanwhile, when the MCU rewrites and stores the configuration information of the I/O expander, the configuration information enters a power-off state, and the I/O expander is directly powered by the total power supply and is not affected by the power supply of the MCU, so that the peripheral circuits such as the I/O expander are not affected to keep a working state when the MCU enters the power-off state. Namely, the MCU is awakened to enter the working state only when the configuration of the I/O expander is required to be modified, and enters the power-off state after the configuration of the I/O expander is modified, and the MCU only generates power consumption in a short time after the configuration of the I/O expander is completed, so that the overall power consumption of the device is greatly reduced.
The foregoing description is only illustrative of the present invention and is not intended to limit the scope of the invention, and all equivalent changes made by the specification and drawings of the present invention, or direct or indirect application in the relevant art, are included in the scope of the present invention.

Claims (14)

1. An MCU-based control device, comprising:
an I/O extender configured to output a wake-up signal via a control output in response to receiving a control signal via a control signal input;
a power supply control circuit configured to receive the wake-up signal via a first control input and to output a power supply voltage via an output in accordance with the wake-up signal; and
and the MCU is configured to receive the power supply voltage through a power supply input end, wake up according to the power supply voltage, and write configuration information into the configuration input end of the I/O expander through a configuration output end according to the control signal so that the I/O expander outputs according to the configuration information.
2. The control device of claim 1, wherein the MCU is further configured to save the configuration information after completion of writing the configuration information of the I/O expander, and to output a power down signal via a control terminal,
the power supply control circuit is further configured to receive the power down signal via a second control input and to stop providing the power supply voltage to the MCU in accordance with the power down signal, such that the MCU enters a power down state.
3. The control device of claim 1, wherein the I/O extender is further configured to initialize and output a start signal via the control output in response to a power-on signal,
the supply control circuit is further configured to receive the start-up signal via the first control input, and to output the supply voltage via the output in dependence of the start-up signal,
the MCU is further configured to receive the supply voltage via the supply input, to be activated in accordance with the supply voltage, and to write the configuration information to the configuration input of the I/O extender via the configuration output.
4. The control device according to claim 1 or 3, wherein the MCU is configured to output a hold signal via a control terminal after being woken up or started, and to output the configuration information to the I/O extender,
the power supply control circuit is configured to continuously supply the power supply voltage to the MCU based on the hold signal.
5. The control device of claim 1, wherein the I/O extender is further configured to convert an I2C signal to a GPIO signal.
6. The control device of claim 1, wherein a configuration input of the I/O extender is connected to a configuration output of the MCU;
the control output end of the I/O expander is connected with the first control input end of the power supply control circuit;
the state output end of the I/O expander is connected with equipment to be controlled, and the control signal input end of the I/O expander is used for receiving a control signal;
the control end of the MCU is connected with the second control input end of the power supply control circuit;
the power supply input end of the MCU is connected with the output end of the power supply control circuit;
the power supply input end of the I/O expander and the power supply end of the power supply control circuit are respectively connected with a total power supply.
7. The control device according to claim 1, wherein the power supply control circuit includes a first transistor, a second transistor, a first diode, and a first resistor;
the first transmission end of the first transistor is respectively connected with one end of the first resistor and the total power supply;
the control end of the first transistor is respectively connected with the other end of the first resistor, the second transmission end of the second transistor and the positive electrode of the first diode;
the negative electrode of the first diode is connected with the control output end of the I/O expander;
the second transmission end of the first transistor is connected with the power supply input end of the MCU;
the control end of the second transistor is connected with the control end of the MCU, and the first end of the second transistor is grounded.
8. The control device of claim 7, wherein the power control circuit further comprises a second resistor;
one end of the second resistor is connected with the control end of the first transistor;
the other end of the second resistor is connected with the control end of the second transistor.
9. The control device of claim 7, wherein the power control circuit further comprises a third resistor;
one end of the third resistor is connected with the control end of the second transistor;
the other end of the third resistor is connected with the control end of the MCU.
10. The control device according to any one of claims 7 to 9, wherein the first transistor and the second transistor are each a MOS transistor or a triode,
the first transmission end of the MOS tube is a source electrode, the control end is a grid electrode, the second transmission end is a drain electrode,
the first transmission end of the triode is an emitter, the control end is a base, and the second transmission end is a collector.
11. The control device of claim 1, wherein the configuration input of the I/O expander and the configuration output of the MCU are I2C signal lines.
12. The control device according to claim 1, wherein the status outputs of the I/O expander comprise at least one output for connection to a device to be controlled; and
the control signal input of the I/O extender comprises at least one input for connection to a control.
13. An MCU-based control method, comprising:
receiving a control signal through an I/O expander, and sending out a wake-up instruction after receiving the control signal;
receiving a wake-up instruction sent by the I/O expander through the MCU, acquiring the control signal, rewriting the configuration information of the I/O expander according to the control signal, and entering a power-off state after storing the configuration signal; and
and outputting an operation control signal to equipment to be controlled according to the configuration information through the I/O expander.
14. The control method according to claim 13, characterized by further comprising:
receiving a control instruction sent by the MCU and the wake-up instruction sent by the I/O expander through a power supply control circuit, and generating a power supply control signal according to the wake-up instruction and the control instruction;
and entering an awakening state or a power-off state by the MCU according to the power supply control signal.
CN202310452972.3A 2023-04-25 2023-04-25 MCU-based control device and method Pending CN116360328A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310452972.3A CN116360328A (en) 2023-04-25 2023-04-25 MCU-based control device and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310452972.3A CN116360328A (en) 2023-04-25 2023-04-25 MCU-based control device and method

Publications (1)

Publication Number Publication Date
CN116360328A true CN116360328A (en) 2023-06-30

Family

ID=86909346

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310452972.3A Pending CN116360328A (en) 2023-04-25 2023-04-25 MCU-based control device and method

Country Status (1)

Country Link
CN (1) CN116360328A (en)

Similar Documents

Publication Publication Date Title
US7065664B2 (en) Power management for a PDA system
CN114089714B (en) portable electronic device
CN213601084U (en) Switch control circuit and endoscope system
CN111756091A (en) Power supply switching circuit and intelligent door lock
CN116360328A (en) MCU-based control device and method
CN101625588A (en) Supply circuit of PWM controller
CN112600283B (en) Startup and shutdown circuit
CN107741865B (en) Standby system capable of self-awakening and standby method
CN101206457B (en) Power management system and method
CN210609113U (en) One-key switching circuit
CN218570212U (en) Startup and shutdown circuit and intelligent device
CN211209687U (en) Self-holding switch circuit for sleep function based on triode and microcontroller
CN218213842U (en) Key awakening circuit applied to frame circuit breaker
CN115664874B (en) Switching device and method suitable for home gateway
CN217010957U (en) Power-on and power-off control circuit and image pickup apparatus
CN217824413U (en) Uninterrupted power supply switching control circuit and device
CN211086971U (en) Micro control unit management circuit
CN110764398A (en) Intelligent watch and mode switching method thereof
CN113359936B (en) Power control method, power control circuit, device and household appliance
CN216748474U (en) Power supply sequential control circuit
CN218949108U (en) Power wake-up sleep circuit and vehicle
CN110764397B (en) Intelligent watch and mode switching method thereof
CN220962186U (en) Power management control circuit
CN216647307U (en) Low-power-consumption timing startup and shutdown circuit
CN220964973U (en) Intelligent standby television

Legal Events

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