RCM5700 - measure pulse width

Hi All
Working with a Memsic mx2125 accelerometer. Depending on tilt or g force, it puts out a pulse train with a varying pulse between 3.6 and 6.4 ms, 5ms being center(level) As a novice to the rabbits and C, this code gave me a value of 5. 5ms pulse using the MS_TIMER , its right. no resolution though.

unsigned long time, durX;
durX=0;
waitfor(BitRdPortI(PBDR,6));
waitfor(!BitRdPortI(PBDR,6));
time=MS_TIMER;
waitfor(BitRdPortI(PBDR,6));
durX = MS_TIMER - time;

so I changed it to this:

unsigned long time, durX;
durX=0;
waitfor(BitRdPortI(PBDR,6));
waitfor(!BitRdPortI(PBDR,6));
while(!BitRdPortI(PBDR,6))
{
durX++;
}

this gives me a range of about 500 to 850 with 675 being center(level)

There has to be a way to get a higher resolution (count) ? micro seconds would be great, then a 5 ms pulse would give me a value of 5000. even half of that(2500) would be good. As a learning curve, I would like to show the output of degrees, down to the 100th.

Could you enable interrupts on that input pin, then in the interrupt routine store the counter start / end times and do the math?

You would probably have to set it to rising edge, then in the routine check to see if it is rising, then change to falling edge so when the bit goes back low you will get the interrupt and store then start time. If pulled back in and it is currently set to falling, store the end time, then set it back to rising to start all over.