Timer_A_initUpModeParam param = {0};
param.clockSource = TIMER_A_CLOCKSOURCE_ACLK;
param.clockSourceDivider = TIMER_A_CLOCKSOURCE_DIVIDER_1;
param.timerPeriod = 328;
param.timerInterruptEnable_TAIE = TIMER_A_TAIE_INTERRUPT_DISABLE;
param.captureCompareInterruptEnable_CCR0_CCIE = TIMER_A_CCIE_CCR0_INTERRUPT_ENABLE;
param.timerClear = TIMER_A_DO_CLEAR;
param.startTimer = true;
Timer_A_initUpMode(TIMER_A0_BASE, ¶m);
Timer_A初始化程序如上所示,在中断函数中反转某个I/O,用示波器观察,方波的频率和占空比都在变化,这是为什么?如果将param.timerPeriod 的值增大,例如param.timerPeriod = 3277,则得到的方波频率和占空比都不会变化,param.timerPeriod是写入TAxCCR0寄存器,应该没有最小限制值得说法吧,ACLK=32768Hz
m:
?
灰小子:
能否上传你完整的代码,怀疑有些配置在其他地方被修改了