2013-04-18 12:21 AM
Hi, I am using an STM32L151VB part in a custom board. Is there any way to detect if an interrupt has been caused by a rising or a falling edge. I looked around in the reference manual and didnt find anything. I need to know which edge has caused an interrupt on my GPIO pin.
2013-04-18 12:50 AM
Hey,
i´m sure it is possible. I tried to help, but i have problems to find the reference maual. I >>could<< imagine, since it is a low power µC, that is not able to detect falling or rising edges, rather than edges in general because the ciruit for that is more simple and consumes thereby less power. In that case, u would have to do ''old state'' - ''new state'' compares to find rising or falling edges. But without RM i can´t be sure...2013-04-18 01:11 AM
You could use two pins connected to your source. Program one for rising edges and one for falling edges.
RM0038 Reference manual STM32L151xx, STM32L152xx and STM32L162xx advanced ARM-based 32-bit MCUs (ST website) says ... 6.3.8 External interrupt/wakeup lines All ports have external interrupt capability. To use external interrupt lines, the port must be configured in input mode, refer to Section 9.2: External interrupt/event controller (EXTI) and Section 9.2.3: Wakeup event management. 9.2 External interrupt/event controller (EXTI) The external interrupt/event controller consists of up to 23 edge detectors for generating event/interrupt requests. Each input line can be independently configured to select the type (event or interrupt) and the corresponding trigger event (rising edge, falling edge or both). Each line can also be masked independently. A pending register maintains the status line of the interrupt requests.