Question
PWM Frequency Change On the Fly
Posted on September 09, 2016 at 02:43
I'm using an STM32F4 to generate PWM pulses. I need to do something a bit difference, the best way to describe it is like FSK ( frequency discontinuity not a problem if it occurs)
For example - if one was looking at sequence of 10 pulses, the first 5 are at T = 2ms (500hz), and the next 5 are at T = 1ms (1Khz) I would want to see the frequency change occur at the interval between the start of the 5th pulse and the start of the 6th - where that delta would be 1ms. Hoping that someone provide a basic algorithm (or even a code example) on how to accomplish this. Interrupts? Timers? Any help is appreciated, Thanks!