用STM32编写频率计(捕获模式),为什么最高只能到500KHz
//初始化TIM3参数
TIM_TimeBaseStructure.TIM_Period = 60005; //自动重装寄存器的值
TIM_TimeBaseStructure.TIM_Prescaler = (1200 - 1); //时钟预分频数(时钟频率=72M/(时间预分频数 - 1))
TIM_TimeBaseStructure.TIM_ClockDivision = TIM_CKD_div1; //采样分频 未分频
TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
TIM_TimeBaseInit(TIM3,&TIM_TimeBaseStructure);
//初始化TIM2输入捕获通道2
TIM2_ICInitStructure.TIM_Channel = TIM_Channel_2; //选择输入端IC1映射到TI2上,这是硬件设定好的,需要看电路图;
TIM2_ICInitStructure.TIM_ICPolarity = TIM_ICPolarity_Rising; //上升沿捕获
TIM2_ICInitStructure.TIM_ICSelection = TIM_ICSelection_DirectTI; //映射到TI1上
TIM2_ICInitStructure.TIM_ICPrescaler = TIM_ICPSC_div1; //配置输入分频,不分频
TIM2_ICInitStructure.TIM_ICFilter = 0x00; //配置输入滤波 不滤波
TIM_ICInit(TIM2,&TIM2_ICInitStructure);
我现在也是遇到这样问题,能请教你吗?
怎么解决的?我也想知道怎么测量外部信号的频率