New to the AVR128Dx series. It has a ton of features I love but it's always difficult to use them out without an example or two.
I want to measure an external fan using it's tach out signal, typical 2500RPM. I could use PWM to control it but that's for another exercise. For now, just measure the RPM. Assume that it's been treated to create a nice pulse. I've found a few examples that use the timers but not in this external clock mode. For example,
I'm thinking of using 2 timers ...
TCB: Feed filtered RPM via and external pin and set it to count the pulses (even with a 3-pole rotor, it should not exceed the 16-bit counter)
TCA: Create an interrupt every second. The ISR will snapshot TCB and clear it for the next 1 second interval.
A foreground task will then process the count.
Has anyone seen this example around? Or do this a different way?
Thanks in advance for any advise ...