-
Notifications
You must be signed in to change notification settings - Fork 376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filtering one discret ID #6
Comments
Set both masks to 0x7FF and all the filters to 0x20A (522 in hex). That should guarantee only 522 is the only ID received. num is the filter (0 to 5) or mask (0 to 1) to set. |
Thank you. It is working this way but there are some problems with error checking and filtering messages after reset. I use CAN.checkError() before every reading so that I know if there are some lost frames. The result after an error is permanently CAN_CTRLERROR (5) because datasheet says, eflg has to be reset manually. Maybe it will be a good idea to implement this in library (something like reset_error(void)). The other problem: My Shield is using in industrial application and I do not have influence if other nodes are sending and with which frequency. So when there is a node sending messages (with IDs which should be blocked) when MCP is initializing, filtering does not work because I only can call init_Mask and init_Filt after CAN.begin is called. Maybe it is better if there is a possibility to set filters and masks before CAN.begin.
The result: No message is filtered. All messages from all IDs arrive the buffer. If there is no other Node sending data when resetting MCP, the filtering is working find and only ID 522 comes into buffer. |
Hello,
I do not know how to recieve only messages with the ID 522 (dec). Can you help me, how to set filter and mask?
255 = 0xFF = 11111111 is it the mask? I do not know.....
522 = 1000001010 (maybe it is the filter? but which filter?)???
I know that I have to use
init_Mask(INT8U num, INT8U ext, INT32U ulData);
init_Filt(INT8U num, INT8U ext, INT32U ulData);
But what I have to set to num, ext and uIData??????
The text was updated successfully, but these errors were encountered: