This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Setting DCAN for selected ID

Hi,

I am using the AM335x ICE v2.1 to receive CAN messages.  I wish to program different CAN message objects in the message RAM  to receive different ID messages. (NOTE This is under SYS/BIOS).  I have it successfully receiving messages but cannot seem to make it selective.  That is if I program a a slot with ID= 0x381 it receives messages with that ID but also with 0x382... 

I am using the code from dcanTxRx and the drivers and platform code for the V2.1 AM335x ICE as I have detailed in other messages on using CAN under SYS/BIOS.  In the code for dcan_frame.c the routine 

unsigned int CANRxObjectConfig(unsigned int baseAdd, can_frame* canPtr)

does this:

/* Use Acceptance mask. */
DCANUseAcceptanceMaskControl(baseAdd, DCAN_MASK_USED, DCAN_IF2_REG);

/* Configure the DCAN mask registers for acceptance filtering. */
DCANMsgObjectMskConfig(baseAdd, DCAN_IDENTIFIER_MSK(DCAN_ID_MASK,
DCAN_ID_MSK_11_BIT), DCAN_MSK_MSGDIR_DISABLE,
DCAN_MSK_EXT_ID_ENABLE, DCAN_IF2_REG);

This does not seem correct shouldn't it be DCAN_MSK_MSGDIR_ENABLE instead of DCAN_MSK_MSGDIR_DISABLE ?

However if I do that, putting this line in instead:

DCANMsgObjectMskConfig(baseAdd, DCAN_IDENTIFIER_MSK(DCAN_ID_MASK,
DCAN_ID_MSK_11_BIT), DCAN_MSK_MSGDIR_ENABLE,
DCAN_MSK_EXT_ID_ENABLE, DCAN_IF2_REG);

with the Enable instead is has no effect I still receive messages with the wrong ID. 

I have also tried:

DCANMsgObjectMskConfig(baseAdd, DCAN_IDENTIFIER_MSK(DCAN_ID_MASK,
DCAN_ID_MSK_11_BIT), DCAN_MSK_MSGDIR_ENABLE,
DCAN_MSK_EXT_ID_DISABLE, DCAN_IF2_REG);

using DCAN_MSK_EXT_ID_DISABLE instead of ENABLE.

Any suggestions of what I can do here.  I am using the dcanTxRx code and monitoring the interrupt routine void DCANIsr0(void)() for receipt of the packet.

Thanks,

--jim schimpf