all you need to do is set the counting part of your program in user_routines_fast.c this is plenty fast enough... no need for interupts... (we didn't need them....) it counted almost everytooth on the last stage gear in the stock tranny running at full speed....
for the code do something really simple like
Code:
////in variables section
int numteeth=0; //num of teeth
int lastreading=0;
/// in code
if((rc_dig_in01-lastreading)!=0) // if the value of the sensor changes then......
{
numteeth++; // add one to teeth count....
}
lastreading=rc_dig_in01;
also this will count from going from the valley before the tooth to the tooth and then from the tooth to the valley after the tooth... so the tooth count will be double ... but this is better...more resolution (half a tooth is more resolution than you can use anyways!)