AnsweredAssumed Answered

PWM using ADuCM3029

Question asked by seberth Employee on Aug 7, 2017
Latest reply on Aug 8, 2017 by seberth



I am using the EVAL-ADuCM3029 in CCES to create a PWM signal using TMR2 to drive a servo motor. I need a pulse width between 1ms and 2ms with a period of 20ms. I have been able to generate a period of 20ms and get the pulse width down to 2ms but nothing less. This means I can get the servo to move one direction (to 180deg) but not the other.


Attached is my code for the PWM. Not included in the txt file is initialization of power and clock dividers, it is higher up in my c file and didn't want to include everything for you to look at. Also, 


#define GP2_LOAD_VALUE_FOR_20ms_PERIOD (10u)
#define GP2_PWM0_DUTY_CYCLE_LOAD_DIV (20u)
#define GP2_PWM1_DUTY_CYCLE_LOAD_DIV (40u) 
#define GP2_PWM2_DUTY_CYCLE_LOAD_DIV (20u)


I find it odd that I need to divide by 20 to get a 10% duty cycle??


Any help would be appreciated.