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.

[参考译文] CCS/TMS320F2.8335万:计时器配置C2000

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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/575202/ccs-tms320f28335-timer-configuration-c2000

部件号:TMS320F2.8335万
主题:controlSUITE中讨论的其他部件

工具/软件:Code Composer Studio

大家好,自从4年以来,我们使用了真正有用的源文件来配置C2000硬件。

例如 计时器配置,此处为源代码(见下文),它随多种工具(如controlSUITE)一起提供。

我想知道,这一行是否正确,以获得确切的期望时间:

温度=(长)(频率*周期);

是否有可能,一个周期的差异?

正确的代码必须是:

温度=(长)(频率*周期)-1

????

BR Ralf

void ConfigCpuTimer(struct CPUTIME_VARS *Timer,float Freq,float period)

   UINT32 温度;

   //初始化计时器周期:
   Timer->CPUFreqInMHz =频率;
   Timer->PeriodInUSec =周期;
   温度=(长)(频率*周期);
   Timer->RegsAddr->PRD.All =临时;

   //将预刻度计数器设为除以1 (SYSCLKOUT):
   Timer->RegsAddr->TPR.All =0;
   Timer->RegsAddr->Thp.all = 0;

   //初始化定时器控制寄存器:
   Timer->RegsAddr->TCR.bit.tss=1;//1=     停止计时器,0=启动/重新启动计时器
   Timer->RegsAddr->tcr.bit.trb =1;//     1=重新加载计时器
   Timer->RegsAddr->tcr.bit.soft =1;
   Timer->RegsAddr->tcr.bit.free =1;//    计时器空闲运行
   Timer->RegsAddr->TCR.bit.tie =1;//     0=禁用/1=启用计时器中断

   //重置中断计数器:
   Timer-> InterruptCount = 0;
}

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

    这在以后的设备的设备支持标头中得到了解决,但在您更正后,F2.8335万x的设备支持标头中不会得到解决。 我将提交一个TT以修复此问题。



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

    您好,Santosh:

    感谢您提供信息,此问题已解决。

    BR Ralf