I want to use PWM input mode to measure inputs signals up to let's say 1 kHz. My question is about the selection of the prescaler and the counter period that supports the inputs frequencies. My timer clock is 2 MHz. So, if I say
[Timer Frequency ] / [(Prescaler+1)*(Period+1)] <= 1KHz
Is this the right way to choose the prescaler and counter period?
I'm using Timer 2, which is 32 bit, so I expect a good resolution.
I read that if I'm not sure about my input range frequencies, I can set the timer like this:
[Timer Frequency ] / [(MaxPrescaler)*(MaxCounterPeriod)]
But, in my case, I think I will measure frequencies under 1 kHz.
Can I say for example [2 MHz ] / [(1+1)*(999+1)] = 1 kHz?
[Timer Frequency ] / [(Prescaler+1)*(Period+1)] <= 1KHz
Is this the right way to choose the prescaler and counter period?
I'm using Timer 2, which is 32 bit, so I expect a good resolution.
I read that if I'm not sure about my input range frequencies, I can set the timer like this:
[Timer Frequency ] / [(MaxPrescaler)*(MaxCounterPeriod)]
But, in my case, I think I will measure frequencies under 1 kHz.
Can I say for example [2 MHz ] / [(1+1)*(999+1)] = 1 kHz?