This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

CAN peripheral Acceptance Flter in ON Mode

Hi,

I am working on CAN peripheral in LPC2368 controller.I am testing the CAN peripheral in Acceptance filter ON mode with 11-bit Standard Explicit identifier.

Tested Following conditions

EXP_STD_ID = 0x400;

CAN_MEM_BASE = 0xE0038000;

1. For Lower boundary

address =0;

CAN_SFF_SA = address;

i =1;

ID_low = (i << 29) | ((EXP_STD_ID) << 16);

ID_high = ((i+1) << 13) | ((EXP_STD_ID) << 0);

*((volatile DWORD *)(CAN_MEM_BASE + address)) = ID_low | ID_high;

address += 4;

2. For Upper boundary

address =0;

CAN_SFF_SA = address;

i =0;

ID_low = (i << 29) | ((EXP_STD_ID) << 16);

ID_high = ((i+1) << 13) | ((EXP_STD_ID) << 0);

*((volatile DWORD *)(CAN_MEM_BASE + address)) = ID_low | ID_high;

address += 4;

Above Two conditions are working fine,but when i try to include both lower and upper boundaries in CAN channel 2,it's not working

address =0;

CAN_SFF_SA = address;

i =1;

ID_low = (i << 29) | ((EXP_STD_ID) << 16);

ID_high = (i << 13) | ((EXP_STD_ID) << 0);

*((volatile DWORD *)(CAN_MEM_BASE + address)) = ID_low | ID_high;

address += 4;

Parents
  • I can see you set a value for CAN_SFF_SA.
    But where do you update the other indices?
    The explicit standard frame filter processing is all entries from CAN_SFF_SA and up to CAN_SFF_GRP_SA - and the processor does binary subdivision when processing the table so it needs the entries sorted and needs to know where the individual tables ends so it knows how many entries of each type that are stored in the filter RAM.

    Another thing - are you making sure the acceptance filter is off or in bypass mode when you try to write to the lookup table?

Reply
  • I can see you set a value for CAN_SFF_SA.
    But where do you update the other indices?
    The explicit standard frame filter processing is all entries from CAN_SFF_SA and up to CAN_SFF_GRP_SA - and the processor does binary subdivision when processing the table so it needs the entries sorted and needs to know where the individual tables ends so it knows how many entries of each type that are stored in the filter RAM.

    Another thing - are you making sure the acceptance filter is off or in bypass mode when you try to write to the lookup table?

Children
  • Hi Per Westermark,

    Thanks for your response,

    Actually my routine is like this

    GRP_STD_ID = 0x300

    EXP_STD_ID = 0x400;

    EXP_EXT_ID = 0x100000

    CAN_MEM_BASE = 0xE0038000;

    address =0;

    CAN_SFF_SA = address;

    i =1;

    ID_low = (i << 29) | ((EXP_STD_ID) << 16);

    ID_high = (i << 13) | ((EXP_STD_ID) << 0);

    *((volatile DWORD *)(CAN_MEM_BASE + address)) = ID_low | ID_high;

    address += 4;

    CAN_SFF_GRP_SA = address;

    ID_low = (i << 29) | (GRP_STD_ID << 16);

    ID_high = ((i+1) << 13) | (GRP_STD_ID << 0);

    *((volatile DWORD *)(CAN_MEM_BASE + address)) = ID_low | ID_high;

    address += 4;

    CAN_EFF_SA = address;

    ID_low = (i << 29) | (EXP_EXT_ID << 0);

    *((volatile DWORD *)(CAN_MEM_BASE + address)) = ID_low;

    address += 4;

    CAN_EOT = address;

    While writing the Look uptable RAM memory Acceptance filter is in OFF mode