以下是我的code 我的問題是我的PWM只有1,3,5,7通道能輸出 0,2,4,6卻沒有任何波形 這是我code的問題嗎 #include <IO_S12DT256.h> int main(void) { // PWME = 0x00; //禁止PWM輸出 PWMCTL = 0x00; //禁止通道聯及 PWMPRCLK = 0x00; //ClockA = ClockB = Bus = 8000 kHz PWMCLK = 0xFF; //時鐘來源選擇ClockSA,ClcokSB PWMSCLA = 0x01; //PWMSCLA = PWMSCLB = 1 PWMSCLB = 0x01; PWMPOL = 0xFF; //PWM輸出起始為高電平 PWMCAE = 0x00; //左對齊方式 PWMPER0 = 0x13; PWMDTY0 = 0x09; PWMPER1 = 0x13; PWMDTY1 = 0x09; PWMPER2 = 0x13; PWMDTY3 = 0x09; PWMPER3 = 0x13; PWMDTY3 = 0x09; PWMPER4 = 0x13; PWMDTY4 = 0x09; PWMPER5 = 0x13; PWMDTY5 = 0x09; PWMPER6 = 0x13; PWMDTY6 = 0x09; PWMPER7 = 0x13; PWMDTY7 = 0x09;
PWME = 0xFF; //啟動PWM輸出
while(1); }
|