Hi all!
I need a circuit to power on/off a circuit pushing a button. When I press first time, the circuit is powered, and if I press a second time, the power must go off. I have a microcontroller, and I use an I2C I/O expander, the PCF8574. The idea is to use an I/O of the PCF8574 to maintain/cut the power, and use another I/O to read the push button (when the circuit is powered, press button must cut the power).
So I have:
-Put "0" on "A" maintain the power.
-Put "1" on "A" cut the power.
-Read "0" on "B" cut the power.
The PCF8574 is open drain. (I'm not very sure what that is, but I understand that these I/Os cant "supply" current, only "drain").
The power source is 5V, and the power for the microcontroller is 3.3V
The circuit works if I use 2 push buttons (SW1 & SW2), but I need do the thing using only one SW. And here is my problem.
Can anyone help me?
Thanks in advance for this excellent forum!
I need a circuit to power on/off a circuit pushing a button. When I press first time, the circuit is powered, and if I press a second time, the power must go off. I have a microcontroller, and I use an I2C I/O expander, the PCF8574. The idea is to use an I/O of the PCF8574 to maintain/cut the power, and use another I/O to read the push button (when the circuit is powered, press button must cut the power).
So I have:
-Put "0" on "A" maintain the power.
-Put "1" on "A" cut the power.
-Read "0" on "B" cut the power.
The PCF8574 is open drain. (I'm not very sure what that is, but I understand that these I/Os cant "supply" current, only "drain").
The power source is 5V, and the power for the microcontroller is 3.3V
The circuit works if I use 2 push buttons (SW1 & SW2), but I need do the thing using only one SW. And here is my problem.
Can anyone help me?
Thanks in advance for this excellent forum!
Attachments
-
58.9 KB Views: 12