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.

create a gap between two pwm signals

Other Parts Discussed in Thread: HALCOGEN

I saw "RM46x 16/32-Bit RISC Flash Microcontroller Technical Reference Manual"(pag 767) that RM46 can generate a PWM signal three phases,


 I tried to generate epwm modules of Hercules RM46, but I can't configure the EPWM modules as master or slave, because I not find in the HALCoGen, the correct instructions for configuration

 try setting the HALCoGen, but I have not the result I want

I wonder if anyone has a sample code to synchronize two modules EPWM!!

  • Hi Martin,

    I have forwarded your questions to one of our ePWM experts. They should get back with you shortly.
  • Hi Martin,

    I was able to sync of pwm with the following settings.

    When shifting the PWM phase, I have been used function below.

    etpwm.c : etpwmEnableCounterLoadOnSync()

    Regards,

    FSSer

  • Hi Martin,

    The etpwmEnableCounterLoadOnSync() is the right function to use to create a phase delay between two PWMs. Were you able to create phase-shifted PWMs usign synchronized ePWM modules? Let me know if you need further help.

    Regards,
    Sunil
  • thank you very much for answering and excuse the delay regarding my answer, apparently notifications responses are failing immediately aplicare your response, thanks for the help!

  • thank you very much for your reply and I apologize for my delayed response, apparently in my account notifications E2E is failing, I'll have to talk to the supervisor for a solution, I thought no one had answered me, now aplicare advice immediately , thx
  • 6011.ETPWM.rar

    implement the new settings, but failed the gap, I send my setup, maybe I'm leaving out some important detail 

    try to generate a signal of 60Hz, so I had to alter the VCLK4

    this way I get

    the code in the main program is:

    void main(void)
    {
    /* USER CODE BEGIN (3) */
    etpwmInit();


    etpwmEnableCounterLoadOnSync(etpwmREG2,35535,COUNT_UP);
    while(1);
    /* USER CODE END */
    }

  • First it is necessary to make these configurations:

    Then supplemented with the codes:

    int main(void)
    {
    /* USER CODE BEGIN (3) */
    etpwmDeadBandConfig_t pwm_deadband_config; // declarate variable
    etpwmInit();

    /*Setting of the offset angle between the generated PWMs*/
    etpwmSetSyncOut(etpwmREG1, SyncOut_CtrEqZero);
    etpwmSetSyncOut(etpwmREG2, SyncOut_EPWMxSYNCI); //SyncOut_CtrEqZero);

    etpwmDisableCounterLoadOnSync(etpwmREG1);
    etpwmEnableCounterLoadOnSync(etpwmREG2, 8300, COUNT_DOWN); // setting angle phase


    /*Dead Band Configuration*/
    pwm_deadband_config.halfCycleEnable = false;
    pwm_deadband_config.inputmode = PWMA_RED_PWMB_FED;
    pwm_deadband_config.outputmode = PWMB_FED_PWMA_RED;
    pwm_deadband_config.polarity = Invert_PWMB;
    /*Iniciando la carga de los valor de la banda muerta 1000---> 510 microsegundos*/
    etpwmSetDeadBandDelay(etpwmREG1, 1000, 1000);
    etpwmEnableDeadBand(etpwmREG1, pwm_deadband_config);
    etpwmSetDeadBandDelay(etpwmREG2, 1000, 1000);
    etpwmEnableDeadBand(etpwmREG2, pwm_deadband_config);

    while (1)
    ;
    /* USER CODE END */

    return 0;
    }

    Video of Aplicattion Here:

    Regards 

    Martin Valencia Alejo