PWM Clock and Period
Posted: Fri Jun 03, 2011 10:00 am
Hey,
I've managed to get serial and the like working with ChibiOS on my STM32103. Next on the list is PWM, and I am stuck again.
Looking at the example, there is a macro "PWM_COMPUTE_PSC(STM32_TIMCLK1, 10000)". I can not find this documented, which makes me think it might be a deprecated method of working out the PWM clock.
My hardware oscillator is at 8MHz, making the system clock 72MHz after the prescaler with the default options. Apart from that, I have no idea what the frequency of the clock on Timer2 is. This will be used to control an ESC, so I need a 20ms period and a 1 - 2ms duty cycle.
I have definitely got the PWM working, as I am watching the output on the scope.
Cheers,
MM
I've managed to get serial and the like working with ChibiOS on my STM32103. Next on the list is PWM, and I am stuck again.
Looking at the example, there is a macro "PWM_COMPUTE_PSC(STM32_TIMCLK1, 10000)". I can not find this documented, which makes me think it might be a deprecated method of working out the PWM clock.
My hardware oscillator is at 8MHz, making the system clock 72MHz after the prescaler with the default options. Apart from that, I have no idea what the frequency of the clock on Timer2 is. This will be used to control an ESC, so I need a 20ms period and a 1 - 2ms duty cycle.
I have definitely got the PWM working, as I am watching the output on the scope.
Cheers,
MM