Tool/software:
Hi yall,
I must receive these groups of CAN IDs
- Group 1 CAN ID: 0x510, 0x511, 0x512, ..., 0x519
- Group 2 CAN ID: 0x520, 0x521, 0x522, ..., 0x529
- Group 3 CAN ID: 0x530, 0x531, 0x532, ..., 0x539
I set up three mailboxes as follows:
- MSGIDs (1, 2, and 3) to receive different groups of CAN IDs.
ECanbMboxes.MBOX1.MSGID.all = 0x54400000; // Mail box ID = 0x510
ECanbMboxes.MBOX2.MSGID.all = 0x54800000; // Mail box ID = 0x520
ECanbMboxes.MBOX3.MSGID.all = 0x54C00000; // Mail box ID = 0x530
- Local-Acceptance-Mask Register
ECanbLAMRegs.LAM1.bit.LAMI = 1; // This allows standard and extended frames can be received
ECanbLAMRegs.LAM1.bit.LAM_H = 0x1470; // This allows standard and extended frames can be received
ECanbLAMRegs.LAM1.bit.LAM_L = 0xFFFF; // This allows standard and extended frames can be received
ECanbLAMRegs.LAM2.bit.LAMI = 1; // This allows standard and extended frames can be received
ECanbLAMRegs.LAM2.bit.LAM_H = 0x14B0; // This allows standard and extended frames can be received
ECanbLAMRegs.LAM2.bit.LAM_L = 0xFFFF; // This allows standard and extended frames can be received
ECanbLAMRegs.LAM3.bit.LAMI = 1; // This allows standard and extended frames can be received
ECanbLAMRegs.LAM3.bit.LAM_H = 0x14F0; // This allows standard and extended frames can be received
ECanbLAMRegs.LAM3.bit.LAM_L = 0xFFFF; // This allows standard and extended frames can be received
When I ran the program, all CAN ID frames were received by mailbox3.
If I commented out these lines
// ECanbLAMRegs.LAM2.bit.LAMI = 1; // This allows standard and extended frames can be received
// ECanbLAMRegs.LAM2.bit.LAM_H = 0x14B0; // This allows standard and extended frames can be received
// ECanbLAMRegs.LAM2.bit.LAM_L = 0xFFFF; // This allows standard and extended frames can be received
//
// ECanbLAMRegs.LAM3.bit.LAMI = 1; // This allows standard and extended frames can be received
// ECanbLAMRegs.LAM3.bit.LAM_H = 0x14F0; // This allows standard and extended frames can be received
// ECanbLAMRegs.LAM3.bit.LAM_L = 0xFFFF; // This allows standard and extended frames can be received
I can receive all CAN IDs (0x510 to 0x519) in mailbox1.
If I commented out these lines
// ECanbLAMRegs.LAM3.bit.LAMI = 1; // This allows standard and extended frames can be received
// ECanbLAMRegs.LAM3.bit.LAM_H = 0x14F0; // This allows standard and extended frames can be received
// ECanbLAMRegs.LAM3.bit.LAM_L = 0xFFFF; // This allows standard and extended frames can be received
I can receive all CAN IDs (0x510 to 0x519 and 0x520 to 0x529) in mailbox2.
This meant that a higher mailbox number has a higher priority to receive messages.
My question: Is there any way to set up each mailbox to receive a group of CAN IDs as above?
Thank you very much for your help.