Hi Demon
Thanks for the reply. I have played with the PULSIN_MAX but as I decrease the value I loose slow speed response. As A beginner I realy don'y understand what is happening. I assume the PULSIN measures the first pulse width and puts that value into a var. I then divide it into 50000 and the do a hypotenuse calculation on the two values of X and Y. I'm guessing it should take 20 or so clock cycles for all this to happen. Does the PULSIN take the next pulse in or maybe the third pulse in and repeat the calculation? I have an LED across the PWM output and I can see a step in brightness as I increase the pulses in where it should be a smooth increase in brightness.
Thanks