PWM interference with servo command

tedhill

New Member
Has anyone experienced PWM interference with servo commands? I'm building a small project with one servo and two LED's; as soon as I pulse the LED's to fade in/out with PWM, the servo motor jitters like mad.

Using this for the LED's:

For w0=0 to 1023
PWMout 3,255,w0
pause 5
next w0

pause 1000

For w0=1023 to 0 step -1
PWMout 3,255,w0
pause 5
next w0

And standard servo commands:

for b7 = 135 to 250 step 1
servo 1, b7
pause 35
next b7

gosub eyes1

for b7 = 250 to 135 step -1
servo 1, b7
pause 35
next b7

I had to change the servo 1 command to pulsout 1 command to stop the jittering, and I've tried the code on an 08M and an 18X, both show the same jittering using servo command and PWM.

Any ideas? I'd prefer to use the servo command as it seems to move the servo smoother than the pulsout command.
 

premelec

Senior Member
If I recall correctly the PWMOUT circuits interfere with servo and infra commands - in short you can use either or but not both or many at same time. Check manual 2 for details...
 

tedhill

New Member
You're right - the manual states that it can't be used with the servo command since they both use the same timer; I'll try a nap at the end of the PWM command to see if that helps-thanks
 
Top