[QUOTE=Eriswerks]I'm trying to get down the basics of PIC servo control, and not having much luck. I'm using a 16F690 and trying to get some kind of meaningful movement out of my servo. However, the only thing my servo will do is move to one extreme of its range and sit there, perhaps scornfully.

The offending code is:

@ DEVICE MCLR_OFF,WDT_OFF,PROTECT_OFF
DEFINE OSC 8
servo var PORTC.5
i var byte

loop:

for i = 200 to 400
low servo
pulsout servo,i
pause 18
next i

goto loop


hi,Eris

@ 8 Mhz, pulsout resolution is 5µS ( 10µS *4 / F.Mhz)

so, correct for that.

for i = 200 to 400 means i should not be a byte ( i max = 255 !!! )

so, what's happening ??? i value goes from 200 to 255 then ... back to 0 , out of the for - next loop !!! program ends.

just change i for a WORD !!!

Alain