最近在用keil调试LM3S8962,调试非常慢,其中在用到定时器的时候,定时器配置如下:
void Init
timer0A(void)
[
TimerConfigure(TIMER0_BASE, TIMER_CFG_ONE_SHOT); // Configure the 32-bit periodic timers.
TimerPrescaleSet(TIMER0_BASE, TIMER_A, 8);//timerA clock is sysclock8Mhz/8= 1Mhz
TimerIntRegister(TIMER0_BASE, TIMER_A, TIMER0_IRQHandler);
IntEnable(INT_TIMER0A);//enable timer0A interrupt for mac
TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
TimerDisable(TIMER0_BASE, TIMER_A);//DISABLE timer
]
定时如下:
DISABLE_MAC_TIMER_INTERRUPT();// Disable Timer interrupt
STOP_MAC_TIMER();// Stop Timer
TimerLoadSet(TIMER0_BASE, TIMER_A, longTime);//initialize timer counter is 0
CLEAR_MAC_TIMER_INTERRUPT(); // Clear Timer interrupt
START_MAC_TIMER(); // Start Timer
现在我的longtime=50000u,当执行完START_MAC_TIMER();跳到下一句的时候就有中断标志产生,这不可能的啊,主频是8MHZ的,为什么会是这样的情况呢?
恳请各位高手指示,谢谢!