I am making a battery powered RF device and once the task is complete putting the mcu in power down mode. I am using PCINT0 interrupt pin to wakeup the mcu. I am using a schmitt trigger (SN74LVC1G17-Q1) to filter out noise from the interrupt signal to prevent false triggering of the mcu. My concern is how much current will the schmitt trigger eat when the push button gets stuck unknowingly and left pressed ?
I am attatching a simple circuit diagram of my project.
Input A will consume 5uA max, Vcc is 1.5uA max the 1 Meg resistor will 5uA.
So 11.5uA total.
However, 1Meg is too big to keep the input at logic 0
50K will be the max
@rrevati63
If you are putting the tiny84 into power down sleep mode, then INT0 must be set to LEVEL interrupt.
So the schmitt trigger does nothing and is not needed. All you need is a pushbutton.
In the ISR you can disable the INT0 interrupt then in the main code enable it before going back to sleep.
The question, though, is whether hysteresis is the relevant issue here. I don't think it is:
The intent is apparently...:
I read this as 'false positives', i.e. spurious signals. Think about it - if the signal is real (true positive), it doesn't matter all that much that it bounces a bit. It's supposed to wake up the uC, and it will as long as it triggers the interrupt. The bouncing is merely a minor inconvenience that's easily dealt with in the ISR.
Conversely, suppose we have a false positive from some kind of noise on the line. Even if the Schmitt trigger has hysteresis, there'll be a signal to the input register and generation of an interrupt. The only gain is that it doesn't bounce. But the uC still wakes up while it shouldn't.
The real solution is thus to improve the s/n ratio. Adding an external Schmitt trigger may work, but not because it adds hysteresis. It might work because its tripping point may be higher than the uC's Schmitt trigger. But that's a different parameter...
A practical workaround might be to simply reduce the penalty of a false positive by determining fairly quickly whether a trigger was a true or a false positive, allowing the uC to sleep again in case of a false positive. This may in the end be the cheapest and most simple option, with relatively little penalty w.r.t. the power budget. However, in this case, I think it's pretty darn simple to replace the shoddy input button circuit with something that will trigger cleanly, without false positives - and it can be hardware-debounced if that's desired, although I'd personally consider that entirely optional.
That doesn't mean a Schmitt trigger isn't present. It just means it may be poorly/incompletely specified, possibly because the manufacturer has decided that manufacturing variations are so acceptable that they don't see the need to commit to a more determinate performance spec.
A slowly varying signal presented to a digital logic input can lead to multiple different readings during a transition between the specified thresholds for logical low and high.
Besides, "all microprocessors"? I would have objected to "most". When I saw that the AVR has specified hysteresis I was pleasantly surprised if not shocked.
In the absence of anything other than speculation, I remain with my opinion.
If you have an arbitrary waveform generator e.g. a Siglent DG1000X series, you can probably devise an experiment to test an input by varying the rise/fall time of the waveform.
As mentioned, hysteresis will not necessarily correct for a noisy input.
I used external schmitt trigger coz I had read about it in an other thread on this forum as a solution to reduce noise and prevent false triggering. I am not sure if there is any schmitt inbuilt, although practically a simple nearby load was able to wake up my mcu. After adding the external schmitt, my issue of noise is solved so far.
My main concern is, how can I save my battery from draining if the push button get stuck in pressed condition. Since it is battery powered, I want to save each uA.
With the 10K pullup, a stuck button would draw 330 uA, way too much.
So have you explained your concern about this stuck button?
If the current weren't an issue, what would the response be to a stuck button? It seems there would have to be something other than just going to sleep on the regular schedule, unless you expect the button to become unstuck and then wake things up when next pressed.
Yeah that's correct. I actually wanted to minimise the current withdrawal when the button is stuck by adding a high value pull down resistor and it was not working on pin INT0.
I also tried putting a Max16150 ic coz it has an internal pull up in the range of mega ohm.
You don't need one, you can use the internal pullup.
INT0 is ONLY LEVEL sensitive, you need to hold the button until the 84 wakes up. That makes it imune to noise.
I think Max16150 will solve my issue if it does not assert and deassert the OUT pin repeatedly on a stuck button state. I will use it to power up my circuit with the help of an LDO. I am just not sure by the datasheet if it looks for a valid press and release of the push button for its next toggle.