SPRAD12A July   2022  – February 2023 F29H850TU , F29H859TU-Q1 , TMS320F280021 , TMS320F280021-Q1 , TMS320F280023 , TMS320F280023-Q1 , TMS320F280023C , TMS320F280025 , TMS320F280025-Q1 , TMS320F280025C , TMS320F280025C-Q1 , TMS320F280033 , TMS320F280034 , TMS320F280034-Q1 , TMS320F280036-Q1 , TMS320F280036C-Q1 , TMS320F280037 , TMS320F280037-Q1 , TMS320F280037C , TMS320F280037C-Q1 , TMS320F280038-Q1 , TMS320F280038C-Q1 , TMS320F280039 , TMS320F280039-Q1 , TMS320F280039C , TMS320F280039C-Q1 , TMS320F280040-Q1 , TMS320F280040C-Q1 , TMS320F280041 , TMS320F280041-Q1 , TMS320F280041C , TMS320F280041C-Q1 , TMS320F280045 , TMS320F280048-Q1 , TMS320F280048C-Q1 , TMS320F280049 , TMS320F280049-Q1 , TMS320F280049C , TMS320F280049C-Q1 , TMS320F28075 , TMS320F28075-Q1 , TMS320F28076 , TMS320F28374D , TMS320F28374S , TMS320F28375D , TMS320F28375S , TMS320F28375S-Q1 , TMS320F28376D , TMS320F28376S , TMS320F28377D , TMS320F28377D-EP , TMS320F28377D-Q1 , TMS320F28377S , TMS320F28377S-Q1 , TMS320F28378D , TMS320F28378S , TMS320F28379D , TMS320F28379D-Q1 , TMS320F28379S , TMS320F28384D , TMS320F28384D-Q1 , TMS320F28384S , TMS320F28384S-Q1 , TMS320F28386D , TMS320F28386D-Q1 , TMS320F28386S , TMS320F28386S-Q1 , TMS320F28388D , TMS320F28388S , TMS320F28P550SJ , TMS320F28P559SJ-Q1 , TMS320F28P650DH , TMS320F28P650DK , TMS320F28P650SH , TMS320F28P650SK , TMS320F28P659DH-Q1 , TMS320F28P659DK-Q1 , TMS320F28P659SH-Q1

 

  1.   Abstract
  2.   Trademarks
  3. Introduction
  4. SysConfig
  5. Time-Base (TB) Submodule
    1. 3.1 Setting the Frequency
    2. 3.2 Applying a Phase Shift
    3. 3.3 Setting up the Synchronization (Sync) Scheme
  6. Counter-Compare (CC) and Action-Qualifier (AQ) Submodules
    1. 4.1 Calculating the Duty Cycle
  7. Deadband (DB) Submodule
    1. 5.1 Setting up Signal Pairs
  8. Verifying the Output
    1. 6.1 Checking the Duty Cycle and Dead-Time Insertion
    2. 6.2 Checking the Phase Shift Applied
  9. Trip-Zone (TZ) and Digital Compare (DC) Submodules
    1. 7.1 Drive Outputs Low for an ePWM Cycle Upon Trip Condition Set Through CMPSS
    2. 7.2 Drive Outputs Low Until Cleared Through Software Upon Trip Condition set Through GPIO
  10. Event-Trigger (ET) Submodule
    1. 8.1 Setting Up Time-Base Interrupts
  11. Global Load
    1. 9.1 Applying Global Loading and One-Shot Load Feature
    2. 9.2 Linking the ePWM Modules
    3. 9.3 Updating Action Qualifier Settings and Counter Compare Values Through Global Loading
  12. 10Summary
  13. 11References
  14. 12Revision History

Applying Global Loading and One-Shot Load Feature

Global loading is a feature within the ePWM module that allows a single event to be the source to update multiple key parameters such as TBPRD, CMPA, CMPB, CMPC, CMPD, DBRED, DBFED, DBCTL, AQCTLA, AQCTLB, and AQCSFRC. These registers have shadow registers, which allow contents written to that register to be held in a “shadow” register until a specified event, such as when TBCTR=ZRO, PRD, or ZRO|PRD, at which point the content in the shadow register is transferred to the active register.

The one-shot load feature works in conjunction with the global-load feature. With normal global loading, the singular event that causes all of the active registers to update is occurring periodically. However, often times the new values that are required to update key ePWM parameters are not always ready by the next periodic event that is generating the global load signal. Therefore, the one-shot feature is used in order to update the active registers one-time only whenever all of the content is ready to be updated. This is extremely useful in applications where the control loop is happening in an asynchronous ISR such as a timer or ADC ISR, which is not running at a frequency multiple of the ePWM.

In this application report's use-case, the global-load/one-shot load feature is used to update the action qualifier settings as well as the counter compare values. The global-load settings for the action qualifier and counter compare submodules have already been configured. For more details, see GUID-868E2685-33E8-48EB-B563-D45CB5824928.html#GUID-868E2685-33E8-48EB-B563-D45CB5824928.

However, the Global Load section within SysConfig still needs to be configured to set up the overall Global Load and One-Shot Load feature.

Figure 9-1 Global Loading SysConfig Setup

The following code is generated from SysConfig. For the Action Qualifer and Counter Compare submodules, see GUID-868E2685-33E8-48EB-B563-D45CB5824928.html#GUID-868E2685-33E8-48EB-B563-D45CB5824928.

// EPWM1
EPWM_enableGlobalLoad(myEPWM1_BASE); EPWM_enableGlobalLoadOneShotMode(myEPWM1_BASE); 
EPWM_setGlobalLoadOneShotLatch(myEPWM1_BASE);
// EPWM2 (the code is the same for EPWM3, except for the base address)
EPWM_enableGlobalLoad(myEPWM2_BASE);  EPWM_enableGlobalLoadOneShotMode(myEPWM2_BASE);  
EPWM_setGlobalLoadOneShotEvent(myEPWM2_BASE);  
EPWM_setupEPWMLinks(myEPWM2_BASE, EPWM_LINK_WITH_EPWM_1, EPWM_LINK_GLDCTL2);