#include "inc/DSP28_Device.h"
unsigned int *Led = (unsigned int *)0x4100; //输出IO口的低16位地址
unsigned int num;
void init_eva(void)
{
EvaRegs.T1CMPR=0;
EvaRegs.T1PR=0x2fff;
EvaRegs.GPTCONA.all=0;
EvaRegs.EVAIMRA.bit.T1PINT=1;启用周期中断
EvaRegs.EVAIFRA.bit.T1PINT=1;
EvaRegs.T1CON.all=0x1742;
}
interrupt void t_isr(void)
{
*Led=num++;
PieCtrl.PIEACK.all=0xffff;
EvaRegs.EVAIMRA.bit.T1PINT=1;
EvaRegs.EVAIFRA.bit.T1PINT=1;复位标志位
}
void main(void)
{
InitSysCtrl();
init_eva();
DINT;
IER = 0x0000;
IFR = 0x0000;
/*初始化PIE*/
InitPieCtrl();
/*初始化PIE中断矢量表*/
InitPieVectTable();
EALLOW;
PieVectTable.T1PINT=&t_isr;
EDIS;
PieCtrl.PIEIER2.all=M_INT4;
IER |=M_INT2;
EINT;
ERTM;
*Led=0xfe;
while(1);
}
eva2.rar
(83.52 KB)
|