Yes, you would need to change bit labels to match the device you're using. Sorry!
I didn't care for that method (it's not entirely interrupt tolerant) but it probably would work fine for the OP. The odd interrupt interval timing (26.2144-msecs) would make it difficult to use for for general purpose interval timers.You could also use Darrel's 18F servo code: http://www.picbasic.co.uk/forum/cont...e-Servo-Driver
That's an excellent example. Thank you.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
If anyone is interested, here's the link to another example of the PWM "frame" method for 8 or 16 "zero jitter" Servos with 250-nsec pulse width resolution (4000 steps between 1.0-2.0 msecs); 8 or 16 Servos using the PWM module
Happy Holidays everyone!
Cheerful regards, Mike
Bookmarks