如果须要将6路PWM都封锁话,可用 PWMC1_OutputPadDisable ,但外部必须接上拉或下拉电阻,因为根据说明书,此时PWM输出是浮动的。也可用PWMC1_Mask();如
TChannels Channelmask; //但不知为什么要定义成全局变量才工作?????
void main(void)
{
PE_low_level_init();
Channelmask.channel0 = 1;
Channelmask.channel1 = 1;
Channelmask.channel2 = 1;
Channelmask.channel3 = 1;
Channelmask.channel4 = 1;
Channelmask.channel5 = 1;
PWMC1_Mask(Channelmask);
} |