Skip to main content
guyvo67
Associate III
March 23, 2009
Question

GPIO EXTI and AFIO clock

  • March 23, 2009
  • 4 replies
  • 1198 views
Posted on March 23, 2009 at 05:22

GPIO EXTI and AFIO clock

    This topic has been closed for replies.

    4 replies

    guyvo67
    guyvo67Author
    Associate III
    May 17, 2011
    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
    Visitor II
    May 17, 2011
    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.

    guyvo67
    guyvo67Author
    Associate III
    May 17, 2011
    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
    Visitor II
    May 17, 2011
    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...