2008-06-23 01:54 AM
Can't get 4 Input Captures on TIM2
2011-05-17 03:37 AM
When I have TIM2 with all 4 channels configured as Input Capture, Capture on Ch1 doesnt work.
If I do not initialize Ch3, then I get captures on Ch1. Has anyone experienced this? Thanks2011-05-17 03:37 AM
Upon closer analysis, it looks like a problem with the Firmware library when initialising the timers. The code below actually load CCER with 0x1110 (Ch0 is disabled). By commenting the line that initilises Ch3, then CCER gets loaded with 0x1011 (Ch0 is enabled). When loading ''manually'' CCER with 0x1111 with TIM2->CCER = 0x1111, capture works on all 4 channels.
TIM_ICInitStructure.TIM_ICMode = TIM_ICMode_ICAP; TIM_ICInitStructure.TIM_Channel = TIM_Channel_1; TIM_ICInitStructure.TIM_ICPolarity = TIM_ICPolarity_Rising; TIM_ICInitStructure.TIM_ICSelection = TIM_ICSelection_DirectTI; TIM_ICInitStructure.TIM_ICPrescaler = TIM_ICPSC_DIV1; TIM_ICInitStructure.TIM_ICFilter = 0x0; TIM_ICInit(TIM2, &TIM_ICInitStructure); TIM_ICInitStructure.TIM_Channel = TIM_Channel_2; TIM_ICInit(TIM2, &TIM_ICInitStructure); TIM_ICInitStructure.TIM_Channel = TIM_Channel_3; TIM_ICInit(TIM2, &TIM_ICInitStructure); // Comment out to make Ch0 work TIM_ICInitStructure.TIM_Channel = TIM_Channel_4; TIM_ICInit(TIM2, &TIM_ICInitStructure); //TIM2->CCER = 0x1111; TempWord = TIM2->CCER; // Read CCER to check2011-05-17 03:37 AM
Quote:
it looks like a problem with the Firmware library
Which version?