Rotary encoder via timer