STM8L External interrupt PortB and PortD with rising/falling configuration
Hello everybody,
In my project which uses STM8L151G6 MCU, I need 6 interrupt inputs on both rising/falling edge. In particular those pins are PB0, PB1, PB2, PD1, PD2, PD3.
Please note I'm using "port interrupt mode", i.e. EXTIB_G_IRQHandler and EXTID_H_IRQHandler are used.
If all pins of the port (for example PB) are "floating" (internally pulled-up), then the first one which falls, it triggers EXTIB_G_IRQHandler interrupt as expected and everything it works.
But, if 1 pin among PB0, PB1 and PB2 is already low, then interrupt is not triggered by the other pins even if EXTI->SR2 register has been "cleared" inside the interrupt handler.
I have reduced the project to a very simple test code in order to reproduce the issue. Please find attached the project folder so you may test.
TEST procedure:
-set breakpoints in EXTIB_G_IRQHandler, EXTID_H_IRQHandler and EXTI0_IRQHandler...EXTI7_IRQHandler
-start debug
-leave PB0,PB1,PB2 "open" and connect one of them to GND -> interrupt EXTIB_G_IRQHandler is triggered
-open the pin and test another one -> interrupt is triggered
Now...
-connect one pin to GND (e.g. PB0) and leave it connected to GND
-test another pin (e.g. PB1) -> interrupt is not triggered anymore until PB0 is released
-same procedure apply to PD1,PD2,PD3 group of pins.
What am I wrong? Is the EXTI invalid configuration?
Thanks
