The present invention relates to a method for forcibly resetting a microcontroller, and particularly to a method for forcibly resetting a microcontroller through an external switching module.
As information equipments continue to evolve, in order to ensure these information equipments obtain stable power, many industrialist have proposed power supplies with a communication function. Such power supply is capable of communicating with a load to provide at least one operating parameter of the power supply in operation. The load may then learn an operating status of the power supply according to the operating parameter. More specifically, the load is an information equipment, in which a baseboard management controller (BMC) communicates with the power supply through a power management bus (PMbus) to obtain the operating status of the power supply.
However, in actual operations, the PMbus is prone to abnormalities due to external factors, such that the BMC may fail to reliably obtain the operating status of the power supply, hence disfavoring the operations of the information equipment.
In view of the above, there are developers that raised technical solutions for reactivating a microcontroller used for communication in the power supply by using software. For example, these conventional solutions include disclosures of the Taiwan Patent Publication No. 201007444 and the Taiwan Patent No. 1305308.
In the above disclosures providing technical solutions for self-activating the microcontroller by software, the microcontroller is merely reactivated, and electrical signals in the microcontroller are not in fact cleared. Thus, after the microcontroller is reactivated, the abnormality in the PMbus still reside to cause the software to consistently reactivate the microcontroller, hence undesirably affecting the life cycle of the power supply.
The primary object of the present invention is to solve the issue that a microcontroller cannot be reliably reset by software.
To achieve the above object, the present invention provides a method for forcibly resetting a microcontroller. The method includes following steps.
In step 1, a switching module is provided, the switching module is caused to obtain an operating power from a power source to power a microcontroller, and a control pin of the switching module is connected a notification port of a load.
In step 2, the microcontroller is activated and caused to communicate with the load, and the switching module detects through the control pin whether the load changes a potential level of the notification port in response to a communication error between the load and the microcontroller detected by the load. The switching module is caused to continue providing the microcontroller with the operating power if the potential level of the notification port is not changed, or else the method proceeds to a next step.
In step 3, the change in the potential level of the notification port is received, and a powering status of the switching module is switched to stop providing the microcontroller with the operating power to cause the microcontroller to stop operating.
In step 4, it is detected through the control pin whether the load again changes the potential level of the notification port in response to the microcontroller having stopped operating, and the when it is detected that the potential level of the notification port is changed, the powering status of the switching module is switched to again provide the microcontroller with the operating power to cause the microcontroller to reactivate.
In one embodiment, step 2 further comprises a sub-step of causing the load to enter an communication error detection mode, and changing the potential level of notification port when the load discovers the communication error in the communication error detection mode.
In one embodiment, when the load is in the communication error detection mode and detects whether the communication between the load and the microcontroller is normal or the microcontroller is turned off, the load causes the potential level of the notification port to be at a low potential level.
In one embodiment, the switching module includes a ground pin, a power connecting pin connected to the power source, a power supplying pin connected to the microcontroller, and a switching unit that determines whether to connect the power supplying pin to the ground pin or the power connecting pin according to the detection result of the control pin.
In one embodiment, step 4 further includes a sub-step of setting the load wait for a resetting period before detecting whether the microcontroller stops operating to again change the potential level of the notification port.
In one embodiment, the microcontroller and the switching module are built in a power supply, and the microcontroller communicates with the load through a power management bus (PMbus).
In one embodiment, the power source is a standby power output loop of the power supply, and the operating power is a standby power that the standby power output loop provides to the switching module.
The solution of the present invention provides features below compared to the prior art. Through the switching module of the present invention, the potential level of all components of the microcontroller is completely disconnected and cleared during the process of the resetting the microcontroller to reliably achieve the object of resetting, thereby solving the issue that the microcontroller cannot be reliably reset in the prior art.
Details and technical contents of the present invention are given with the accompanying drawings below.
Referring to
In step 1 (500), a switching module 4 is provided, the switching module 4 is caused to obtain an operating power from a power source to power the microcontroller 1, and a control pin 41 of the switching module 4 is connected to a notification port 31 of the load 3.
In step 2 (501), the microcontroller 1 is activated to cause the microcontroller 1 to communicate with the load 3, and the switching module 4 detects through the control pin 41 whether the load 3 changes the potential level of the notification port 31 in response a communication error between the load 3 and the microcontroller 1 detected by the load 3. If the potential level of the notification port 31 is not changed, the switching module 4 is caused to continue providing the microcontroller 1 with the operating power, or else the method proceeds to a next step.
In step 3 (502), the change in the potential level of the notification port 31 is received, and the powering status of the switching module 4 is switched to stop providing the microcontroller 1 with the operating power to cause the microcontroller 1 to stop operating.
In step 4 (503), it is detected through the control pin 41 whether the load 3 again changes the potential level of the notification port 31 in response to the microcontroller 1 having stopped operating, and when the change in the potential level of the notification port 31 is detected, the powering status of the switching module 4 is switched to again provide the microcontroller 1 with the operating power to cause the microcontroller 1 to reactivate.
The microcontroller 1 and the switching module 4 of the present invention are built in the power supply 2. The microcontroller 1 includes at least one power input pin 11, obtains power for operations through the power input pin 11 and performs power management operations after being activated. For example, the so-called power management operations include detecting the operating status of the power supply 2 to output at least one operating parameter. In one embodiment, the microcontroller 1 may also output a pulse width modulation (PWM) signal to the switch element 24. Further, the microcontroller 1 communicates with the load 3 after being activated to transmit a message to the load 3 or to receive a message from the load 3. In this embodiment, the microcontroller 1 communicates with the load 3 according to PMbus communication specifications.
The switching module 4 of the present invention may be implemented by a microchip, and at least includes the control pin 41 connected to the notification port 31. The control pin 41 is directly electrically connected to the notification port 31 to obtain the change in the potential level of the notification port 31. In addition to the control pin 41, the switching module 4 further includes a ground pin 42, a power supplying pin 43 connected to the power input pin 11 of the microcontroller 1, a power connecting pin 44, and a switching unit 45 that determines to connect the power supplying pin 43 to the ground pin 42 or the power connecting pin 44 according to the detection result of the control pin 41. The connection status of the switching unit 45 determines the powering status of the switching module 4. More specifically, the switching module 4 of the present invention has the powering status and a power suspended status. In the powering status, the power supplying pin 43 is connected to the power connecting pin 44 to output the operating to the microcontroller 1. In the power suspended status, the power supplying pin 43 is connected to the ground pin 42 such that the operating power cannot be outputted to the microcontroller 1. In the embodiment, the power connecting pin 44 of the switching module 4 is connected to the standby power output loop 252 of the power supply 2, in a way that the standby power output loop 252 is considered as the power source, and the standby power 5VSB that the standby power output loop 252 provides to the switching module 4 serves as the operating power. The switching module 4 further includes a power pin 46 connected to the standby power output loop 252. The power pin 46 receives the standby power 5VSB to cause the switching module 4 to activate and operate using the standby power 5VSB.
Referring to
Referring to
Referring to
Further, to ensure that the microcontroller 1 does reactivate, step 504 of the method of the present invention further includes sub-step 505. In sub-step 505, the load 3 is set wait for a resetting period before detecting whether the microcontroller 1 stops operating to again change the potential level of the notification port 31.
Number | Date | Country | Kind |
---|---|---|---|
105108052 | Mar 2016 | TW | national |