AnsweredAssumed Answered

Problem with Input Capture in STM32F103RBT6

Question asked by amer.sherif on Aug 22, 2011
Latest reply on Aug 25, 2011 by amer.sherif
Hi all!

I'm using STM32F103RBT6, board Olimex STM32-H103 and i'm trying to create an IR receiving firmware.

I'm using Input Capture mode TIM1-Channel1 with the specs below:
/*/*/*/*/*/*/*/*/*/*/*/*/*/*/

    TIM_ICInitTypeDef  TIM_ICInitStructure;

    TIM_ICInitStructure.TIM_Channel = TIM_Channel_1;
    TIM_ICInitStructure.TIM_ICPolarity = TIM_ICPolarity_Falling;
    TIM_ICInitStructure.TIM_ICSelection = TIM_ICSelection_DirectTI;
    TIM_ICInitStructure.TIM_ICPrescaler = TIM_ICPSC_DIV1;
    TIM_ICInitStructure.TIM_ICFilter = 0xf;
    TIM_ICInit(TIM1, &TIM_ICInitStructure);

    /* Enable the CC1 Interrupt Request */
    TIM_ITConfig(TIM1, TIM_IT_CC1, ENABLE);

    /* TIM1 enable counter */
    TIM_Cmd(TIM1, ENABLE);

/*/*/*/*/*/*/*/*/*/*/*/*/*/*/

and the NVIC specs:

/*/*/*/*/*/*/*/*/*/*/*/*/*/*/

    NVIC_InitTypeDef NVIC_InitStructure;

    /* Enable the TIM1 global Interrupt */
    NVIC_InitStructure.NVIC_IRQChannel = TIM1_CC_IRQn;
    NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
    NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1;
    NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
    NVIC_Init(&NVIC_InitStructure);

/*/*/*/*/*/*/*/*/*/*/*/*/*/*/

The problem is:
the TIM1 CC interrupt handler is being called every time i connect the PA.8 (which is internally linked to TIM1-CH1) with a floating wire.

Outcomes