Quote Originally Posted by ruijc View Post
center : 1,5ms
0º : 1ms
120º : 2ms
30º : 1.16ms
Even with a simple pauseus 1000 ( that should be 1ms and the servo should center ) this does not happen
.
It looks to me like you might be confusing a couple of the values you stated above.
From what I'm seeing, you want 1000 to be center and work around that. That's all fine and dandy, but you want the rest of the program to work around it also, which it isn't doing.
Instead of thinking about it in terms of 0, 90, 120, whatever degrees, think of it in terms of -90 , 0 , +90, etc. degrees, where 0 is center.

Using your original code...with a few changes...

Code:
'.....set up your ports, adcon, cmcon, whatever else is required...

leftend = 1000
center = 1500
rightend = 2000
stepval = 50
pos = center

moveleft:
pause 19 'pause 19ms
if pos > leftend then
pos = pos - stepval
else
goto moveright
endif
servo = 1 : pauseus pos : servo = 0 : goto moveleft

Moveright:
pause 19 'pause 19ms
if pos < rightend then
pos = pos + stepval
else
goto moveleft
endif
servo = 1 : pauseus pos : servo = 0 : goto moveright

end
And with that code, when pos = 1500, the servo should be centered. pos decreases to leftend, servo moves left, pos gets to leftend, jumps to other loop, pos increases to rightend, servo moves right, pos gets to rightend, jumps to other loop, and over and over.
Change the value of stepval to change how fast the servo moves back and forth. Simple enough.
But if it really doesn't work, and your ports are set up correctly, you've got the right config fuses set, etc.etc., then, as Jumper said, it sounds to me like a goofy servo. What kind of Futaba servo are you using? A standard S148 or what?