Hellow,
I am trying to use the interrupt receive the message, I configure mailbox interrupt on Iine1, system interrupt on line0, and I use 3 mailboxes for receive, two of them use the OPC protection(22, 21), the key program as follows:
ECanbShadow.CANMIL.all = ECanbRegs.CANMIL.all;
ECanbShadow.CANMIL.bit.MIL20 = 1; // configure mailbox interrupt on Iine1
ECanbShadow.CANMIL.bit.MIL21 = 1;
ECanbShadow.CANMIL.bit.MIL22 = 1;
ECanbRegs.CANMIL.all= ECanbShadow.CANMIL.all ;
ECanbShadow.CANGIM.bit.GIL = 0; // system interrupt on line0
and I just configure ISR for mailbox 22, the program as follows:
interrupt void eCAN1INT_ISR(void)
{
struct ECAN_REGS ECanbShadow;
while(ECanbRegs.CANRMP.all != 0x00010000);
ECanbShadow.CANRMP.bit.RMP22 = 1;
ECanbRegs.CANRMP.all = ECanbShadow.CANRMP.all;
// Read data and Re–enable PIE and Core interrupts
readH = ECanbMboxes.MBOX22.MDH.all;
readL = ECanbMboxes.MBOX22.MDL.all;
PieCtrlRegs.PIEACK.bit.ACK9 = 1; // Enables PIE to drive a pulse into the CPU
IER |= 0x0100;
EINT;
int1count++;
return;
}
Now the problem is coming, I don t know how to configure the interrupt of the rest 2 mailbox on line 1 (one with OPC bit, other is not) and system interrupt on line0.
Can some one help me,please?