Message filtering (hardware filter)
Posted: Fri 4. Mar 2011, 10:45
Hello,
First of all thanks for the help on my stuff error. After adding 120ohm resistors at both my self-made cable ends data transfer goes perfect.
I now have a question regarding adding masks for filtering. By default the filter is off and can I manually filter messages by making if statements (like the one in the example project for CAN flashing) that check for received id's. However, as I understood the CAN_AddFilter() function allows me to set a 11/29bit id check before it's read into the RxQueue. When I add a filter (both single id and ranges) the devices no longer registers any received data (atleast not by using the regular queue reading).
The getMsg function uses the GetNext/ReadNext sequence (tested with Read aswell, no difference).
Do filtered messages go somewhere else or should they be in this queue like they usually are?
First of all thanks for the help on my stuff error. After adding 120ohm resistors at both my self-made cable ends data transfer goes perfect.
I now have a question regarding adding masks for filtering. By default the filter is off and can I manually filter messages by making if statements (like the one in the example project for CAN flashing) that check for received id's. However, as I understood the CAN_AddFilter() function allows me to set a 11/29bit id check before it's read into the RxQueue. When I add a filter (both single id and ranges) the devices no longer registers any received data (atleast not by using the regular queue reading).
Code: Select all
#define USEHARDWAREFILTER = 1
....
#if USEHARDWAREFILTER == 1
CAN_FilterAdd(CanIf1, CanFilterAdd11Bit, 0x150, 0x0);
CAN_FilterOn();
#else
...
Do filtered messages go somewhere else or should they be in this queue like they usually are?