Thanks for your suggestions. I've whittled down the code to the bare essentials:
@ DEVICE MCLR_OFF,WDT_OFF,PROTECT_OFF
servo var PORTC.5
loop:
pulsout servo,150
pause 18
goto loop
That's the entirety of it, no configuration or anything left out. That ought to center it and hold it there so long as the PIC is powered, but once again it moves all the way to one extreme and stays. I tried other pulsout values from 1 to 2000 just for the fun of it, but I keep getting the same result.
The only thing I can think of is that the internal timer is in its LFINTOSC mode, which is 31kHz and would probably cause any pulse I care to send to look the same to the servo. There must be some language in PicBasic to tell the PIC to which frequency to set the internal oscillator, but I haven't been able to find it.
What am I (still) doing wrong here?
Bookmarks