2014-12-26 06:14 AM
hey,
I would like to know if I can use with different channels of the same TIM and get different freq for each channel (i am NOT talking about Duty Cycle).if there is an options, how i config this parameter? #pwm2014-12-26 06:54 AM
Hi david,
You have 17 different timers = 17 different frequencies! Never seen a timer capable of 2 difference frequencies output in each channel and i didn't see any indication this MCU has timers capable of doing that.2014-12-26 07:40 AM
No, each timer has a SINGLE counting element, and this would define the period.
Now one can generate multiple frequencies if they baby sit the timer in maximal mode, and advance the compare (CCRx) points under interrupt, and toggle or act on those.2014-12-26 12:55 PM
thanks for your ans,
clive1 - you mean Auto-Reload register? i know from- Figure 86. Advanced-control timer block diagram that only Auto-Reload register is can changed by Interrupt.and the formula is: freq = Counter Clock(21MHZ) / Auto-Reload register.so you mean to change this by interrupt and each time turn on/off relevant TIMx_Channel ?or maybe you can give me an example?Thanks a lot.2014-12-26 01:35 PM
No, I mean the ARR (Period) is 0xFFFF or 0xFFFFFFFF for 16-bit or 32-bit timers respectively, and you advance the CCRx compare registers
ie On CC1 TIM2->CCR1 += 1000; On CC2 TIM2->CCR2 += 2000; \STM32F4xx_DSP_StdPeriph_Lib_V1.3.0\Project\STM32F4xx_StdPeriph_Examples\TIM\TIM_OCToggle \STM32F4xx_DSP_StdPeriph_Lib_V1.3.0\Project\STM32F4xx_StdPeriph_Examples\TIM\TIM_TIM9OCToggle \STM32F4xx_DSP_StdPeriph_Lib_V1.3.0\Project\STM32F4xx_StdPeriph_Examples\TIM\TIM_TimeBase2014-12-28 11:22 AM
So, I tried all examples but its not what I was looking - I need to get from one Timer 2 different Freq + modify PWM D.C.
From this examples I see that if you choose different freq, you cannot change the D.C (fixed to 50%).there is an option to get 20KHz and 200Hz + PWM from one timer?2015-12-28 03:02 PM
From this examples I see that if you choose different freq, you cannot change the D.C (fixed to 50%).
But think about this for a second, you control the placement of both edges, you can modulate the signal anyway you want.