2006-04-10 12:39 AM
using STR710 timer1 to count external pulses
2006-04-07 04:46 PM
I am using STR710 timer1 to count external pulses.
When the timer1 Overflow,It can't jump to the IRQHandler.I don't know why! // try to make sure that timer1 is in ''normal'' mode // Initialize the Timer 1 TIM_Init ( TIM1 ); TIM_ClockSourceConfig ( TIM1, TIM_EXTERNAL );//TIM_EXTERNAL TIM_ClockLevelConfig ( TIM1, TIM_RISING ); // TIM_FALLING TIM_ITConfig(TIM1, TIM_TO_IT, ENABLE); GPIO_Config (GPIO1, 0x0010, GPIO_IN_TRI_CMOS);//pin 1.4,extclk [ This message was edited by: dom on 08-04-2006 10:57 ]2006-04-09 09:15 PM
You need to add some statement:
TIM_CounterConfig(TIM1,TIM_START); //Start counting TIM_FlagClear(TIM1, TIM_TOF); //Clear overflow flag TIM_ITConfig(TIM1,TIM_TOF,ENABLE); //enable this int (overflow). remove your line: TIM_ITConfig(TIM1, TIM_TO_IT, ENABLE); in your int, you need to call: TIM_FlagClear(TIM1, TIM_TOF); //Clear overflow flag. Chris.2006-04-10 12:39 AM
I found some strange! When I using TIM0 for periodic timer interrupt and TIM1 to count external pulses,It only respond the TIM0 periodic interrupt .
TIM1 Overflow interrupt never respond. When I just using TIM1 to count external pulses,it can jump to the ISR.