最近在用STM32F207VGT6做一个测转速的功能,其他定时器都被占用了,只能用TIM12,但是发现的TIM12使能计时后SR的中断标志位就自动置位且无法清零。然后NVIC使能后就一直在中断,跳出中断后也还是会进入中断,中断服务中的SR寄存器清零语句也没用,完全无法正常工作。 麻烦各位大神帮忙看下是什么原因,谢谢了! 主程序如下 #include "main.h" #include "lcd.h" uint16_t VeloCount1 = 0; uint16_t VeloCount2 = 0; uint16_t MotorRotationSpeed = 0; uint8_t ICcount = 0; static void delay(unsigned int dl) { unsigned int i,y; for(i = 0; i < 5000; i++) { for(y = 0; y < dl; y++); } } int main(void) { unsigned char string[] = "speed="; unsigned char string1[4] = "0000"; RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM12,ENABLE); GPIO_LED_init(); GPIO_TIM12CH1IC_VelocityMeasure_init(); TIM12_InputCapture_Init(); lcd_init(); TIM_Cmd(TIM12, ENABLE); TIM_ITConfig(TIM12, TIM_IT_CC1, ENABLE); TIM12->SR &= ~(1 SR = 0; GPIOE->BSRRH |= (1 VeloCount1) { velo = TIM12_period + VeloCount2 - VeloCount1; } MotorRotationSpeed = TIM12_period / velo; ICcount = 0; } } TIM_ClearITPendingBit(TIM12, TIM_IT_CC1); } |
STM32F207+LWIP的网络丢包问题! 【悬赏问答】
STM32F207+DP83848+RTL8019可不可以实现双网口设计
深圳市旺宝电子STM32F207开发板例程集
STM32F2 器件 -25° 上电正常 复位就挂了
STM32F229 TIMER CNT问题
哪位工程师有STM32F2xx的寄存器手册?
STM32F2xx RTC启动不了,求助!!!!
STM32F2外部按键触发中断问题
STM32F205 低功耗模式有BUG?
STM32F207 两个ADC同时采样问题
RE:STM32F207的TIM12使能计时后SR的中断标志位就自动置位且无法清零
RE:STM32F207的TIM12使能计时后SR的中断标志位就自动置位且无法清零