
while(!EXF2);
TR2=0;
TL2=0;
TH2=0;
EXF2=0;
TR2=1; 
while(!EXF2);
// now read correct value of timer2 ticks between two pulses
