Other Parts Discussed in Thread: C2000WARE
Dear team,
I'm trying to port code from eCAN to DCAN for the 280041C controller. This is the below line of code that was written for an eCAN controller.
//Disable the Mail Box 0
ECanaRegs.CANME.bit.ME0 = 0;
//Enable Acceptance Mask for Mail Box 0
ECanaMboxes.MBOX0.MSGID.bit.AME = 1;
//Enable Mail Box 0
ECanaRegs.CANME.bit.ME0 = 1;
//Enable both Standard and extended frames
ECanaLAMRegs.LAM0.bit.LAMI = 1;
//Set the mask to recevie IDs less than 256, (considered standard identifier)
// Bits 18-28 is for standard identifier. Set bit 18 to 25 to receive ID's less than 256
ECanaLAMRegs.LAM0.all = (ECanaLAMRegs.LAM0.all) | 0x3FC0000;
For example, if I want to change the setting of enabling the mailbox,
Can I use the below configuration?
//Disabling Mailbox
CanbRegs.CAN_IF1ARB.bit.MsgVal=0;
//Enabling acceptance mask for mailbox 0
CanbRegs.CAN_IF1MCTL.bit.UMask=1;
//Enabling Mailbox
CanbRegs.CAN_IF1ARB.bit.MsgVal=1;
//Enabling both Standard & extended frames
CanbRegs.CAN_IF1ARB.bit.Xtd=0;
//Bits 18-28 is for standard identifier. Set bit 18 to 25 to receive ID's less than 256
CanbRegs.CAN_IF1MSK.all=(CanbRegs.CAN_IF1MSK.all)||0X3FC0000;
Can you please suggest the changes/modifications that should be made while porting the code to DCAN controller(280041C)
Thanks,
Harish K.