This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
PWM1A pwm1B 波形动作设置,我发现波形发生动作设置为互补波时,加入这个语句 EPwm1Regs.DBCTL.bit.POLSEL = 2; 波形并未改变,如果波形发生动作设置为非互补波时,加入这个语句 EPwm1Regs.DBCTL.bit.POLSEL = 2; 波形会变为互补波,请问这是为什么??
我看手册,EPwm1Regs.DBCTL.bit.POLSEL = 2; 语句意思为: 主动高互补(AHC)。 EPWMxB被反相
EPwm1Regs.AQCTLA.bit.CAU = 1; // Set PWM1A on event A, down count
EPwm1Regs.AQCTLA.bit.CAD = 2; // Clear PWM1A on event A, up count
EPwm1Regs.AQCTLB.bit.CBU = 1; // Set PWM1B on event B, up count
EPwm1Regs.AQCTLB.bit.CBD = 2; // Clear PWM1B on event B, down count
EPwm1Regs.DBCTL.bit.OUT_MODE = DB_FULL_ENABLE; // enable Dead-band module
EPwm1Regs.DBCTL.bit.POLSEL = 2; //EPWMxB被反相 //DB_ACTV_HI
EPwm1Regs.DBFED = 50; // FED = 25 TBCLKs 0.5us
EPwm1Regs.DBRED = 50; // RED = 25 TBCLKs 0.5us
这样设置会输出互补波!
EPwm1Regs.AQCTLA.bit.CAU = 1; // Set PWM1A on event A, down count
EPwm1Regs.AQCTLA.bit.CAD = 2; // Clear PWM1A on event A, up count
EPwm1Regs.AQCTLB.bit.CBU = 2; // Set PWM1B on event B, up count
EPwm1Regs.AQCTLB.bit.CBD = 1; // Clear PWM1B on event B, down count
EPwm1Regs.DBCTL.bit.OUT_MODE = DB_FULL_ENABLE; // enable Dead-band module
EPwm1Regs.DBCTL.bit.POLSEL = 2; //EPWMxB被反相 //DB_ACTV_HI
EPwm1Regs.DBFED = 50; // FED = 25 TBCLKs 0.5us
EPwm1Regs.DBRED = 50; // RED = 25 TBCLKs 0.5us
这样设置波形还是互补波!
请问这是为什么?