Disclosure of Invention
The application provides a soft switch control circuit and a control method, and the soft switch control circuit comprises a key module, a first switch module, a second switch module and a logic module, wherein the key module is connected with the first switch module, the input end of the first switch module is connected with the control module, the output end of the first switch module and the second switch module are respectively connected with the input end of the logic module, the output end of the logic module is connected with the power module, the first switch module is connected with the control module through a resistor and a diode, the power module is used for supplying power to the control module, the control module is a control chip of different types, and the soft switch control circuit is used for controlling the power on or off of the power module.
In a first aspect, some embodiments of the present application provide a soft switch control circuit, the soft switch control circuit including a key module, a first switch module, a second switch module, and a logic module, wherein:
The key module is connected with the first switch module, the input end of the first switch module is connected with the control module, the output end of the first switch module and the second switch module are respectively connected with the input end of the logic module, the output end of the logic module is connected with the power module, the first switch module is connected with the control module through a resistor and a diode, the power module is used for supplying power to the control module, the control module is a control chip of different types, and the soft switch control circuit is used for controlling the power module to be electrified or powered off.
The control module in some embodiments of the application can be a single chip microcomputer of different types, realizes soft shutdown, avoids using a special chip, reduces cost, can adapt to various different types of processing chips, realizes soft shutdown through a soft switch control circuit, avoids using a special chip, reduces cost, and can adapt to various different types of processing chips.
Optionally, one end of the key module is connected with a third pin of the first switch module, and a second pin of the first switch module is connected with a second pin of the logic module.
Some embodiments of the present application may control the power chip to power up or power down by connecting the key to the first switch module, which is in turn connected to the logic module.
Optionally, the first pin of the second switch module is connected to a 3.3V voltage, and the third pin of the second switch module is connected to the second pin of the logic module and to the second pin of the first switch module.
In some embodiments of the present application, the second switch module is connected to the logic module, and when the second switch module is turned on, the terminal device can work normally.
Optionally, the third pin of the first switch module is connected with the first end of the seventy-fourth diode through a seventy-sixth resistor, and the second end of the seventy-fourth diode is connected with the control pin of the control module.
In some embodiments of the present application, the third pin of the first switch module is connected to the control pin of the control module through a seventy-sixth resistor, so as to implement system shutdown on the terminal device.
Optionally, a sixth pin of the logic module is connected to the power module.
In some embodiments of the present application, the sixth pin of the logic module is connected to the power module to control the power-on and power-off of the power chip.
Optionally, the first switch module is a PNP triode, and the second switch module is an NPN triode.
In some embodiments of the present application, the PNP transistor needs to have good turn-off performance to ensure that the KEY is not hard turned off when the power is turned on, and the NPN transistor needs good turn-on performance to ensure that the KEY signal is low when the pwr_ctrl is pulled low.
Optionally, the logic module is a bistable logic chip.
The logic module in some embodiments of the application is a bistable logic chip, and the power-on and power-off of the power module is controlled by turning over the output signal.
Optionally, the seventy-fourth diode is a schottky diode.
The diode in some embodiments of the application selects a schottky diode, the lower the turn-on voltage.
In a second aspect, some embodiments of the present application provide a soft switch control method applied to the soft switch control circuit of any one of the first aspect, the method including:
In the starting process, the button module is pressed, the first switch module is conducted, so that the logic module outputs high level to supply power for the power module;
in the normal working process, the first switch module is turned off, the button module is pressed down, and the second switch module is turned on;
And in the shutdown process, the button module is pressed for preset time, the first switch module is cut off, when the control module detects that the duration of the low level is the preset time, data are stored in the storage module, the second switch module is conducted, the logic module outputs the low level, and the power supply module is controlled to be powered off.
In a third aspect, some embodiments of the present application provide a terminal device, at least including the soft switch control circuit according to any one of the embodiments of the first aspect.
Detailed Description
The technical solutions of some embodiments of the present application will be described below with reference to the drawings in some embodiments of the present application.
It should be noted that like reference numerals and letters refer to like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only to distinguish the description, and are not to be construed as indicating or implying relative importance.
The device with the storage often cannot be directly powered off or key-press is turned off, so that data is lost, and a storage chip is seriously damaged, so that economic loss is caused. The correct shutdown logic is that the device needs to write data into the memory chip when the key is turned off. This requires that after the key is pressed, the device still remains powered normally until the main chip has completed the data writing operation simply and shuts down most of the running processes, and then controls the power chip to power down. This process is often referred to as soft-off, as opposed to hardware direct power-off. At present, to realize soft shutdown, a PMU chip with soft shutdown function is required, but the chip has a high price and cannot be universally applied to various CPUs or MCUs, so how to realize soft shutdown and low cost can be adapted to various processing chips is a problem to be solved at present, and in view of this, some embodiments of the present application provide a soft switch control circuit, a control method and a terminal device, where the soft switch control circuit includes: the device comprises a key module, a first switch module, a second switch module and a logic module, wherein the key module is connected with the first switch module, the input end of the first switch module is connected with a control module, the output end of the first switch module and the second switch module are respectively connected with the input end of the logic module, the output end of the logic module is connected with a power supply module, and the power supply module is used for supplying power to the control module; the control module is a control chip of different types, the soft switch control circuit is used for controlling the power supply module to be powered on or powered off, and soft switch control circuit provided by the application realizes soft switch off, avoids using a special chip, reduces cost and can be adapted to various processing chips of different types.
As shown in fig. 1, an embodiment of the present application provides a soft switch control circuit, which includes a key module S3, a first switch module Q13, a second switch module Q14, and a logic module U60, wherein:
The key module S3 is connected with the first switch module Q13, the input end of the first switch module Q13 is connected with the control module, the output end of the first switch module Q13 and the second switch module Q14 are respectively connected with the input end of the logic module U60, the output end of the logic module U60 is connected with the power supply module, the power supply module is used for supplying power to the control module, the first switch module Q13 is connected with the control module through the resistor R76 and the diode D74, the control module is a control chip of different types, and the soft switch control circuit is used for controlling the power supply module to be electrified or powered off.
The key module is a touch key, the key module is connected with the ground through an ESD24, the ESD24 is an ESD device, the first switch module and the second switch module are triodes, the logic modules are bistable logic chips, and the control module can be different types of processor chips, and the specific model and brand of the processor chips are not limited.
The circuit diagram shown in fig. 1 is applied to a terminal device with a processor chip as a main control, a memory chip on the terminal device is an EMMC (Embedded Multi MEDIA CARD, embedded memory), after a tap switch (key module) is pressed for 3 seconds, the processor chip stores data back into the EMMC chip, and then the system is turned off and the power supply chip is controlled to be powered off.
The flexible, reliable and low-cost soft shutdown circuit provided by the embodiment of the application can be realized by only matching the input/output interface GPIO of the processor chip with the resistor and the capacitor through the two triodes, and the shutdown time after the key is pressed can be set by software.
The control module in some embodiments of the application can be a single chip microcomputer of different types, realizes soft shutdown, avoids using a special chip, reduces cost, can adapt to various different types of processing chips, realizes soft shutdown through a soft switch control circuit, avoids using a special chip, reduces cost, and can adapt to various different types of processing chips.
In a further embodiment of the present application, the soft switch control circuit provided in the above embodiment is further described in a supplementary manner.
Optionally, one end of the key module, that is, the second pin is connected to the third pin of the first switch module Q13, and the second pin of the first switch module Q13 is connected to the second pin of the logic module U60.
Some embodiments of the present application may control the power chip to power up or power down by connecting the key to the first switch module, which is in turn connected to the logic module.
Optionally, a first pin of the second switch module Q14 is connected to a 3.3V voltage, and a third pin of the second switch module Q14 is connected to a second pin of the logic module U60 and to a second pin of the first switch module Q13.
In some embodiments of the present application, the second switch module is connected to the logic module, and when the second switch module is turned on, the terminal device can work normally.
Optionally, the third pin of the first switch module Q13 is connected to the first end of the seventy-fourth diode D74 through a seventy-sixth resistor R76, and the second end of the seventy-fourth diode D74 is connected to the control pin of the control module.
In some embodiments of the present application, the third pin of the first switch module is connected to the first end of the seventy-fourth diode through the seventy-sixth resistor, and the second end of the seventy-fourth diode is connected to the control pin of the control module, so as to implement system shutdown on the terminal device.
Optionally, the sixth pin of the logic module U60 is connected to the power module.
In some embodiments of the present application, the sixth pin of the logic module is connected to the power module to control the power-on and power-off of the power chip.
Optionally, the first switching module Q13 is a PNP transistor, and the second switching module Q14 is an NPN transistor.
The first pin of the first switch module is connected with a resistor R74, and the 5V direct current is connected with the resistor R74 through a D73.
Wherein D73, D74 are schottky diodes, Q13 is a PNP transistor, and Q14 is an NPN transistor.
Illustratively, the PNP transistor may be BC858A, and table 1 is BC858A, as shown in table 1:
TABLE 1
The PNP triode needs to have good turn-off performance, so that the key can not be hard-turned off when the PNP triode is turned on, and the PNP triode BC858A of Diotec company has good turn-off performance when-V EB=5V,-IEBO = 100 nA;
NPN triode BC848A, table 2 is the main parameters of BC848A, as shown in Table 2:
TABLE 2
The NPN transistor needs good conductivity to ensure that the KEY signal is low when PWR_CTRL is pulled low. Diotec company NPN transistor BC848A when VBEsat =700 mv, ic=10ma, is sufficient to ensure that the KEY signal is pulled low, meeting the requirements.
In some embodiments of the present application, the PNP transistor needs to have good turn-off performance to ensure that the KEY is not hard turned off when the power is turned on, and the NPN transistor needs good turn-on performance to ensure that the KEY signal is low when the pwr_ctrl is pulled low.
Optionally, the logic module is a bistable logic chip.
The U60 chip is 5BE1-2C72, is a bistable logic chip, and is normally powered by VDD_5V. The power-on does not work, the 6 th pin outputs a low level, the 2 nd pin is pulled down, the 6 th pin level is turned over to output a high level, the 2 nd pin is pulled down again, and the 6 th pin outputs a low level.
The logic module in some embodiments of the application is a bistable logic chip, and the power-on and power-off of the power module is controlled by turning over the output signal.
Optionally, the seventy-fourth diode is a schottky diode.
The diode in some embodiments of the application selects a schottky diode, the lower the turn-on voltage.
The schottky diode D74 was BAT46W, and table 3 shows the main parameters of BAT46W, as shown in table 3:
TABLE 3 Table 3
The choice of D74 requires extra care and the lower the turn-on voltage the better. The schottky diode BAT46W of Diotec company has a turn-on voltage less than 0.25V (the IO port input detection mode current of H3 is very small, less than 0.1 mA), which is recognized as low for both the normal MCU and CPU.
It should be noted that, in this embodiment, each of the embodiments may be implemented separately, or may be implemented in any combination without conflict, without limiting the application.
Another embodiment of the present application provides a soft switch control method, which is applied to any one of the soft switch control circuits, and the method includes:
in the starting process, the button module is pressed, the first switch module is conducted, so that the logic module outputs high level to supply power for the power module;
in the normal working process, the first switch module is turned off, the button module is pressed, and the second switch module is turned on;
In the shutdown process, the button module is pressed for preset time, the first switch module is turned off, when the control module detects that the duration time of the low level is the preset time, data are stored in the storage module, the second switch module is conducted, the logic module outputs low level, and the power supply module is controlled to be powered off.
The starting process includes the steps of pressing S3, pulling down a first pin and a third pin of a PNP triode Q13, conducting a first switch module Q13, pulling down a signal KEY, pulling down a second pin of a chip U60, outputting a high level by a sixth pin, enabling a POWER chip by using a POWER_EN as the high level, and starting to work when a system installed on terminal equipment is electrified;
Normally working, wherein VCC-5V is 5V voltage, a first pin and a third pin of a first switch module Q13 are pulled high, the first switch module Q13 is cut off, a key module S3 is pressed at the moment, the first switch module Q13 does not act, VCC-3V3 is 3.3V, and a second switch module Q14 is conducted;
The shutdown process comprises the steps of pressing S3 for 3S, turning off the first switch module Q13, pulling down the CPU_DET through R76 and D74, storing data into the storage module EMMC after the control module CPU detects the low level 3S, closing a system on the terminal equipment, and then controlling the PWR_CTRL to output the low level, wherein the second switch module Q14 is turned on, so that the signal KEY is pulled down, the sixth pin of the logic module U6 is turned to the low level, the POWER_EN outputs the low level, the POWER chip is turned off, and the system is powered off.
Some embodiments of the present application provide a terminal device, at least including the soft switch control circuit described above.
The terminal equipment provided by the embodiment of the application comprises a soft switch control circuit which is respectively connected with the power supply module and the control module, and can be a computer and used with a server to realize the peripheral interaction functions of multimedia, a mouse, a keyboard and the like. After the user key is turned off, some multimedia data needs to be restored, so that the function of soft-off is needed.
The soft switch control circuit comprises a key module, a first switch module, a second switch module and a logic module, wherein the key module is connected with the first switch module, the input end of the first switch module is connected with the control module, the output end of the first switch module and the output end of the second switch module are respectively connected with the input end of the logic module, the output end of the logic module is connected with a power supply module, the power supply module is used for supplying power to the control module, the control module is a control chip of different types, and the soft switch control circuit is used for controlling the power supply module to be powered on or powered off.
The specific manner in which the individual modules perform the operations of the apparatus of this embodiment has been described in detail in connection with embodiments of the method and will not be described in detail herein.
It should be noted that, in this embodiment, each of the embodiments may be implemented separately, or may be implemented in any combination without conflict, without limiting the application.
The above embodiments of the present application are only examples, and are not intended to limit the scope of the present application, and various modifications and variations will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application. It should be noted that like reference numerals and letters refer to like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.