2011-04-13 12:04 AM
TIM4- OC Toggling frequency is inaccurate...
2011-05-17 05:31 AM
Stupid me... The ISR was a copy+paste and the TIM3 is not changed to TIM4. I will change it and see what happens..
2011-05-17 05:31 AM
I could generate clocks close to what I intended with this code after the typo correction in ISR. But, Interrupts are poring like hell... Is there any other way I can do this without using this Toggle method...Especially, without having to update rate at each ISR call....
Thanks,
Sai
2011-05-17 05:31 AM
Well... I looked at examples given in ST library.. I did not see any example that uses OCToggling without using interrupt.. There are examples like PWM1 which do not use interrupts...They generate the channel outputs something like 50% duty cycle, 37.5% duty cycle.. But for the requirement something like i need - toggling at a particular frequency on each channel - How can we convert this..
I am not getting a clue on how to map the duty cycle value on PWM1 examples to Frequency values in toggle examples in order to avoid interrupt load...
2011-05-17 05:31 AM
Regards,
Sai
2011-05-17 05:31 AM
If you want different frequencies at 50/50 you'll need to use different timers. Other free clock resources may also be viable sources.
PWM is viable only if you can achieve what you want by controlling the ON or OFF period. You could probably do a cyclic DMA of values to GPIO ports, but the pattern length might be too long to be viable.2011-05-17 05:31 AM
I used different timers to solve this issue... I used PWM1 mode to achieve the frequencies I want...
Thanks Clive1 for the response...