cancel
Showing results for 
Search instead for 
Did you mean: 

GPIO EXTI and AFIO clock

guyvo67
Associate II
Posted on March 23, 2009 at 05:22

GPIO EXTI and AFIO clock

4 REPLIES 4
guyvo67
Associate II
Posted on May 17, 2011 at 13:07

hi,

When I define a GPIO pin and bind it with EXTI this works only when I set the RCC_APB2Periph_AFIO clock on. The interrupt isn't triggered when only the RCC_APB2Periph_GPIOC clock is set. My GPIO pin is just defined as normal pin like:

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1;

GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;

(--> so not alternative declared )

I did some searches in the datasheet (ref manual) but I couldn't find anything that says the AFIO clock must be set using EXTI regardless what pin type you use.

Can anyone point me to my answer I'm looking for ?

Thnx

Guy

bissong
Associate II
Posted on May 17, 2011 at 13:07

Hi, if you look at page 125 of the Reference Manual (RM0008) you 'll see that the AFIO registers are needed to know on which port each EXTI need to be. So I guess it implies that you need to clock AFIO as you want it to work...

guyvo67
Associate II
Posted on May 17, 2011 at 13:07

Quote:

if you look at page 125 of the Reference Manual (RM0008) you 'll see that the AFIO registers

In RM0008 on page 125 there are only two following registers described:

EXTI_RTSR

EXTI_FTSR

They are for setting the edge to be triggered and in my opinion have nothing to do with AFIO.

The only thing I found was on page 114.The AFIO_EXTICR1 registers that enables the gpio pin/port for EXTIx. So here you can deduce the fact that the AFIO clock needs to be set to enable the OR gate when needed. But it's a bit confusing because the AF are also applicable on the pin remaps.

-G

bissong
Associate II
Posted on May 17, 2011 at 13:07

It seems that we dont have the same RM0008 because on my page 125 there is only ''Figure 16. External interrupt/event GPIO mapping'' where you can see that AFIO_EXTICRx registers are the one which link an EXTI with its source.