cancel
Showing results for 
Search instead for 
Did you mean: 

Input capture in STM32F103RC

kamarajulu
Associate II
Posted on September 01, 2015 at 11:41

Hi

    I was trying to configure the input capture in STM32F103RC , and facing issues , The configuration is done as follow 

I was trying to configure TIM1 CH3 ,

RCC->APB2ENR |= RCC_APB2ENR_TIM1EN;

    NVIC_EnableIRQ(TIM1_CC_IRQn);

    /* reset the Register */

    TIM1->CCMR2 |= 0x0001; /* as input capture for TI3  */

    TIM1->CCER &= ~0x0200;

    TIM1->CCER |=  0x0100;

    TIM1->DIER |= 0x00000008;  /* Enabling CC3 Interrupt Enable */

    TIM1->PSC = 0x00FF;        /* Configuring Prescalar */

    TIM1->DMAR = 0x0000;

    TIM1->ARR = 0x0000;

    

    /* Configure the capture control for CH3 */

    TIM1->EGR |= 0x00000001;

    TIM1->CR1 |= 0x0001;

Interrupt is not happening and the TIM1_CCR3 register is not getting updated with the Captured value.

Am i missing something ,or should we do anything special to capture signal in TIM1_CH3

Help is very much appreciated

 

Thanks & regards

kamaraj

#timer
5 REPLIES 5
Posted on September 01, 2015 at 18:59

May be you need the MOE bit of BDTR set?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
kamarajulu
Associate II
Posted on September 02, 2015 at 14:41

Thank you  for the response,Setting the MOE bit didn't solve the issue,

I am using STM32f103RCT6 (64 pin ) micro and input signal is connected to (PB15)TIM1_CH3. From the documention my understanding is that  TI3FP3 should be Selected for Input capture, I could not find TI3FP3 in this micro to configure.Is my understanding is correct, Is there any work around to solve this.

Thanks

kamaraj

Posted on September 02, 2015 at 17:46

Isn't PB15 the TIM1_CH3N (Negated), not sure that's a viable input source.

The TIMx_CCMR2 should be able to select TI3 as the input capture source.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on September 02, 2015 at 18:32

I don't use the 'F1xx , but are you sure PB15 can be used as TIM1_CH3? As far as I can see in the datasheets it's TIM1_CH3N.

JW

[EDIT] Sorry I missed Clive's identical and earlier answer
kamarajulu
Associate II
Posted on September 11, 2015 at 14:28

Thanks clive and JW , the Pin doesnt support the functionality , I changed the hardware pin and it is working now , thanks for your timely support