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.

MSPM0C1104: PWM has no output after reconfiguring the frequency.

Part Number: MSPM0C1104
void PWM_Requence_Update(unsigned int REQU)
{
//    unsigned int duty_temp;
    duty_temp = REQU >> 1;


    gADDR_DOConfig_HY.pwmMode = DL_TIMER_PWM_MODE_EDGE_ALIGN_UP;
    gADDR_DOConfig_HY.period = REQU;
    gADDR_DOConfig_HY.startTimer = DL_TIMER_STOP;



    DL_TimerG_initPWMMode(
       ADDR_DO_INST, (DL_TimerG_PWMConfig *) &gADDR_DOConfig_HY);

    DL_TimerG_setCaptureCompareValue(ADDR_DO_INST, duty_temp, DL_TIMER_CC_0_INDEX);

    DL_TimerG_enableClock(ADDR_DO_INST);

}

I need to constantly modify the PWM frequency during the running of the program, but when I reconfigured the PWM frequency, there was no output at the IO port.Attached is my code for reconfiguring the PWM frequency.After executing this part of the code, the IO port has no output.Please help me solve this problem,Thanks!

  • Because in your code, you stop the timer:

    And after completing the instructions in this function, you doesn't start the timer again, so there is no PWM output. You need to start timer using "DL_TimerG_startCounter(   );" in your code.