求问在DSP2812中 PieVectTable用法
[复制链接]
在例程1中
#include "DSP28_Device.h"
unsigned int *LedADDR = (unsigned int *) 0x2800; //8个发光二极管寄存器地址
unsigned int Count,Flag;
/////////////////对应位低电平点亮该位发光二极管
const Uint16 LedCode[9]={0x7F,0xBF,0xDF,0xEF,0xF7,0xFB,0xFD,0xFE,0xFF};
interrupt void ISRTimer0(void);
void main(void)
{
InitSysCtrl(); //初始化系统
DINT; //关中断
IER = 0x0000;
IFR = 0x0000;
InitPieCtrl(); //初始化PIE
InitPieVectTable(); //初始化PIE中断矢量表
InitPeripherals(); //初始化外设
InitGpio();
EALLOW;
PieVectTable.TINT0 = &ISRTimer0;
EDIS;
Count = 0; //初始化变量
Flag=0;
ConfigCpuTimer(&CpuTimer0, 10, 10000000); //设置CPU
StartCpuTimer0();
IER |= M_INT1; //开中断
PieCtrl.PIEIER1.bit.INTx7=1;
EINT; // 允许INTM
ERTM; // 允许DBGM
*LedADDR = 0x00; // 点亮全部8个LED灯
for(;;)
{ ; }
}
interrupt void ISRTimer0(void)
{
PieCtrl.PIEACK.bit.ACK7=1;
*LedADDR = LedCode[Count]; //依次点亮灯,置相应位低电平
if (Flag==0) Count++;
if (Count>=8)//循环
{
Flag=0;
Count=0;}
}
在例程9中
#include "DSP28_Device.h"
unsigned int *LedADDR = (unsigned int *)0x2800; //LED 控制寄存器
interrupt void ExtIntISR(void);
Uint16 Temp;
void main(void)
{
InitSysCtrl(); //初始化系统
DINT; //关中断
IER = 0x0000;
IFR = 0x0000;
InitPieCtrl(); //初始化PIE
InitPieVectTable(); //初始化PIE中断矢量表
InitPeripherals(); //初始化外设
InitGpio(); //初始化GPIO
InitXIntrupt(); //初始化外部中断
EALLOW;
PieVectTable.XINT1 = &ExtIntISR;
EDIS;
*LedADDR=0xFF; //turn off all led lights
IER |= M_INT1; //开中断
PieCtrl.PIEIER1.bit.INTx4 = 1; //外部中断1所在PIE分组1中的第4位
EINT; // Enable INTM
ERTM; // Enable DBGM
Temp=0xFF;
for(;;);
}
interrupt void ExtIntISR(void)
{
PieCtrl.PIEACK.all = 0xFFFF;
PieCtrl.PIEIFR1.bit.INTx4 = 0;
ERTM;
Temp^=0xFF;
*LedADDR = Temp;
}
出现的PieVectTable,想请问其作用及其用法,谢谢
|