void TIM1_Init(void)
{
rcu_periph_clock_enable(RCU_TIMER1);
timer_parameter_struct timer_initpara;
timer_deinit(TIMER1);
/* TIMER0 configuration */
timer_initpara.prescaler = 11;//count clk = 120M/12=10Mhz //配置好后, 无法工作
timer_initpara.alignedmode = TIMER_COUNTER_EDGE;
timer_initpara.counterdirection = TIMER_COUNTER_UP;
// timer_initpara.period = 29999;//300毫秒进一次中断
timer_initpara.period = 4999;//100毫秒进一次中断
timer_initpara.clockdivision = TIMER_CKDIV_DIV1;
timer_initpara.repetitioncounter = 0;
timer_init(TIMER1,&timer_initpara);
}
==================================================
上面代码 配置定时器1,计数时钟是10M, 为什么没法工作? 有哪位大神知道吗? |