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.

[参考译文] TMS320F280039:在函数"EPWM_clearDigitalCompareCaptureStatusFlag"中找到 Driverlib 错误

Guru**** 2868450 points

Other Parts Discussed in Thread: C2000WARE

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1639775/tms320f280039-driverlib-bug-found-in-function-epwm_cleardigitalcomparecapturestatusflag

器件型号: TMS320F280039
主题: C2000WARE 中讨论的其他器件

我想知道为什么将 DigitalCompareCounterCaptureMode 配置为“disableClearMode"时“时、我的代码无法正常工作。 在此模式下、用户应通过 DriverLib 函数“EPWM_clearDigitalCompareCaptureStatusFlag"复“复位捕获标志。  我无法使用此函数清除状态标志、因为该函数实现有误。

文件 epwm.h 中 Driverlib C2000Ware_6_00_01_00 中的代码错误:

静态内联 void
EPWM_clearDigitalCompareCaptureStatusFlag (uint32_t base)

  //
  //检查参数
  //
  断言 (EPWM_isBaseValid (base));

  //
  //清除数字比较捕获状态标志
  //
  EALLOW;
  HWREGH (BASE + EPWM_O_DCCAPCTL)&=~Ω EPWM_DCCAPCTL_CAPCLR;
  EDIS;
}

 

正确代码:

静态内联 void
EPWM_clearDigitalCompareCaptureStatusFlag (uint32_t base)

  //
  //检查参数
  //
  断言 (EPWM_isBaseValid (base));

  //
  //清除数字比较捕获状态标志
  //
  EALLOW;
  HWREGH (BASE + EPWM_O_DCCAPCTL)|= EPWM_DCCAPCTL_CAPCLR;
  EDIS;
}

 

请在下一个版本中更正 driverlib!

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Oliver:

    感谢您指出这一点。 您完全了解了 DCCAPCTL 寄存器中的 CAPCLR 位。  写入 1 将清除此 CAPSTS (SET) 条件。 这将在 driverlib 中更新。

    此致、
    Harisyam