我想使用UCD3138 T16的PWM0和PWM1,采用了相同的配置,PWM0有波形输出,PWM1没有,不知道问题出在哪,求教。
下面为配置代码:
TimerRegs.T16PWM0CMPCTRL.bit.SHADOW = 1;
TimerRegs.T16PWM0CNTCTRL.bit.PRESCALE = 0;
TimerRegs.T16PWM0CMP0DAT.bit.CMP_DAT = T16PWM1_PERIOD;
TimerRegs.T16PWM0CMP1DAT.bit.CMP_DAT = INIT_DUTY;
TimerRegs.T16PWM0CMPCTRL.bit.PWM_OUT_ACTION0 = 1;
TimerRegs.T16PWM0CMPCTRL.bit.PWM_OUT_ACTION1 = 2;
TimerRegs.T16PWM0CNTCTRL.bit.CMP_RESET_ENA = 1;
TimerRegs.T16PWM0CMPCTRL.bit.PWM_OUT = 0;
TimerRegs.T16PWM0CMPCTRL.bit.PWM_OUT_DRV = 1;
TimerRegs.T16PWM0CMPCTRL.bit.PWM_OUT_ENA = 1;
TimerRegs.T16PWM0CNTCTRL.bit.SW_RESET = 1;
TimerRegs.T16PWM1CMPCTRL.bit.SHADOW = 1;
//TimerRegs.T16PWM1CNTCTRL.bit.SYNC_SEL = 0;
//TimerRegs.T16PWM1CNTCTRL.bit.SYNC_EN = 1;
TimerRegs.T16PWM1CNTCTRL.bit.PRESCALE = 0;
TimerRegs.T16PWM1CMP0DAT.bit.CMP_DAT = T16PWM1_PERIOD;
TimerRegs.T16PWM1CMP1DAT.bit.CMP_DAT = INIT_DUTY;
TimerRegs.T16PWM1CMPCTRL.bit.PWM_OUT_ACTION0 = 1;
TimerRegs.T16PWM1CMPCTRL.bit.PWM_OUT_ACTION1 = 2;
TimerRegs.T16PWM1CNTCTRL.bit.CMP_RESET_ENA = 1;
TimerRegs.T16PWM1CMPCTRL.bit.PWM_OUT = 0;
TimerRegs.T16PWM1CMPCTRL.bit.PWM_OUT_DRV = 1;
TimerRegs.T16PWM1CMPCTRL.bit.PWM_OUT_ENA = 1;
TimerRegs.T16PWM1CNTCTRL.bit.SW_RESET = 1;
Nancy Wang:
请去电源论坛咨询。
e2echina.ti.com/…/