That is interesting Mike. I had not seen that before. (ccp1x, ccp1y, and the register for ccpr1l are different on the 16f690, so some tinkering required).
You could also use Darrel's 18F servo code: http://www.picbasic.co.uk/forum/cont...e-Servo-Driver
If you are not tied to hardware, you could do it (almost) exclusively in hardware with a 18f2431 or a 18f4431 chip. These allow PWM down to 19 hertz on their power control pwm port pins. They have a "single shot mode" which gives the servo a single shot pulse. An interrupt would run at 20 ms to tell the single shot pulse widths when to fire. See the bottom of this wiki for more info: http://www.picbasic.co.uk/forum/cont...-encode-decode
Last edited by ScaleRobotics; - 1st December 2010 at 16:16.
http://www.scalerobotics.com
Bookmarks