See the thread at
http://www.chiefdelphi.com/forums/sh...ad.php?t=43244 for information on how to count gear teeth using interrupts. Pay special attention to the post by
b_mallerd.
For using timer interrupts, see the Timers White Paper:
http://www.ifirobotics.com/docs/time...004-jan-14.pdf