Thanks for the ideas.

One of the reasons I am looking to get the incoming 2khz PWM pulse into a 0-255 variable is that my device is passing through the pwm and using the HPWM output to mimic the input.

So the input pwm is being measured, manipulated by my program if reqd and squirted out using hpwm which uses a byte variable for the duty.

I'm trying to keep the maths simple and improve on the resolution that the pulsin command provides.