I am interested in controlling 4 Servos, sensing 4 Pots Connected to the 4 Analog Inputs of 16F873.

I tried with just one Pot and One Servo , works just fine , But with 4 Pots and four Servo's, it jerks.

I am sure , i am doing some thing wrong and need some help. I am running the PIC @ 4Mhz.

Mainloop:

LOW SERV1 : LOW SERV2 :LOW SERV3 :LOW SERV4 :

GOSUB READ_POTS
'-----------------------------------------------------------------
SERVO = 150*TEMP1 : SERVO = SERVO / 255 : SERVO = SERVO + 90
pulsout serv1 ,servo : PAUSE 15
'-----------------------------------------------------------------
'-----------------------------------------------------------------
SERVO = 150*TEMP2 : SERVO = SERVO / 255 : SERVO = SERVO + 90
pulsout serv2 ,servo : PAUSE 15
'-----------------------------------------------------------------
'-----------------------------------------------------------------
SERVO = 150*TEMP3 : SERVO = SERVO / 255 : SERVO = SERVO + 90
pulsout serv3 ,servo : PAUSE 15
'-----------------------------------------------------------------
'-----------------------------------------------------------------
SERVO = 150*TEMP4 : SERVO = SERVO / 255 : SERVO = SERVO + 90
pulsout serv4 ,servo : PAUSE 15
'-----------------------------------------------------------------
pause 18

GOTO Mainloop

END

READ_POTS:

Adcin 0, TEMP1 ' Read FIRST POT
Adcin 1, TEMP2 ' Read SECOND POT
Adcin 2, TEMP3 ' Read THIRD POT
Adcin 3, TEMP4 ' Read FOURTH POT

RETURN

regards