Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/05/07 14:46
Modified:
  05/05/07 16:45

Read: times


 
Msg Score: +1
 +1 Good Answer/Helpful
#138671 - A bit confusing...
Responding to: ???'s previous message
It's a bit confusing, when looking at your four schemes because they seem to fullfill different and contrary needs. I thought, you need a circuit by which you can turn-on the LP2992 by pushing a button and turn-off the LP2992 by the micro itself after being invoked by pushing the button again. But your last scheme doesn't provide this:



The first disadvantage of your circuit is, that immediately after connecting the battery to VBAT the /FORCEOFF input is low, forcing the ENABLE output to go high. This is unsuited and should be avoided, because the conneting of battery to VBAT is a procedure causing lots of contact bouncings.

A better methode would be to totally disable the ENABLE output during the power-on-reset (via R15 and C21) of CD4093 and to only allow startings after the end of this power-on-reset, means, that button pressings even during the power-on-reset will not cause the LP2992 to turn-on.

The next mistake of your circuit is, that pushing the button will immediately reset the flip-flop and cause the ENABLE output to go low and by this the LP2992 to turn-off. So, the micro has no chance to retard the turn-off during EEPROM writings.

More, further button pressings will not change the states anymore. So, once the LP2992 was turned-off you can neither turn it on nor turn it off again. The circuit is dead and can only be reanimated again by momentarily disconnecting the battery from VBAT.


Your third scheme is much better than your last scheme:



Here, the button is connected to the upper NAND-gate, which will work much better.

But this scheme shows also some disadvantages:

- Immediately after connecting the battery, the ENABLE output can go high for a brief period, because C12 is unscharged!

- The debouncing time constant of switch (10k, 10n) of about 40µsec is way to small. Silicon rubber buttons can show huge bounce times, especially the older ones, when the rubber became baggy. For this kind of switch a debouncing time of at least 100msec is suited. Also, as the flip-flop does not need any debouncing, but only the micro (ONDETECT line), provide the debouncing by software and omit the RC-debouncer at the switch.

- The switch input can override each tempt of turning-off the LP2992. Even the power-on-reset can be defeated by accidentally pressing the button. This is highly unsuited and will be the cause of future trouble.

This scheme here, which I already published some days ago, avoids all these disadvantages:



How does it work?

Immediately after connecting the battery to Vbat, the 470n cap is uncharged and forces not only the reset input of flip-flop low, but also the input of an additional NAND-gate, which guarantees, that the ENABLE line ("EN") is low during the entire power-on-reset, even if the button is eroneously pressed. Only, after the cap is so much charged, that the positive going threshold voltage of CD4093 is exceeded, then a pressed button can turn-on the LP2992.

The two 1k5 resistors are to protect the inputs of CD4093, if Vbat is accidentally shorted to GND during battery handlings. The time constant of power-on-reset (470k, 470n) must be long enough, to keep the cap uncharged during the entire connecting "hassle".

So, after a standard connecting of battery to Vbat (means, without keeping the button eroneously pressed), the flip-flop is reseted, the "EN" output is low and the LP2992 is turned-off.

When now pressing the button, the flip-flop becomes set, the "EN" output goes high and the LP2992 is turned-on. The switch is properly debounced by the flip-flop itself. No additional components are needed.

When again pressing the button, in order to turn-off the LP2992, the flip-flop will not change its state. But the micro will notice it via the "SW-DETECT" line. Now, a software debouncing should take place, which demands the "SW-DETECT" line to be low for at least 100msec, before to be high again for another 100msec at least. Then, the micro must activate the "Soft-off" line, by which the 470n cap becomes quickly discharged. This immediately forces this earlier mentioned "gating" NAND-gate to be blocked and the flip-flop to be reseted. As consequence the "EN" output reliably goes low and stays low as long as the cap is discharged.

The 100R resistor is to limit the discharge current. So, even a 2N3904 could be used for the discharging. But to allow a rather high discharge current to flow a rather high base current must flow too, so that a MOSFET would be the better choice. A BS170, 2N7000 or a heavier variant may be suited.

Kai

List of 53 messages in thread
TopicAuthorDate
Momentary toggle soft switch with flip-flop?            01/01/70 00:00      
   I don't like it.            01/01/70 00:00      
      How Bouncy            01/01/70 00:00      
         what good does 'minimum' do you            01/01/70 00:00      
   Schmidt trigger            01/01/70 00:00      
      Tricky...            01/01/70 00:00      
         rail to rail bounce            01/01/70 00:00      
      McKinney            01/01/70 00:00      
   4013 FF toggle circuit            01/01/70 00:00      
      Values?            01/01/70 00:00      
         Values of R1,R2 &R3? Look at PCB!            01/01/70 00:00      
            clocking a FF from an RC?            01/01/70 00:00      
               Agreed            01/01/70 00:00      
                  Follow the datsheet, that is design            01/01/70 00:00      
                  Why dismissing the flip-flop?            01/01/70 00:00      
                     dismissing the flip-flop?            01/01/70 00:00      
                        The CD4013 of Bruce's schematic            01/01/70 00:00      
                           The CD4013 of Bruce's schematic is shown as a f/f            01/01/70 00:00      
                              I answered to Bruce...            01/01/70 00:00      
                  The circuit shown,,,,            01/01/70 00:00      
                     Power Consumption            01/01/70 00:00      
   Overlooking the obvious?            01/01/70 00:00      
      Simpler?            01/01/70 00:00      
      Keymat            01/01/70 00:00      
   Why not a hard switch?            01/01/70 00:00      
      Requirements            01/01/70 00:00      
      Industrial designers is why            01/01/70 00:00      
         Fair enough!            01/01/70 00:00      
   Let The Microconroller Decide            01/01/70 00:00      
      dedicated microcontroller :-)            01/01/70 00:00      
      Interresting no flip-flop            01/01/70 00:00      
   dat is de bounce            01/01/70 00:00      
   The 4013 needs steep edges            01/01/70 00:00      
      caps            01/01/70 00:00      
      A Vauge Suggestion            01/01/70 00:00      
   additional parts            01/01/70 00:00      
      what pin of which chip in what package?            01/01/70 00:00      
         chip on drawing in generic post            01/01/70 00:00      
            slowig down the bugger is not going to make it clo            01/01/70 00:00      
   What about this?            01/01/70 00:00      
      what is 'SOFTSW"?            01/01/70 00:00      
      Seems OK Except...            01/01/70 00:00      
         nice to find a fellow "drawer of fuctions"            01/01/70 00:00      
            I find it eaasier to just...            01/01/70 00:00      
               We appreciate it            01/01/70 00:00      
      Further Analysis....            01/01/70 00:00      
      Would this work?            01/01/70 00:00      
      All comments noted            01/01/70 00:00      
   Round 3 - Hopefully better            01/01/70 00:00      
      Round 4 is the winner            01/01/70 00:00      
         Tomas?? Bruce?? Are you a schizo?            01/01/70 00:00      
            haha, yes            01/01/70 00:00      
         A bit confusing...            01/01/70 00:00      

Back to Subject List