请教一个问题:我用IAR编译器,用定时器1输出比较模式中断的方式来定时用,程序如下,但进入不了TIMER1的中断服务程序,现像是:开了中断,计数器就不增值,从仿真器看出来的,请各位看看是什么问题,谢谢。
void T1TIMI_IRQHandler(void) { TIM1_SR&=0xBFFF; TIM1_CNTR=0xffff; if(g_Time1Count>0) g_Time1Count--; }
void CpuIni(void) { RCCU_CFR=0X00000008; // PCU_PLL2CR=0X00000037; // TIM1_CR2= 0x4000; //TIM1_CR2 比较模式 TIM1_CR1= 0x8000; //TIM1_CR1 TIM1_CNTR=0xFFFF; //TIM1_CNTR TIM1_OCAR=0x9C00; //TIM1_OCAR EIC_SIR_19|=0x00000001; //EIC->SIR[19] EIC_IER= 0X00080000; //EIC->IER EIC_ICR= 0x00000001; //EIC->ICR EIC_IPR0=0x00080000; //EIC_IPR0 } |