PaxInstruments / t400-electronics

Electronics for the Pax Instruments T400 temperature datalogger
20 stars 9 forks source link

Bug in soft Power circuit #160

Closed samchoy88 closed 9 years ago

samchoy88 commented 9 years ago

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

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.

samchoy88 commented 9 years ago

Put a 10K pull low resistor at Q4 MOSFET gate can eliminate the bug. It works now !

charlespax commented 9 years ago

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.

samchoy88 commented 9 years ago

Bug fixed:

  1. Identified the short of JP1 cannot not hold 3.3V always ON. Updated R21 position.
  2. fixed the bug in reversed signal name between SW_PWR and PWR_ONOFF
  3. Added the pull down resistor for mosfet and prevent noise trigger during initial stage

Before: image

After: image

charlespax commented 9 years ago

Do you think we can close this?