TMS320F280049C: Implementation of high resolution capability of a deadband module

Part Number: TMS320F280049C

Tool/software:

Hello

I'm using the F280049C for my application, where I need to precisely control the high-resolution deadband between two submodules (EPWM1 and EPWM2). However, I'm unable to utilize the high-resolution (HR) capabilities of the deadband module. Additionally, there are no example codes available for the F280049C that demonstrate the use of an HR headband, nor is there any suggestion available in this forum using this HR capability of the deadband. 

I have successfully generated an HRPWM signal and modified the duty cycle without any issues. However, I have not been able to achieve high-resolution control in the deadband module, as it appears to be limited to a 5ns resolution.

If you could provide examples or guidance on implementing HR deadband capabilities in the F280049C, it would greatly help in resolving this issue.

  • Hi Akash,

    Let me find something for you. Please give me till end of day tomorrow.

    Best,

    Ryan Ma

  • Hi Akash,

    Please find the .c and syscfg used to show deadband hr functionality. Since the DBHR only runs in half cycle mode if the TBCLK is 10nsec, then maximum sweep it can do with high resolution is 5nsec beyond which you can use mix for db and dbhr extension registers to achieve the required deadband

    You can open ex1 for hrpwm and manually edit the syscfg file and .c from below and run.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    //#############################################################################
    //
    // FILE: hrpwm_ex11_dbhr_sfo.c
    //
    // TITLE: HRPWM DB HR Control with SFO in Up-down count mode.
    //
    //! \addtogroup driver_example_list
    //! <h1>HRPWM Deadband Control with SFO</h1>
    //!
    //! This example modifies the MEP control registers to show edge displacement
    //! for high-resolution deadband control with ePWM in Up down count mode
    //! due to the HRPWM control extension of the respective ePWM module.
    //!
    //! This example calls the following TI's MEP Scale Factor Optimizer (SFO)
    //! software library V8 functions:
    //!
    //! \b int \b SFO(); \n
    //! - updates MEP_ScaleFactor dynamically when HRPWM is in use
    //! - updates HRMSTEP register (exists only in EPwm1Regs register space)
    //! with MEP_ScaleFactor value
    //! - returns 2 if error: MEP_ScaleFactor is greater than maximum value of 255
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /**
    * Import the modules used in this configuration.
    */
    const epwm = scripting.addModule("/driverlib/epwm.js", {}, false);
    const epwm1 = epwm.addInstance();
    const epwm2 = epwm.addInstance();
    /**
    * Write custom configuration values to the imported modules.
    */
    epwm1.$name = "myEPWM1";
    epwm1.epwmTimebase_emulationMode = "EPWM_EMULATION_FREE_RUN";
    epwm1.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_1";
    epwm1.hrpwm_cmpaHR = 50;
    epwm1.hrpwm_cmpbHR = 50;
    epwm1.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP_DOWN";
    epwm1.epwmTimebase_counterModeAfterSync = "EPWM_COUNT_MODE_UP_AFTER_SYNC";
    epwm1.epwmCounterCompare_cmpA = 50;
    epwm1.epwmTimebase_syncOutPulseMode = "EPWM_SYNC_OUT_PULSE_DISABLED";
    epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Thanks

  • Thanks, Prarthan,

    I appreciate your support and guidance on implementing the high-resolution deadband functionality in the TMS320F280049C microcontroller. The C  and SysConfig-based configuration you provided is helpful, but I am not very familiar with using DriverLib functions.

    Would it be possible for you to provide the equivalent Bitfield-based code for configuring the ePWM module with high-resolution deadband control? Or alternatively, if you could guide me on how to translate this code to bitfield.

    Thank you

  • Hi,

    I would advise you look at the driverlib functions or look at the register configurations in CCS register view and come up with the corresponding bitfield writes.

    The static configuration for syscfg generated code is done in board_init() function call from main().

    I wont be able to write corresponding bitfield code for this example, eventually though you should also transfer to driverlib functions

    Thanks

  • Hi Prarthan,

    I tried modifying the driverlib code to use the bit-field approach. However, even with zero deadband, the waveforms are still not aligned. I tested this with both the code you provided and the bit-field version I wrote based on your code.

    I also experimented with the phase shift register but still couldn't achieve alignment for at zero deadband. I've attached a screenshot of the scope for reference.

    Let me know if you have any suggestions for resolving this.

  • Akash,

    I have also noticed that complete alignment of two is not possible. There is some phase shift as soon as deadband module was enabled

    But the DB HR was functioning properly.

    Thanks