2022-02-23 08:26 PM
Dear sir,
I am using STM32F769NI microcontroller. I want to glow to different Leds on one external interrupt line i.e. Led1 on rising edge and Led2 on falling edge. Can you please suggest me the solution.
Regards,
Manoj
2022-02-23 09:56 PM
You can set interrupt on both edges in EXTI, and by reading the current state of pin from GPIO_IDR you can determine which was the last edge.
JW
2022-02-23 10:16 PM
Ok. But in my case the level 0 appears in two cases first when logic 0 is applied and second when the line is disconnected. So what shall I do in this situation?
2022-02-24 12:29 AM
What is "line disconnected"? Elaborate.
JW
2022-02-24 01:53 AM
@Community member line disconnected means open.
2022-02-24 03:05 AM
Use a pull-up resistor.
2022-02-24 03:09 AM
So the last state will be always '1' if I use the pull up resistor.
2022-02-24 04:21 AM
There is no magic way to distinguish 3 states.
In software, periodically switch between pullup and pulldown, and sample input. If input follows the pullup/pulldown pattern, it's open; otherwise it's connected and you know its polarity.
JW