我想想用CPUTimer计算一个50HZ方波的周期,用外部中断,进入中断后,停止计数器,读计数器的计数值,然后重装计数器。可是它不重装啊,我不晓得程序哪里是不是有问题,想了半天,也没弄清楚,求大神帮忙看一下,interrupt void button_isr(void)
{
if(Xint1Count>=50){
Xint1Count = 0;
}
TIMER_stop(myTimer0);
// TIMER_setPeriod(myTimer0, 60 * 1000000);
TIMER_reload(myTimer0);
// InitCpuTimers();
//TIMER_setPreScaler(myTimer0, 0);
LinePeriod[Xint1Count] = TIMER_getCount(myTimer0);
TIMER_start(myTimer0);
Xint1Count++;
PIE_clearInt(myPie, PIE_GroupNumber_1);
} |