Closed samchoy88 closed 9 years ago
Put a 10K pull low resistor at Q4 MOSFET gate can eliminate the bug. It works now !
It looks like the functions of SW_PWR and PWR_ONOFF are reversed. SW_PWR is an input signal to the MCU just like SW_A, SW_B etc.. PWR_ONOFF is an output from the MCU that turn the power on or off. It looks like the physical power switch is connected to PWR_ONOFF as if PWR_ONOFF is detecting the switch state. Also, I don't see how SW_PWR can detect the switch state.
In the software was SW_PWR set as an input? If so, that line was probably just floating. That would explain the bug you observed.
Bug fixed:
Before:
After:
Do you think we can close this?
As previous soft power circuit (using OR gate or NAND gate) required MCU running in application circuit and keep enable 3.3V regulator operate. But it required user press and hold Power button until MCU running application program, otherwise it system fail to start while user release button in bootloader program.
In order to turn on 3.3V regulator instantly, I changed the logic gate to SR Flip-Flop and using MOSFET to isolate the 5V and 3.3V. User can turn ON 3.3V regulator once they press the power button. SR Flip-Flop will hold the 3.3V regulator working until Flip-Flop received the high signal from MCU (inverses to Logic LOW by N-MOSFET for RST input at Flip-Flop) and turn SR Flip-Flop output LOW and off the regulator. (See below circuit)
Soft power circuit:![image](https://cloud.githubusercontent.com/assets/1327611/6481859/dd1acd5a-c29b-11e4-891c-4c636cd45b84.png)
In practical, once user pressed power button and turn ON 3.3V regulator. Then the I/O (SW_PWR) that turn off Flip-Flop will raise voltage a little bit (around 60mV). This voltage level just meet Vgs and trigger MOSFET ON to give RST signal and turn OFF 3.3V regulator immediately.
That means the power will turn ON while I pressed the button, but it also turn off immediately when I release.