2012-08-21 03:11 AM
Hello All,
I have configured an user button(connected to PG15) on the evaluation board(MCBSTM32F200) to generate an interuppt when pressed. The GPIO is iniztialized and works fine however the IRQ handler is never entered. Could someone please help me. The code is as below.void Exti_Config(void){GPIO_InitTypeDef GPIO_InitStructure; EXTI_InitTypeDef EXTI_InitStructure;NVIC_InitTypeDef NVIC_InitStructure;RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOG, ENABLE); // clock to the GPIOGPIO_InitStructure.GPIO_Pin = GPIO_Pin_15;GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;GPIO_Init(GPIOG, &GPIO_InitStructure); SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOG,EXTI_PinSource15); EXTI_InitStructure.EXTI_Line = EXTI_Line15; EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt; EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling; EXTI_InitStructure.EXTI_LineCmd = ENABLE; EXTI_Init(&EXTI_InitStructure); NVIC_PriorityGroupConfig(NVIC_PriorityGroup_0); NVIC_InitStructure.NVIC_IRQChannel = EXTI15_10_IRQn; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure);}/*Interupt routine which checks if the user button is pressed*/ void EXTI15_10_IRQHandler(void) {if(EXTI_GetITStatus(EXTI_Line15) != RESET){GLCD_DisplayString (LCD_LINE_NUMBER_7, LCD_COLUMN_NUMBER_16, FONT_INDEX_1,''Xsas'');}EXTI_ClearITPendingBit(EXTI_Line15);}2012-08-21 05:22 AM
The Button/key connected to PG15 is a pull down. Forgot to add this in my previous post.
Thanks in advance2012-08-21 05:39 AM
/* Enable SYSCFG clock */
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE); Also verify you have got the vector table correctly built and situated, that the names match, and you have correct linkage.2012-08-21 05:56 AM
2012-08-21 06:11 AM
Also can i configure two buttons to generate an interuppt(using EXTI) on the same lines?