Hi,
I am trying to implement CAN Message Filtering but the node is not filtering its accepting all ID's.This is the code What will be the issue?
I am using PIC18F25K80 and PIC C18 Compiler.
RXM0SIDH = 0xFE;
RXM0SIDL = 0x00;
RXM0EIDH = 0x00;
RXM0EIDL = 0x00;
RXF0SIDH = 0xFC;
RXF0SIDL = 0x00;
RXF0EIDH = 0x00;
RXF0EIDL = 0x00;
RXB0CON = 0x00;
Is anything More to add
You have defined only one message filter and there are 6 of them in Mode 0 (assuming you use Mode 0). By default, filters and masks are setup so that they allow all messages through. In your case, RXF0+RXM0 will block certain messages but other filters (RXF1-RXF5) will allow them so in the end you still receive all messages. You need to configure all filters to the same value if you want to filter specific messages (also also set both masks to the same value).
If you are using Mode 1 or Mode 2, there is a set of special registers available (RXFCONn) where you can enable/disable each filter as required.
Thanks arcom that really helped.Can you explain how filter and mask works and also how to configure RXFCONn
How can a i set a filter so that it must support ID's 0x7EX ie from from 0x7E0 to 0x7EF?
For extended ID set the values as per picture. If your ID is standard change all filters to standard as well.