编译环境:IAR 1.3 TIM4的设置代码如下: TIM4->ARR = 155; //10ms中断一次 TIM4->SCR = TIM4_PRESCALER_128 ; //128分频 TIM4->SR1 = 0; TIM4->IER = 0X01; //允许中断 TIM4->CR1 = 0X81; //启动自动装载,启动时钟 中断如下: INTERRUPT_HANDLER(TIM4_UPD_OVF_IRQHandler, 23) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ //毫秒计数器加1,仅仅是用于表示TIM4持续运行了多少个10毫秒 // inc_ms_count(); read_key();//更新键盘状态 /* 清楚更新标志 */ TIM4->SR1 = 0 ; } 但是无法进入中断.奇怪了.不知道是哪里出了问题? |