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.

tms320c6678定时器中断

Other Parts Discussed in Thread: TMS320C6678

你好:
     最近在调试TMS320C6678的定时器中断,我的板子是TMDXEVM6678L,环境CCS5.2。我的工程是基于E:\ti\pdk_C6678_1_1_2_6\packages\ti\csl\example\timer建立的,主要调试的是定时器中断的Continuous Mode,这里我有个不明白的地方,希望解答一下:
   在上述路径的timer_test.c源文件的tatic Int32 test_high_continuous_timer (Uint8 IntcInstance)函数中,对于
Uint32 LoadValue = 1000;
这里LoadValue 这个参数代表的意义是the period register的值吧,而当LoadValue = 1000时,此时定时器中断是多长时间触发一次呢?也就是说此时计算时间的输入时钟是多少?
       因为我查阅KeyStone Architecture TIMER64P User Guide时,有这样一段话The CLKDIV field of this register also can be read to identify the ratio of the CPU clock to the timer input clock. For example, in devices where the internal timer clock frequency is equal to the CPU frequency divided by 6, the CLKDIV field will read as 6 on those devices. 按照次表述,我的Timer0的EMUMGT_CLKSPD 寄存器的CLKDIV位值为6,但是这样算下来我感觉我的定时器中断时间和表述对不上啊。这里应当怎么计算呢?
谢谢!
  • 你需要确认下LoadValue是不是真正配置到Timer里面的Period register里面去了。可能这只是个接口值,你需要仔细查看代码。

    Timer64的输入时钟一般是1/6的CPU时钟,因此你跑1G的CPU那么你Timer64的每个周期就是6ns,如果像你说的配置为1000那么也就是6us。这个值很小的,一般都不会这样配置。因此建议你仔细看看代码,一定要看到寄存器配置级别。