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.

C6713的Timer的使用



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

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

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

//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);