Hallo und guten Tag,
ich habe ein kleines Problem bei einem STM32f030CC. Eigentlich nichts
wildes - ich glaube ich habe einfach nur Tomaten auf den Augen.
Das Problem ist, ich benutze 2 externe Interrupts. Einen an PA15 - der
funktioniert einwandfrei. Und einen an PF1. Da tut sich nichts.
Hier die init für PF1:
1 | void HW_EXTI_Channel1_PF1_init (void)
|
2 | {
|
3 | RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOF, ENABLE);
|
4 |
|
5 | SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOF, EXTI_PinSource1);
|
6 |
|
7 | GPIO_InitTypeDef sGPIO_InitStructure;
|
8 | NVIC_InitTypeDef sNVICInitStrct;
|
9 | EXTI_InitTypeDef sEXTIInitStruct;
|
10 |
|
11 | // set GPIO struct to default
|
12 | GPIO_StructInit (&sGPIO_InitStructure);
|
13 | sGPIO_InitStructure.GPIO_Pin = IN_DIG_EING2;
|
14 | sGPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
|
15 |
|
16 | /* sGPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
17 | sGPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN; */
|
18 |
|
19 | GPIO_Init(GPIOF, &sGPIO_InitStructure);
|
20 |
|
21 | // EXTI Init
|
22 | // set EXTI struct to default
|
23 | EXTI_StructInit (&sEXTIInitStruct);
|
24 | sEXTIInitStruct.EXTI_Line = EXTI_Line1;
|
25 | sEXTIInitStruct.EXTI_LineCmd = ENABLE;
|
26 | sEXTIInitStruct.EXTI_Mode = EXTI_Mode_Interrupt;
|
27 | sEXTIInitStruct.EXTI_Trigger = EXTI_Trigger_Falling;
|
28 | EXTI_Init(&sEXTIInitStruct);
|
29 |
|
30 | // start PA1 interrupt
|
31 | sNVICInitStrct.NVIC_IRQChannel = EXTI0_1_IRQn;
|
32 | sNVICInitStrct.NVIC_IRQChannelPriority = 0x03;
|
33 | sNVICInitStrct.NVIC_IRQChannelCmd = ENABLE;
|
34 | NVIC_Init (&sNVICInitStrct);
|
und hier für PA15
1 | void HW_EXTI_PA15_init (void)
|
2 | {
|
3 | SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOA, EXTI_PinSource15);
|
4 |
|
5 | GPIO_InitTypeDef sGPIO_InitStructure;
|
6 | NVIC_InitTypeDef sNVICInitStrct;
|
7 | EXTI_InitTypeDef sEXTIInitStruct;
|
8 |
|
9 | /* set GPIO struct to default */
|
10 | GPIO_StructInit (&sGPIO_InitStructure);
|
11 | sGPIO_InitStructure.GPIO_Pin = EXTI_UNDERVOL;
|
12 | sGPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
|
13 | GPIO_Init(GPIOA, &sGPIO_InitStructure);
|
14 |
|
15 | /* EXTI Init */
|
16 | /* set EXTI struct to default */
|
17 | EXTI_StructInit (&sEXTIInitStruct);
|
18 | sEXTIInitStruct.EXTI_Line = EXTI_Line15;
|
19 | sEXTIInitStruct.EXTI_LineCmd = ENABLE;
|
20 | sEXTIInitStruct.EXTI_Mode = EXTI_Mode_Interrupt;
|
21 | sEXTIInitStruct.EXTI_Trigger = EXTI_Trigger_Falling;
|
22 | EXTI_Init(&sEXTIInitStruct);
|
23 |
|
24 | /* start PA15 interrupt */
|
25 | sNVICInitStrct.NVIC_IRQChannel = EXTI4_15_IRQn;
|
26 | sNVICInitStrct.NVIC_IRQChannelPriority = 0x01;
|
27 | sNVICInitStrct.NVIC_IRQChannelCmd = ENABLE;
|
28 | NVIC_Init (&sNVICInitStrct);
|
29 | }
|
Das macro IN_DIG_EING2 ist auf GPIO_Pin_1 gelegt.
Es wird nicht mal die Handler Routine für den Interupt angefahren. Hat
wer eine zündene Idee? Laut Datenblatt liege ich auf dem richtigen
channel.
Grüße
Jens