piclist 2008\07\15\184252a >
Thread: Servo control questions
face picon face BY : email (remove spam text)(Olin Lathrop)

Jan-Erik Soderholm wrote:
> First you can more or less forget about the hardware PWM
> module in the PIC's, it is not designed för RC-servo
> control at all.

It's not ideal, but it is still better than nothing for this purpose.  You
can use the CCP module in compare mode as a digital one-shot.  The software
does have to set the output high manually right before releasing timer 1,
but after that the hardware takes over to time the pulse.  Since setting the
output pin and enabling timer 1 can be done in successive instructions in
the interrupt routine, the pulse time can be totally predictable and have a
resolution of the instruction clock.

In the OP's case, there would be a regular interrupt in which the software
would switch the mux to the next servo, load timer 1 with the pulse time,
raise the output pin, then enable timer 1.  Hardware automatically ends the
pulse.  This is certainly no worse than the software doing all the timing.

Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.
<001701c8e6cc$60ea64f0$0300a8c0@main> quoted-printable

See also: www.piclist.com/techref/microchip/ios.htm?key=servo
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Servo control questions

month overview.

new search...