我正在学习2812,从网上载了一个小程序,定时器中断的. 可是运行时,发现定时器正常计数,但是不进中断. 请高手帮忙,多谢! 下面是主程序和中断程序: #include "DSP281x_Device.h" // DSP281x Headerfile Include File #include "DSP281x_Examples.h" // DSP281x Examples Include File
interrupt void cpu_timer0_isr(void);
void main(void) {
InitSysCtrl();
DINT;
InitPieCtrl(); IER = 0x0000; IFR = 0x0000;
InitPieVectTable();
EALLOW; // This is needed to write to EALLOW protected registers PieVectTable.TINT0 = &cpu_timer0_isr; EDIS; // This is needed to disable write to EALLOW protected registers
InitCpuTimers(); // For this example, only initialize the Cpu Timers
ConfigCpuTimer(&CpuTimer0, 100, 1000000); StartCpuTimer0();
IER |= M_INT1;
PieCtrlRegs.PIEIER1.bit.INTx7 = 1;
EINT; // Enable Global interrupt INTM ERTM; // Enable Global realtime interrupt DBGM
for(;;
}
interrupt void cpu_timer0_isr(void) { CpuTimer0.InterruptCount++;
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1; }
|