Here is a snippet of code from a motor speed controller for a small electric cart. The HPWM command is constantly repeated and has never caused any problems. In fact, in the beginning, I took the value of the speedpot once and just let the motor run and it caused problems. Intermittently the motor would "jump" into full speed. In spite of double regulation and a lot of filtering, motor noise sometimes caused the HPWM to go OUTPUT HIGH. I know it was motor noise because it never happened when controlling a 12V lamp.

ON:
ADCIN 2, SPEEDPOT 'READ VALUE OF SPEED CONTROL POT
IF SPEEDPOT > 150 Then LET SPEEDPOT = 150 'LIMIT SPEED OF MOTOR
IF LEFTRAMP < SPEEDPOT Then LET LEFTRAMP = LEFTRAMP + 1 'INCREASE SPEED SLOWLY
IF LEFTRAMP > SPEEDPOT Then LET LEFTRAMP = LEFTRAMP - 1 'DECREASE SPEED SLOWLY
Pause 1 'CONTROLS RATE OF SPEED INCREASE/DECREASE
HPwm 1,LEFTRAMP,10000 'OUTPUTS THE DUTYCYCLE CONTROLLED BY SPEEDPOT
IF PORTB.5 = 1 Then ON 'SWITCH PUSHED KEEP MOTOR RUNNING
GOTO START 'STOP EVERYTHING