Skip to content
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

Incorrect mask definition for RTR bit #62

Closed
sfyang opened this issue May 15, 2018 · 1 comment
Closed

Incorrect mask definition for RTR bit #62

sfyang opened this issue May 15, 2018 · 1 comment

Comments

@sfyang
Copy link

sfyang commented May 15, 2018

In the header file "mcp_can_dfs.h", there is a bit mask for the RTR bit defined around line 69 as:

#define MCP_RTR_MASK        0x40                                        // (1<<6) Bit 6

which indicates that the RTR bit is at the 6th bit (bit 5) of the 8bit register address.

However, according to the table "RIGESTER 4-5" on page 30 of the datasheet of MCP2515, the RTR bit is, in fact, at 5th bit (bit 4) of the RXBnIDL register, which means that the correct bit mask for RTR bit should be as following:

#define MCP_RTR_MASK        0x10                                        // (1<<5) Bit 4

The incorrect bit mask could lead to misjudging of a data frame as remote frame if checking the bit with the incorrect mask.

@Pillar1989
Copy link
Member

If you feel you need to continue the discussion, you can reopen the issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants