2024-05-01 01:50 PM
Dears, good afternoon.
We had standard hardware for telemetry using STM32G071. We decided to migrate it to STM32WB15CC in order to take advantage of BLE features.
It turns out that two sensors use the same interrupt line, PA8 and PB8, although one detects the rising edge and the other the falling edge. This is how we differentiate them in the STM32G071.
To differentiate the rising and falling edges in the STM32G071, we use the EXTI_FPR1 and EXTI_RPR1 registers. However, we did not find similar ones in the STM32WB15CC, but only an EXTI_PR1 register that identifies that an edge has occurred. Obviously, it is more difficult to change "almost" standard hardware, due to issues of size, layout, etc. We would like to resolve this issue through software.
Do you have any suggestions to resolve this problem?
The list of interrupts for GPIOs is below.
Thank you in advance for your attention!
William Ferreira (from Brazil)
Image 1: WB15 reference manual
Image 2: STM32G0xx reference manual
2024-05-01 04:45 PM
Initialize 2 last_state_n variable for each interrupt, one variable would be low and the other variable will be high.
When you get an interrupt, read each pin and then compare to the last_state. If it's different, you save the current pin state into the last_state and set a flag to indicate you have an interrupt from x sensor.
In you main loop you check for the 2 flags. If either flag is set, you clear the flag and then you can see the value of the last_state to see if it's the falling/rising edge you're looking for.