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

C6713定时器的使用

//stop the timer
*(unsigned volatile int *)TIMER0_CTRL &= 0xff3f;

//set the work mode
/* Use CPU CLK/4 */
*(unsigned volatile int *)TIMER0_CTRL |= 0x200;

请教一下,下面的程序能实现1s的定时么?

//set the period
*(unsigned volatile int *)TIMER0_PRD |= 0xffffffff;
//start the timer
*(unsigned volatile int *)TIMER0_CTRL |= 0xC0;

//the number of timer input clock cycles to count number = *(unsigned volatile int *)TIMER0_COUNT;
timer=1000000*225/4;
while ((number – *(unsigned volatile int *)TIMER0_COUNT) < timer);

Denny%20Yang99373:

定时时间和晶振频率有关系,你可以定一个长点的时间和标准时钟对比一下

赞(0)
未经允许不得转载:TI中文支持网 » C6713定时器的使用
分享到: 更多 (0)