2019-07-25 09:10 AM
Hi,
I'm using the STM32F091 microcontroller on a custom made PCB, i'm reading two switch buttons, both have the following configuration (image below), the SENS_P signal go directly to PA10 of the microcontroller which is configured with EXTI triggered by a rising edge. (This part of the schematic was copied from a Nucleo board schematic).
I'm having an issue when i push the switch button, sometimes the interrupt is being also triggered on the falling edge of the signal, to debug it I'm toggling a test point like so:
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
HAL_GPIO_TogglePin(TP_GPIO_Port, TP_Pin);
}
And the following screenshoot of the oscilloscope shows the issue, where the yellow signal is SENS_P and the blue signal is TP, you can see how on the first change on SENS_P the interrupt is correctly triggered on the rising edge, and in the second change the interrupt is being triggered on both falling and rising edge of SENS_P.
Do you think i'm having a rising edge on the yellow signal, so fast the oscilloscope isn't able to detect it? or does it seems more like a hardware issue?
Regards
-- Carlos
2019-07-25 03:05 PM
Do you think i'm having a rising edge on the yellow signal, so fast the oscilloscope isn't able to detect it?
Yes. Buttons bounce, and EXTI is not filtered by any means. The hardware filter is nice to have, but not a panacea.
JW