2022-04-05 10:56 AM
2022-04-05 11:15 AM
Read the PWM input subchapter of TIM chapter in RM. Part of the PWM input measurement is measurement of period (which is 1/frequency).
JW
2022-04-05 01:19 PM
Perhaps you, and your friend can work it out?
I'd probably have used a different TIM, to get some reasonable resolution. But conceptually you can use the TIM in PWM Input Capture, to get frequency and duty cycle quite easily.
2022-04-06 03:33 AM
My Hardware is finalized for TIMER 1. Could you please suggest alternative methods?
2022-04-06 03:42 AM
Alternative to what?
The basic idea is to use Input Capture, which give you the exact moment in time when an edge on input signal occurs. From two consecutive capture values (and input frequency of timer) calculate the period, and 1/period = frequency.
The method described as PWM Input in the RM is simpler in that with capture it simultaneously resets the timer's counter, so you don't need to subtract two consecutive capture values.
JW