This turned out the be far easier than I thought it would be.
I set T0CON for $E8
TMR0ON = Enable Timer 0
T08BIT = Timer0 8 bit
T0CS = Transition on TOCK1
T0SE = Low to High transition (beginning of 2uS pulse)
PSA = Timer0 prescaler is not assigned
T0PS2:T0PS0 all 0
Then I set the register to 0
TMR0L = $00
In my control loop which enables the device which provides the 2uS speed proportional pulses I read the TMR0L and when it equals to a predetermined value the sub is called and when the sub is finished the register is again set to zero.
It counts in the background and the control loop doesn't have to consume that many cycles reading the register so it really doesn't burden the control loop.
Thanks
Bookmarks