I'd like to add two timer/counter related features to ArduPlane 2.28:
1. Simple 32-bit event up-counter, capable of counting input pulses at up to 1kHz, and logging the count. (Counter clears at power on, for now).
2. Shaft RPM counter, capable of measuring between 480RPM to 9000RPM (8-150 Hz), and logging the value as RPM. Sample period of 1/4 second is sufficient, or other if dictated by existing system)
I'm trying to determine which, if any, timer channels are available for these.
Good news: I'm not using any RC PWM outputs right now, and only plan to use 4 in the future.
So it looks like PH7(T4) becomes available if I sacrifice PH3 and PH4 output. Is that really available?
Suggestions? Thanks in advance... I'm lurking on IRC #ardupilot.
Apparently all timer/capture/counter resources and interrupts are used. So I used PK0/AIN8/PCINT16 and PK1/AIN9/PCINT17 as PCINTs. Used a shaft encoder index pulse for the upcounter, and optocoupled tachometer output pulse from the ignition system.