cancel
Showing results for 
Search instead for 
Did you mean: 

TIM1 or TIM8 configuration

contact2
Associate II
Posted on October 01, 2013 at 18:42

The original post was too long to process during our migration. Please click on the attachment to read the original post.
8 REPLIES 8
Posted on October 01, 2013 at 19:22

/**
* @brief Enables or disables the TIM peripheral Main Outputs.
* @param TIMx: where x can be 1, 8, 15, 16 or 17 to select the TIMx peripheral.
* @param NewState: new state of the TIM peripheral Main Outputs.
* This parameter can be: ENABLE or DISABLE.
* @retval None
*/
void TIM_CtrlPWMOutputs(TIM_TypeDef* TIMx, FunctionalState NewState)

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
contact2
Associate II
Posted on October 01, 2013 at 19:41

Still, while debugging I get every other peripheral registers updated, including TIM2, DMA, DAC and others just intead of TIM8. Just like passing throught this statement:

TIMx->ARR=TIM_TimeBaseInitStruct->TIM_Period ;

no value is stored in TIMx->ARR, even the TIM_Period register is filled with 120.

contact2
Associate II
Posted on October 01, 2013 at 19:51

If you have a sample program made for STM32F303 TIMER 8 with PLL send it to me please.

Posted on October 01, 2013 at 20:17

And you've enabled the APB clock for TIM8?

  /* TIM1 clock enable */

  RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM1, ENABLE);

  /* TIM8 clock enable */

  RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM8, ENABLE);

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
contact2
Associate II
Posted on October 01, 2013 at 20:18

OK the problem is solved, but I am still confused about which clock source I am using either APB2 or SYSCLK*2.

I have added  RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM8,ENABLE);

before this RCC_TIMCLKConfig(RCC_TIM8CLK_PLLCLK);

contact2
Associate II
Posted on October 01, 2013 at 20:28

Yay!, 🙂

I get it confirmed with my DSO NANO.

Posted on October 01, 2013 at 22:02

The F3 is different in that it can provide a different clock to the counting elements of the timer, the bus side interface of the TIM unit (registers) still runs synchronously with the APB clock.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
contact2
Associate II
Posted on October 02, 2013 at 16:30

Thanks a lot sir!