TI中文支持网
TI专业的中文技术问题搜集分享网站

关于C2000的TIMER_reload()的发现。有哪理解错的话请指出,谢谢。

timer.c中的TIMER_reload()函数中写:

// clear the bits
timer->TCR &= (~(uint32_t)TIMER_TCR_TRB_BITS);

TRB:

CPU-Timer Reload bit.
0 The TRB bit is always read as zero. Writes of 0 are ignored.
1 When you write a 1 to TRB, the TIMH:TIM is loaded with the value in the PRDH:PRD,
and the prescaler counter (PSCH:PSC) is loaded with the value in the timer dividedown
register (TDDRH:TDDR).

置一才reload,所以例程函数写错了。

Eric Ma:

Junjie,

感谢你的发现,已将发现的bug提交上去,下一版本的例程会修改这个问题。

正确的代码为:

timer->TCR |= TIMER_TCR_TRB_BITS;

-Eric

赞(0)
未经允许不得转载:TI中文支持网 » 关于C2000的TIMER_reload()的发现。有哪理解错的话请指出,谢谢。
分享到: 更多 (0)