PWM0 on MC9S12C32

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PWM0 on MC9S12C32

1,316 Views
lasteem1
Contributor I
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.

Labels (1)
0 Kudos
Reply
2 Replies

566 Views
allawtterb
Contributor IV
 I don't see anything wrong with your initialization, what exactly is your problem?
0 Kudos
Reply

566 Views
lasteem1
Contributor I
I finally figured out that I was not configuring the mux for the pin. Thanks.
0 Kudos
Reply