Attaching a Servo motor to the EasyLab

From ErikaWiki

Revision as of 09:40, 18 September 2014 by Pj (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Currently the PWM Block for the EasyLab board has a limited support in frequencies, making it impossible to have the 50Hz PWM needed to control a servo.

As a workaround, it is possible to do the following (hint provided by Chin Luh from Tritytech):

  1. hardcode the 50 in easylab_pwm.c
  2. change P1TCONbits.PTCKPS = 0b11; and EE_UINT16 ptper = EE_get_peripheral_clock() / pwm_freq / 64; in ee_pwm.c.
  3. resulting input vs. degree:
    1. 0.025  : 0 degree
    2. 0.0725 : 90 degree
    3. 0.12  : 180 degree
Personal tools