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.

J721S2XSOMXEVM: Can EPWM and GPT PWM be used together?

Part Number: J721S2XSOMXEVM

Hi,

     SDK Version: 8.6

     core    :     mcu1_0

     We want to use EPWM and GPT to output PWM waveform at the same time. Can we do that?

Regards,

bingxian

  • When I look at the source code under mcal/pwm, it seems that only one EPWM and GPT can be used

  • Hello,

    We can use only at a time.

    The PWM driver implementation and interface should be simple and user friendly. The user should be able to choose which one to use.

    Available Alternatives

    • 1. Use PWM Driver Index as the differentiation factor
      • Advantages:
        • The user can choose which driver instance they want to run (0 for EPWM and 1 for GPT).
        • This can be provided as a configurable parameter. User has the flexibility to choose.
        • Easier implementation and simpler integration.
        • Compatible with the Pre-Compile and Post_Build variants.
        • Code size will be reduced as only the needed IP libraries will be included.
      • Disadvantages:
        • N/A
    • 2. Have EPWM as default selected
      • When all EPWM channels are used up, start using the GPT Channels
      • Advantages:
        • Can use different channels at runtime.
        • GPTimer will be kept free and would be available for other applications.
      • Disadvantages:
        • Incompatible with configurator model as Channel ID cannot change at runtime.
        • User not given the flexibility, and would make the design more complicated.

    Decision

    Option 1 is chosen as it is most compatible with the configurator and also will make the integration simpler. As mentioned above, the PwmIndex (PWM_INSTANCE_ID) variable will be used as the configuration parameter to choose between EPWM(default) or Gptimer. PWM_Priv.c will call the respective API (will be differentiated using the PWM_INSTNACE_ID).

    Regards

    Tarun Mukesh

  • Hi Tarun Mukesh

    We need to use 8 MCU_TIMERIO in MCU domain and 3 EPWM and TIMERIO in MAIN domain, so GPTtimer and EPWM should be able to run at the same time. Could TI provide us with any suggestions?

    Regards

    bingxian

  • Hello,

    Using MCUSW ,currently you won't be able to do that is the limitation we are currently having .You need safety software to handle both EPWM and GPT ?

    REgards

    Tarun Mukesh

  • Hi Tarun Mukesh

    Later we will use security software, now we want to have functionality first.

    We plan to copy two codes of mcal/pwm, one for EPWM driver and one for GPT driver. Do you think this is feasible?

    Regards

    bingxian

  • We have two codes in examples if you see ,but the thing is the option to select in configurator is present to select only one out of it.

    Later we will use security software, now we want to have functionality first.

    In MCUSW ,we have that limitation.May be if we can use GPT from PDK and EPWM from MCUSW and running on different cores might work ? 

    Regards

    Tarun Mukesh