Eric Laster

PWM0 on MC9S12C32

Discussion created by Eric Laster on Jul 16, 2008
Latest reply on Jul 17, 2008 by Eric Laster
I'm attempting to get the PWM working on the S12C32 here is what I'm doing to config the pwm:

PWMCLK=0x01; //clock SA is the source clock
PWMSCLA=0x32;  //Clock SA = Clock A / (2 * PWMSCLA)
PWMPRCLK=0x04;//prescaler=bus clock/16
PWMPER0=0xF9;//period = channel clock period * (2 * PWMPERx)
PWMDTY0=0x7B; //Duty cycle = [(PWMPERx PWMDTYx)/PWMPERx] * 100%
PWME=0x01; //enable PWM0

I would greatly appreciate the help if anyone can help me figure out what I"m doing wrong. Thanks in advance.