Skip to main content
Associate
December 7, 2023
Solved

Unknown interrupt on EXTI2 with GUI STemWin

Hello!

Im having some problems with STM32F429ZIT about the interrupt handler. My microcontroller is connected on a LCD display by LTCD bus pheripheral and also has a interrupt input pin (PG2 - EXTI2 on falling edge detection border) connected on a external driver. All the hardware connections are ok.

The problem is that my EXTI callback is being triggered even if i let PG2 always in low! At this moment my callback funcion has just only this code to test:

 

void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)

{

if( GPIO_Pin == GPIO_PIN_2) HAL_GPIO_TogglePin(LED_GPIO_Port, LED_Pin);

}

 

Note: the LCD display is being controlled by a GUI library from STemWin. I have noted that when i disable the library (remove the init function from my main code), the interrupt handler of EXTI works as expected. But if i enable the LCD, the interrupt handler get triggered randomly.

Can someone give me some idea about wich trouble is and a solution?

Al the others GPIO Pins 2 are disabled (none of them are also used on LCD).

I cant use PG2 as input pin without interruption, in this appllication the poolling idea isnt suitable.

This topic has been closed for replies.
TDK
TDKBest answer
December 12, 2023

Putting a scope on the signal adds capacitance which will eliminate or mitigate the issue.

"If you feel a post has answered your question, please click ""Accept as Solution""."

3 replies

TDK
December 7, 2023

How is PG2 connected exactly? Probably is seeing interference from other signals causing the pin to drop. Consider adding a low pass RC circuit to eliminate noise from triggering it.

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
TiagoAQAuthor
Associate
December 11, 2023

Thanks for the response TDK, i have tried this attempt but wasn't succed. I have also measured with oscilloscope on PG2 and didn't find any noise or spike that can be able to trigger the EXTI.

TDK
TDKBest answer
December 12, 2023

Putting a scope on the signal adds capacitance which will eliminate or mitigate the issue.

"If you feel a post has answered your question, please click ""Accept as Solution""."