Muzza,

You have various options to choose from.

The first that springs to mind is to use one of the timers on the chip. TMR1 is usually 16bit wide (look it up in the 'F84 datasheet). It can be set to increment on each tick of the CPU so if your running on a 4MHz X-tal TMR1 will count uS (16mS = 16000uS).

The timer will generate an interupt when it rolls over from 65535 to 0 so if you preset the timer to 59535 (65535-16000). It will interupt 16mS after it's started.

You can use PBP OnInterupt to detect it OR just check the TMR1 Interuptflag in a loop to catch it. If you're going to use OnInterupt remember not to use any time consuming commands like pause while waiting for the interupt.

/Henrik Olsson.