具体我没有测试过;给你些程序参考;是当时我帮莫纳克系统制作的NICE 3000外呼显示器;只要设置正确;中断服务函数没有写错就行;实在感觉精度误差可采用外部晶振;采用TIM1可以进行16位任意分频。
void TIM2_Init(void)
{
//TIM2_DeInit();
TIM2_TimeBaseInit(TIM2_PRESCALER_32768, 0x1000);
TIM2_SetCounter(0);
TIM2_ARRPreloadConfig(ENABLE);
TIM2_ITConfig(TIM2_IT_UPDATE, ENABLE);
TIM2_Cmd(DISABLE);
}
INTERRUPT_HANDLER(TIM2_UPD_OVF_BRK_IRQHandler, 13)
{
/* In order to detect unexpected events during development,
it is recommended to set a breakpoint on the following instruction.
*/
TIM2_ClearITPendingBit(TIM2_IT_UPDATE);