Thread 中讨论的其他器件: SysConfig、 C2000WARE
您好!
我将使用 SysConfig 1.14.0和 CCS 12.1.0.00007来定义 launchxl-F28379D 的项目。
它大部分工作正常、但我注意到 ePWM 模块之间的相移在配置了 HRPWM 的情况下无法工作。
常规相移设置工作正常、启用 HRPWM 后、无论定义的相移值如何、我都将获得~3-4us 相移。
如何正确定义它?
谢谢、
奥伦
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.
您好!
我将使用 SysConfig 1.14.0和 CCS 12.1.0.00007来定义 launchxl-F28379D 的项目。
它大部分工作正常、但我注意到 ePWM 模块之间的相移在配置了 HRPWM 的情况下无法工作。
常规相移设置工作正常、启用 HRPWM 后、无论定义的相移值如何、我都将获得~3-4us 相移。
如何正确定义它?
谢谢、
奥伦
您好 Oren、
我能够使用 SysConfig 并在启用了 HR 支持的情况下应用相移。
EPWM1是1MHz 信号、AQ 事件在周期和 CMPA 时发生。
当周期 CMPA 切换为高电平、当 CMPA 事件发生时、AQ 事件切换为低电平。
EPWM2也是1MHz 信号、与 EPWM1相移180度。
两者都启用了 HRPWM。
以下是输出信号和 SysConfig 文件:
通道3是来自使用输出 XBAR 的 GPIO 的 EXTSYNCOUT 事件。
通道1为 EPWM1、通道2为 EPWM2。

您好 Oren、
是否可以尝试查看是否可以打开此 SYSCFG 文件? 它应与 C2000WARE 4.02.00.00一起使用。
e2e.ti.com/.../5226.c2000.syscfg
最棒的
Ryan Ma
e2e.ti.com/.../GaN_5F00_INV.txt
附件。 我已将文件扩展名从 syscfg 更改为 txt、因为出于某种原因、上传不适用于 syscfg。
嘿 Oren、
我能够将您的 syscfg 导入到一个项目中。 这样我们就可以从公共接地开始、我关闭了 HRPWM 并查看了 EPWM1A 和 EPWM2A 上的波形。
1、禁用 HRPWM 支持后、我将得到一个50kHz 信号、并且它们处于同步状态。

2、现在我启用了 HRPWM 并查看了它。 它们似乎不再同步

让我回到您的问题、了解一下原因。
此致、
Ryan Ma
您好 Oren、
我相信我已经找到了这个问题的原因。 验证后、我们将在 SysConfig 中为即将发布的版本处理此问题。 但是、当您在 SysConfig 中启用 HR 支持时、SysConfig 会替换此函数

/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --board "/boards/TMDSCNCD28379D" --context "CPU1" --product "C2000WARE@4.02.00.00"
* @versions {"tool":"1.14.0+2667"}
*/
/**
* Import the modules used in this configuration.
*/
const epwm = scripting.addModule("/driverlib/epwm.js");
const epwm1 = epwm.addInstance();
const epwm2 = epwm.addInstance();
/**
* Write custom configuration values to the imported modules.
*/
epwm.generateInitFunctions = true;
epwm.enableWarning = true;
epwm.enableInfo = true;
epwm1.$name = "Reset1";
epwm1.epwmTimebase_emulationMode = "EPWM_EMULATION_FREE_RUN";
epwm1.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_1";
epwm1.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_DOWN";
epwm1.epwmTimebase_syncOutPulseMode = "EPWM_SYNC_OUT_PULSE_ON_COUNTER_ZERO";
epwm1.epwmCounterCompare_cmpA = 200;
epwm1.epwmCounterCompare_shadowLoadModeCMPA = "EPWM_COMP_LOAD_ON_CNTR_PERIOD";
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_ZERO = "EPWM_AQ_OUTPUT_LOW";
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_HIGH";
epwm1.epwmEventTrigger_enableInterrupt = true;
epwm1.epwmEventTrigger_interruptSource = "EPWM_INT_TBCTR_PERIOD";
epwm1.epwmEventTrigger_EPWM_SOC_B_triggerEnable = true;
epwm1.epwmEventTrigger_EPWM_SOC_B_triggerSource = "EPWM_SOC_TBCTR_D_CMPB";
epwm1.epwmEventTrigger_EPWM_SOC_B_triggerEventPrescalar = "1";
epwm1.epwmEventTrigger_EPWM_SOC_B_triggerEventCountInitEnable = true;
epwm1.epwmEventTrigger_interruptEventCount = "1";
epwm1.hrpwm_controlModeA = "HRPWM_MEP_PHASE_CTRL";
epwm1.hrpwm_controlModeB = "HRPWM_MEP_PHASE_CTRL";
epwm1.epwmTimebase_period = 1999;
epwm1.hrpwm_period = 1999;
epwm1.hrpwm_duty = 10;
epwm1.hrpwm_enable = true;
epwm1.epwm.$assign = "EPWM1";
epwm2.$name = "Reset2";
epwm2.epwmTimebase_emulationMode = "EPWM_EMULATION_FREE_RUN";
epwm2.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_1";
epwm2.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_DOWN";
epwm2.epwmTimebase_syncOutPulseMode = "EPWM_SYNC_OUT_PULSE_ON_EPWMxSYNCIN";
epwm2.epwmCounterCompare_cmpA = 200;
epwm2.epwmCounterCompare_shadowLoadModeCMPA = "EPWM_COMP_LOAD_ON_CNTR_PERIOD";
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_ZERO = "EPWM_AQ_OUTPUT_LOW";
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_HIGH";
epwm2.epwmEventTrigger_enableInterrupt = true;
epwm2.epwmEventTrigger_interruptSource = "EPWM_INT_TBCTR_PERIOD";
epwm2.epwmDeadband_deadbandCounterClockRate = "EPWM_DB_COUNTER_CLOCK_HALF_CYCLE";
epwm2.epwmEventTrigger_EPWM_SOC_B_triggerEnable = true;
epwm2.epwmEventTrigger_EPWM_SOC_B_triggerSource = "EPWM_SOC_TBCTR_D_CMPB";
epwm2.epwmEventTrigger_EPWM_SOC_B_triggerEventPrescalar = "1";
epwm2.epwmEventTrigger_interruptEventCount = "15";
epwm2.epwmTimebase_phaseEnable = true;
epwm2.hrpwm_controlModeA = "HRPWM_MEP_PHASE_CTRL";
epwm2.hrpwm_controlModeB = "HRPWM_MEP_PHASE_CTRL";
epwm2.hrpwm_phaseLoadEnable = true;
epwm2.epwmTimebase_period = 1999;
epwm2.hrpwm_duty = 10;
epwm2.hrpwm_period = 20000;
epwm2.hrpwm_enable = true;
/**
* Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
* version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to
* re-solve from scratch.
*/
epwm1.epwm.epwmaPin.$suggestSolution = "hsecDigital.49";
epwm1.epwm.epwmbPin.$suggestSolution = "hsecDigital.51";
epwm2.epwm.$suggestSolution = "EPWM2";
epwm2.epwm.epwmaPin.$suggestSolution = "hsecDigital.53";
epwm2.epwm.epwmbPin.$suggestSolution = "hsecDigital.55";