i had already included it: RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE); RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM3 , ENABLE); RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE);
in your previous post you wrote: ''RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM3 , ENABLE);'' But TIM3 is attached to APB1 and not to APB2. To enable the clock for TIM3 you must write: ''RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM3, ENABLE);'' Hope that helps. Regards, Florian
yep, they all work since i can get counter values from both TIM1 and TIM2 but not TIM3.... TIM2 and TIM3 are actually very similar what is the problem with TIM3; couldnt understand...
you are right! tim3 is not running; Are the system clocks running?
Code:
<BR> // Set the AHB clock (HCLK) equal to the system clock (SYSCLK). <BR> <BR> RCC_HCLKConfig(RCC_SYSCLK_Div1); <BR> <BR> // Set the (high speed) APB2 clock (PCLK2) to the system clock. <BR> // APB2 can run up to 72MHz. <BR> <BR> RCC_PCLK2Config(RCC_HCLK_Div1); <BR> <BR> // Set the (low speed) APB1 clock (PCLK1) to the system clock/2. <BR> // APB1 can only run up to 36MHz. <BR> <BR> RCC_PCLK1Config(RCC_HCLK_Div2); <BR>
[ This message was edited by: swhite on 09-07-2009 16:58 ]