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.

How to turn the PWM module on ?

Other Parts Discussed in Thread: SYSBIOS

Hello,

I tried a Starerware example of EHPWM and started doing it manually step by step. The EPWMAppInit function does all the job in module's registers what is pretty clear. But before that, I assume the PRCMModuleEnable function should be launched to enable its power and clocking. After the EPWMAppInit, pinmux config should be done by PINMUXModuleConfig to enable and configure the input/output pins. Is there anything more that I should keep in mind? I do not know if there is anything more 'hidden' somewhere in dispersed files. 

Could you tell me if the instruction PINMUXModuleConfig(CHIPDB_MOD_ID_PWMSS,0,0) turns on the entire module declared in am43xx_gpevm_pinmux_data.c or the third argument should be set to direct value such as PINMUX_SS_PWMSS_EHRPWM0?  

Thanks!

JJ

  • JJ,

    Which release/ example are you looking at? Is it C:\ti\pdk_am437x_1_0_1\packages\ti\starterware\examples\epwm?

    In epwm_app.c:

    ePwmSubmodType = PINMUX_SS_PWMSS_EHRPWM0;

    status = PINMUXModuleConfig(CHIPDB_MOD_ID_PWMSS, pPwm->instNum, &ePwmSubmodType);

    Lali

  • Hi,
    It is sysbios sdk starterware: epwm_app_haptics_motor in location sysbios_ind_sdk_2.1.1.2\sdk\starterware\examples.
    Could you please explain the function you used? I want to use EPWM0A and EPWM0B in my code so in this function it would be: as ID CHIPDB_MOD_ID_PWMSS, next I use module instance - in my case it is 0 - and finally I select sub-block EHRPWM0? If yes, why I need to define in the last argument which instance number is it if I do that in the second argument? Should not that be only EHRPWM bias equal for every instance of PWMSS?
    How the compiler know the pinmux for the selected sub-module? Does it configure all the pins, such as EHRPWM0A, EHRPWM0B, EHRPWM_SYNCO etc. or only the pins specified somewhere in the pinmux.c file - such as: am43xx_gpevm_pinmux_data.c?
    Thanks,
    JJ
  • Jacek,

    I have not tried to change the default PWM instances, but here's some feedback:

    The AM437GPEVM pinmux
    C:\ti\sysbios_ind_sdk_2.1.1.2\sdk\starterware\board\am43xx\am43xx_gpevm_pinmux_data.c
    configures the pinmux for eHRPWM 0

    The AM437IDK pinmux
    C:\ti\sysbios_ind_sdk_2.1.1.2\sdk\starterware\board\am43xx\am43xx_idkevm_pinmux_data.c
    configures the pinmux for eHRPWM 3 and eHRPWM 4
    eHRPWM3 is also configured to support tripzone_input, Sync in and Sync out
    eHRPWM4 is also configured to support tripzone_input

    The motor control main application initializes
    {CHIPDB_MOD_ID_PWMSS, 0, 0}, /* */
    {CHIPDB_MOD_ID_PWMSS, 3, 0}, /* */
    {CHIPDB_MOD_ID_PWMSS, 4, 0}, /* */
    {CHIPDB_MOD_ID_PWMSS, 5, 0}, /* */

    C:\ti\sysbios_ind_sdk_2.1.1.2\sdk\control\foc\foc_pwm.c
    Configures the PWM settings but does not perform any additional enable

    Lali
  • Hello,

    All clear now, 

    Thank you,

    JJ