在用28379的PWM中断的时候,中断配置在计数值等于周期值的时候进入,但是运行的时候总是跳入了DSP默认的中断:
interrupt void EPWM1_ISR(void)
{
//
// Insert ISR Code here
//
//
// To receive more interrupts from this PIE group,
// acknowledge this interrupt.
// PieCtrlRegs.PIEACK.all = PIEACK_GROUP3;
//
//
// Next two lines for debug only to halt the processor here
// Remove after inserting ISR Code
//
asm (" ESTOP0");
for(;;);
}
而我自己定义的中断一直进不去后来发现是EALLOW; EDIS;的使用问题,这两个命令必须紧挨着中断向量重定义语句:
EALLOW;
PieVectTable.EPWM1_INT = &self_PWM1INT3_1_ISR;
EDIS;
如下这个样子就不行了:
EALLOW;
语句1;
语句2;
·······
PieVectTable.EPWM1_INT = &self_PWM1INT3_1_ISR;
语句1;
语句2;
······
EDIS;