//定时时钟2初始化
tiM2_CR1_ARPE = 1;//自动预装载允许
TIM2_PSCR_PSC = 1;//预分频器为1
TIM2_ARRH = 0x0F;//在8MHz时 1mS定时
TIM2_ARRL = 0xA0;
TIM2_IER_UIE = 1;//允许更新中断
TIM2_CR1 |= 0x01;//使能计数器
#pragma vector = TIM2_OVR_UIF_vector
__interrupt void TIM2_OVER_UIF(void)
{
TIM2_SR1_UIF = 0;//清除中断标志位
}
IAR编译的,但
仿真时总不能进入中断
哪位可以帮忙看看?谢谢啦