//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:
定时时间和晶振频率有关系,你可以定一个长点的时间和标准时钟对比一下
TI中文支持网
