- UID
- 924695
|
Dsp28335中断的方法
步骤1
void InitPieCtrl(void) //初化PIE控制寄存器
{
DINT; //关闭所有CPU标准中断Disable Interrupts at the CPU level:
PieCtrlRegs.PIECTRL.bit.ENPIE = 0; // 关闭所有PIE中断Disable the PIE
// Clear all PIEIER registers: 清除所有中断使能位
PieCtrlRegs.PIEIER1~12(省了中问部分).all = 0;
// Clear all PIEIFR registers: 清除所有中断标志位
PieCtrlRegs.PIEIFR1~12.all = 0;
}
步骤2
// Disable CPU interrupts and clear all CPU interrupt flags:
IER = 0x0000;
IFR = 0x0000;
步骤3 初始化中断向量表
void InitPieVectTable(void)
{ int16 i;
Uint32 *Source = (void *) &PieVectTableInit;
Uint32 *Dest = (void *) &PieVectTable;
EALLOW;
for(i=0; i < 128; i++)
*Dest++ = *Source++;
EDIS;
// Enable the PIE Vector Table
PieCtrlRegs.PIECTRL.bit.ENPIE = 1;
Dsp28335中断的方法.pdf (676.36 KB)
|
|