2014-04-29 07:29 PM
Excuse me, I want to ask, can I know duty cycle of PWM without using TIM? I thought if I can read the time of PIN either in high or low logic and then divided by period. So I can measure the duty cycle. Assumption : I know the frequency of PWM input, so I can determine the period at first.
Thank you very much.2014-04-29 08:09 PM
Well you can certainly time stamp the pin transitions against some other free running time base, and from those compute period/duty. You could use the EXTI interrupts. The desire to do this in software will limit the maximal frequency.
You could use some other 32-bit TIM, or the core cycle counter DWT_CYCCNT