TMS320F280039C: PWM global load的问题

Part Number: TMS320F280039C

PWM设置为global load模式(见下面代码),但是好像对PWM的DBCTL寄存器不起作用

调用下面这句代码,好像设定的值马上生效,而不是等到global load时才生效

请帮忙看一下这是什么问题?

EPWM_setFallingEdgeDeadBandDelayInput(pwmBase, EPWM_DB_INPUT_EPWMB);   // 设定的值马上生效,而不是等到global load时才生效

【PWM设置global load模式】

uint16_t globalLoadRegsFlag =
    EPWM_GL_REGISTER_DBCTL // 针对死区使能寄存器
    | EPWM_GL_REGISTER_AQCTLA_AQCTLA2 // 针对A pin的action
    | EPWM_GL_REGISTER_AQCTLB_AQCTLB2 // 针对B pin的action
    | EPWM_GL_REGISTER_TBPRD_TBPRDHR
    | EPWM_GL_REGISTER_CMPA_CMPAHR
    | EPWM_GL_REGISTER_CMPB_CMPBHR
    | EPWM_GL_REGISTER_DBRED_DBREDHR
    | EPWM_GL_REGISTER_DBFED_DBFEDHR;
EPWM_enableGlobalLoadRegisters(myEPWM1_BASE, globalLoadRegsFlag);
EPWM_setGlobalLoadTrigger(myEPWM1_BASE, EPWM_GL_LOAD_PULSE_CNTR_ZERO_PERIOD);
EPWM_enableGlobalLoadOneShotMode(myEPWM1_BASE);
EPWM_enableGlobalLoad(myEPWM1_BASE);

  • 已经收到了您的案例,调查需要些时间,感谢您的耐心等待

  • 您好

    重要调试问题:

    您是否正在调用启用DBCTL影子加载模式的EPWM_setDeadBandControlShadowLoadMode()?
    全局负载的描述(设备TRM第20.4.7节)指出了以下几点,重点是我的:
    启用此功能后,对于启用此模式的所有寄存器,内容从影子寄存器到活动寄存器的传输发生在全局影子到活动负载控制寄存器(GLDCTL[GLDMODE])中配置位定义的同一事件上

    如果上述方法未能解决问题,则提出二次调试问题:

    何时调用EPWM_setFallingEdgeDeadBandDelayInput(),如何验证更改是否立即发生?

    相对于EPWM_setFallingEdgeDeadBandDelayInput(),何时调用EPWM_setGlobalLoadOneShotMatch()?

  • 这都是什么意思?  能否用心好好翻译一下

  • 您好

    Important Debug Question(s):

    • Are you calling EPWM_setDeadBandControlShadowLoadMode() which enables the DBCTL shadow load mode?
      • The description for Global Load (section 20.4.7 of the device TRM) notes the following, emphasis mine:
        • When this feature is enabled, the transfer of contents from the shadow register to the active register, for all registers that have this mode enabled, occurs at the same event as defined by the configuration bits in Global Shadow to Active Load Control Register (GLDCTL[GLDMODE])

    Secondary Debug Question(s) if the above did not solve the problem: 

    • When are you calling EPWM_setFallingEdgeDeadBandDelayInput() and how are you verifying that the change is taking place immediately?

    • When is EPWM_setGlobalLoadOneShotLatch() being called, relative to EPWM_setFallingEdgeDeadBandDelayInput()?
x 出现错误。请重试或与管理员联系。