2009-07-09 04:23 AM
cant read TIM3 counter
2011-05-17 04:17 AM
i enabled TIM2 & TIM3 and did settings like:
TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure; TIM_OCInitTypeDef TIM_OCInitStructure; /* Time base configuration */ TIM_TimeBaseStructure.TIM_Period = 999; TIM_TimeBaseStructure.TIM_Prescaler = 0; TIM_TimeBaseStructure.TIM_ClockDivision = 0; TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; TIM_TimeBaseInit(TIM3, &TIM_TimeBaseStructure); /* Output Compare Timing Mode configuration: Channel1 */ TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_Timing; TIM_OCInitStructure.TIM_Channel = TIM_Channel_1; TIM_OCInitStructure.TIM_Pulse = 0; TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High; TIM_OCInit(TIM3, &TIM_OCInitStructure); TIM_OC1PreloadConfig(TIM3, TIM_OCPreload_Enable); /* TIM IT enable */ TIM_ITConfig(TIM3, TIM_IT_CC1, ENABLE); /* TIM2 enable counter */ TIM_Cmd(TIM3, ENABLE); then i watch the counter value as: a=TIM_GetCounter(TIM3); nothing wrong with TIM2 but couldnt read TIM3 value. what is wrong with TIM3?? thanks in advance