2009-08-25 10:03 PM
Timers
2011-05-17 04:21 AM
I am trying to use the timer output compare to generate (toggle) a high speed clock. Is this even possible? Currently, the only way I can toggle the OC's is to use interrupts. This slows down the clock speed substantially. Is it possible to toggle the OC's outside an interrupt structure?
Thank you for any suggestions.2011-05-17 04:21 AM
From the docs:
TIM1 & TIM8 can do PWM output. No interrupts required. Ditto the general-purpose timers. TIM6 & TIM7 do not have an associated output pin. However, an ISR triggered by either is free to do any output it wishes. With no software required to retrigger the timers no time keeping is lost. You may have delays in outputting the pulse but unless TIM6/7 interrupt events are lost no time will be lost.2011-05-17 04:21 AM
You can certainly create PWMs from the the timers. They are mapped to the pins with functions marked TIMx_CHy where TIM is the timer and y is the channel number.
They are rather complex beasties and you'll have to study them quite a bit to get them going if you need to understand them. With my IDE there were a load routines that just worked, including PWMs. You can always take the ST example code as a starting point and mod them if you don't mind the rather bloaty, tricky to read programming style. [ This message was edited by: robert.wood on 26-08-2009 10:34 ]