Loading ...
Sorry, an error occurred while loading the content.

Re: [jallist] Re: Servo motor driving, using PWM in JAL

Expand Messages
  • Marc Vermeir
    Hello Joep, Thanks for your hints. Regards, Marc ... From: Joep Suijs To: jallist@yahoogroups.com Sent: Wednesday, August 29, 2007 9:48 PM Subject: [jallist]
    Message 1 of 3 , Sep 1, 2007
    • 0 Attachment
      Hello Joep,

      Thanks for your hints.

      Regards,
      Marc
      ----- Original Message -----
      From: Joep Suijs
      To: jallist@yahoogroups.com
      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
      delay_10us(ServoStand)
      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.

      Best regards,
      Joep

      --- In jallist@yahoogroups.com, "redemvee" <marc.vermeir2@...> wrote:
      >
      > Hello,
      > 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]
    Your message has been successfully submitted and would be delivered to recipients shortly.