I have set my TIM4 in PWM mode to get a 8MHz signal.
Now I need to get a 64KHz signal using the 8MHz signal, but I don´t know how to do it.
Also, I will have to change the Duty of the 64KHz signal.
Thank you in advance.
The question need more details. First, you take the period of the PWM. Say 64kHz.
Then you tell how many steps you want of duty cycle. If you want around 100 steps, the timer needs to count from 0 to 100 in 64kHz time period, so its counting frequency should be 64x100=64MHz or more. This 64 MHz must feed the timer clock and come from one of the clock sources of the timer (see the reference manual). Maybe you need to use the core at 128MHz and prescale the clock before feeding the timer clock. You could also inject a clock on the timer ETR or Channel 1 or 2 from another timer etc....
I´m pretty new using this kind of devices and I´m getting mad...
The thing is that I need both signals (8MHz and 64KHz) to be synchronized. So I´m trying to figure out how to set the clock source of the
64KHz signal with the 8MHz one.
I know how to generate both signals at the same time but when i look at the Osciloscope I can´t synchronize them
Hello Endika Caño de Miguel ,
I have a very simple way to do it I wrote an article about measuring high frequency signals with a good precision. To do that, I simply used a second Timer to divise the high frequency signal frequency, and then I used a third Timer to measure divided frequency (Divided frequency will be measured with a good precision) then I can compute the real frequency
Take a look at this article and don't hesitate to ask me for explanation ! Good Luck
Retrieving data ...