Design Idea

Microcontroller or DSP circuit controls on/off function

Edited by Bill Travis

Dirk Gehrke, Texas Instruments, Freising, Germany, and Frans Ravn, ChemoMetec A/S, Alleroed, Denmark -- EDN, 11/13/2003

In many applications, a single on/off button switches the power supply on or off. Usually, the system switches off regardless of the processing function or workload the microcontroller or DSP circuit is currently handling. The small circuit in Figure 1 is intended to make the microcontroller or DSP circuit the master over this on/off function. The circuit allows the microcontroller or DSP circuit to take ownership over the on/off function. Thus, the system can do whatever has to be done, such as processing data, storing data, and so forth, before it issues the command to shut down the supply. Figure 2 shows the timing diagram. The switch connects directly to the dc supply or battery, though the end application is disconnected from the supply. Thus, all the capacitors discharge. The most difficult task is to get the two D flip-flops in Figure 1 into the desired "off" configuration.

The inverter, IC1B, in Figure 1 resets the D flip-flop, IC2B, via the diode, D4. The RC network comprising R10, R11, and C4, connected to the input of the inverter, IC1B, generates a delay time of approximately 4.7 msec. This interval ensures that this D flip-flop is released from reset after a delay time of approximately 4.7 msec. When the delay time has passed, reset-input pin R of IC2B changes from high to low potential because R7 connects to ground. At the same time, output Q of IC2B switches to low level, and switches to high level. The D input node of IC2B changes as well from high to low potential because it connects to the output pin, . The RC network comprising R1 and C3, in conjunction with the inverter, IC1A, generates a delay of approximately 47 msec. This delayed output connects to the set pin of the D flip-flop, IC2A. The set pin holds high for 47 msec before it goes low. The RC network, comprising R1 and C3, along with the inverter, IC1A, generate a 47-msec delay. The delayed output connects to the set pin of the D flip-flop, IC2A. The set pin holds high for 47 msec before it goes low.

After the set pin falls to a low level, the D flip-flop, IC2A, changes its output levels at Q to high and to low, and feedback from connects to the D input. The high level at Q , connected to the enable pin of the dc/dc converter or low-dropout regulator, keeps the system off. The D flip-flop, IC2A, is now in an off condition. From this point on, both D flip-flops are in a known state. The DSP I/O pin is low during this initialization, because the DSP circuit receives no power. R15 ensures a low level during the power-up sequence at the DSP I/O pin. The , after its initialization phase, assumes an active-high level. If you connect it to the enable pin of the system dc/dc converter or low-dropout regulator, it keeps the system in an off condition. IC1B's input changes its level from high to low when you press the pushbutton, because the switch shorts the pullup resistor at the pushbutton node to ground. IC1B's output changes its level accordingly from low to high for that period.

The CLK input of D flip-flop IC2A triggers via R14 and D1, and output Q changes its status from low to high. This state enables the low-dropout regulator or dc/dc converter to start operation. The 3.3 or 5V connected to R2 supplies transistor Q1 to change the logic level at the CLK input of D flip-flop IC2A. This action ensures that the system disregards glitches when you press the on/off pushbutton. The DSP I/O pin of the circuit connects to one of the DSP circuit's or microcontroller's I/O pins. You should configure the I/O pin of the DSP circuit or microcontroller as an input pin after power-up and reset release. As long as you press the on/off pushbutton, transistor Q2 remains on, driving the DSP circuit's I/O pin low. You should program the DSP circuit or microcontroller such that the DSP circuit stops executing code before you release the button, and the DSP I/O pin changes its level from low to high. D flip-flop IC2B again resets via D4, but this reset does not alter the output because the application is running.

When you again press the on/off pushbutton, the DSP I/O pin assumes a low level. The DSP circuit or microcontroller should now detect this input change and generate an interrupt. This interrupt should initiate a shutdown procedure. D flip-flop IC2B changes, via D4, to reset mode, so that the toggle signal valid at CLK has no impact on the output status. You now release the on/off pushbutton. D flip-flop IC2B releases from reset after approximately 4.7 msec, and Q2 and Q4 change levels and maintain a low signal at the CLK pin before the reset delay time passes. The microcontroller or DSP circuit sees a high signal at the I/O pin after this time-out and can start the shutdown procedure.

The DSP circuit or microcontroller now has the time to store any critical data. You must program the microcontroller's or DSP circuit's I/O pin as an output pin set low. Q4 loses its drive voltage, and the CLK pin of D flip-flop IC2B changes its status from low to high. D flip-flop IC2A changes its output status via the output, Q, and D3. Q and change the status of the pin to low level, and the system shuts down. At the same time, D flip-flop IC2B resets via Q3 and the comparator IC1C. This reset brings D flip-flop IC2B to the initial state described above before you first pressed the on/off pushbutton.



ADVERTISEMENT

ADVERTISEMENT

Feedback Loop


Post a CommentPost a Comment

There are no comments posted for this article.

Related Content

 

By This Author

There are no additional articles written by this author.


ADVERTISEMENT

Knowledge Center



Technology Quick Links

EDN Marketplace


©1997-2008 Reed Business Information, a division of Reed Elsevier Inc. All rights reserved.
Use of this Web site is subject to its Terms of Use | Privacy Policy

Please visit these other Reed Business sites