stm32f103c8的定时器时钟有人会算吗?
/* HCLK = SYSCLK (AHB CLK)*/
RCC_HCLKConfig(RCC_SYSCLK_Div1);
/* PCLK2 = HCLK (APB2)*/
RCC_PCLK2Config(RCC_HCLK_Div1);
/* PCLK1 = HCLK/2(APB1) */
RCC_PCLK1Config(RCC_HCLK_Div2); //36M
/* Time base configuration */
TIM_TimeBaseStructure.TIM_Period = 0xFFFF;
TIM_TimeBaseStructure.TIM_Prescaler = 0x00;
TIM_TimeBaseStructure.TIM_ClockDivision = 0x0;
TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
TIM_TimeBaseInit(TIM2, &TIM_TimeBaseStructure);
/* Prescaler configuration */
TIM_PrescalerConfig(TIM2, 0x2328, TIM_PSCReloadMode_Immediate);
总监说时间周期是2ms,我怎么也算不出来,和网上人家的算法好像也不一样,特别是TIM_TimeBaseStructure.TIM_Period = 0xFFFF; //为什么是0xffff
TIM_TimeBaseStructure.TIM_Prescaler = 0x00; //是不是0x2328啊 |