Re: [jallist] Re: Servo motor driving, using PWM in JAL
- Hello Joep,
Thanks for your hints.
----- Original Message -----
From: Joep Suijs
Sent: Wednesday, August 29, 2007 9:48 PM
Subject: [jallist] Re: Servo motor driving, using PWM in JAL
To use the PWM module at 20ms interval (50Hz), the clock of your pic
must be 83kHz or less and that will probably not be the case.
You can drive the servo's by creating a pulse of 1 to 2 ms every 20
ms in your main loop like:
pin_d0 = true
pin_d0 = false
or when you need an accurate pulse and have interrupts in the
background, you can use a comparator to create the pulse:
ccp1con = 0x00
ccp1con = 0x09
TMR1 = 0
CCPR1 = ServoStand;
My experience is the timing of the 20 ms is not critical; a few ms
more or less will not influence the operation.
--- In firstname.lastname@example.org, "redemvee" <marc.vermeir2@...> wrote:
> Is it possible to drive a servo using the PWM commands.
> You need then a period of 20 ms (50 Hz) and a duty cycle
> between 1 to 2 ms.
> Thanks for your help!
[Non-text portions of this message have been removed]