PWM0 on MC9S12C32

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

PWM0 on MC9S12C32

1,318件の閲覧回数
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.

ラベル(1)
0 件の賞賛
返信
2 返答(返信)

568件の閲覧回数
allawtterb
Contributor IV
 I don't see anything wrong with your initialization, what exactly is your problem?
0 件の賞賛
返信

568件の閲覧回数
lasteem1
Contributor I
I finally figured out that I was not configuring the mux for the pin. Thanks.
0 件の賞賛
返信