Well, if you are using the exact same code and setup, then you are doing something wrong . . .
With the delay cycles function, I assume that it takes 1.5ms to waste 300 cycles and 2.0ms to waste 1200 cycles?
Hmmm I didn't check my code for exactly what I did, but yeap thats the basic concept.
How exactly does your code use up the rest of the 18 - 18.5ms to keep the 20ms interval pulses?
The code does other stuff, running loops and all. I didn't get it to exactly 18ms, nor does it need to be, but what I had was working fine without problems. I wasn't very scientific about it, as you can see