2017-10-10 12:17 PM
The 'STMCubeF2\Projects\STM32F207ZG-Nucleo\Examples\TIM\TIM_PWMInput' example configures the timers with direct calls to the HAL.
I am trying to keep all of the pin allocation and resource initialization within STM32CubMx itself.
Has anyone either created a .ioc file for this or measured frequency and duty cycle using STM32CubeMx to configure the timers?
Thanks in advance.
2017-12-21 09:12 AM
So perhaps 924 Hz ?
If SystemCoreClock is 8MHz, the chip isn't running at 48 MHz
TimHandle.Init.Prescaler = 0;
TimHandle.Init.Period = (SystemCoreClock / 38000) - 1;sConfig.Pulse = ((TimHandle.Init.Period+1)*100)/50; // for 50% duty cycle
Accuracy here depend on the integer divisibility of the system (bus) clock
2017-12-28 02:47 AM
Hey Clive,
Thanks a lot it worked! Really appreciate your help.
BR