After DUTY gets a value in the main part of the program you have DUTY=0 in timeTOmove.
The code you have working writes to the high and low byte for Speed the goes straight to CCP1CON.4 and CCP1CON.5 with the low and high byte of speed.
In the one that is not working DUTY has 0 written to it before CCP1CON.4 and CCP1CON.5.
Bookmarks