2018-02-07 12:12 PM
Hello,
I'm just wondering what is the threshold voltage used to determine if an external interrupt due to falling or rising edge should occur. I'm attempting to find it in the datasheet, but unsure at which value to look at.
For reference, I am using the stm32l476ve.
Many thanks!
Solved! Go to Solution.
2018-02-07 2:54 PM
Below V_IL max you are sure that it will be seen as a 0, above V_IH min it is a 1. Between these two values it is grey area.
2018-02-07 12:30 PM
Check the datasheet for logic high and logic low levels.
2018-02-07 1:57 PM
Thank you, I'm assuming I should look at the voltage input low (V_IL) and voltage input high (V_IH), correct?
If that's the case, then let's say the V_IL = ~0.9V and ~V_IH = 2.3V. Is a falling edge determined as crossing the low input voltage line from a higher voltage? Likewise, rising edge is crossing the high input voltage line from a lower voltage?
Also what should happen if we are in the area in between V_IL and V_IH?
2018-02-07 2:37 PM
With digital circuits we like Hi or Low not inbetween.
Old cmos circuits with dangling pins would oscillate at high frequencies and draw current
So, we have the Schmitt function on these 'Analog' type pins,
the voltage must GO below Vil to become a 0 and GO above to ViH become a 1.
Now, in between VilL and ViH, the signal is still stable.
2018-02-07 2:41 PM
Yes, you are right. Those pins are logic 1 if the input is greater than vih on the rising edge, and logic 0 if input is below vil on the falling edge. For anything in-between, it retains it's prior state.
2018-02-07 2:54 PM
Below V_IL max you are sure that it will be seen as a 0, above V_IH min it is a 1. Between these two values it is grey area.
2018-02-07 3:54 PM
Think the hysteresis is quoted, last time I looked something like 200mV. See V_HYS in datasheet for the specific pins being used.
2018-02-07 4:01 PM
The pin has a schmitt trigger with about 200mV of hysteresis, so the transition point is different going up vs going down.
I would imagine the pin state is latched in a flop-flop periodically, and the transition is probably detected by looking at the difference between two flip-flops holding the two most recent states.
If you need some more definitive, or different, behaviour suggest you condition the signal before passing it to an STM32 pin.
2018-02-07 4:19 PM
Thanks for the information everyone, I have a better understanding now!