下面是主程序:
#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(;
{asm(\" nop\";
asm(\" nop\";
}
}
interrupt void cpu_timer0_isr(void)
{
CpuTimer0.InterruptCount++; //断点在这,但运行不到这里
asm(\" nop\");
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
}
//===========================================================================
// No more.
//===========================================================================
|