TMR2_OCConfig_T ocConfigStruct;
/** Set counter = 0XFF, divider = 4 */
TMR2_ConfigTimerBase(4, 0XFF);
/** CH3 output one pulse */
ocConfigStruct.channel = TMR2_CHANNEL_3;
ocConfigStruct.count = 0X7F;
ocConfigStruct.mode = TMR2_OC_MODE_PWM1;
ocConfigStruct.OCxOutputState = TMR2_OC_OUTPUT_ENABLE;
ocConfigStruct.OCxPolarity = TMR2_OC_POLARITY_HIGH;
TMR2_ConfigOutputCompare(&ocConfigStruct);
//TMR2_EnableSinglePulseMode();
/** Enable TMR2 */
TMR2_Enable();
按例程如上配置管教PA3无法输出pwm,请问什么问题 |