Getting MCP2515 chip to work with Raspberry Pi Pico #16396
Unanswered
Gallen1124
asked this question in
Core Development
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Everyone,
So I have hit a snag with my project. I am trying to use an MCP2515 to read can messages. Using the demo code from the waveshare website I have managed to get it to send messages no problem. However it is only able to read messages when running in unfiltered mode. This means that the buffer is always filled with messages that I am not interested in and therefore cant read the ones I am.
I have tried to read the documentation as best I can but I am not very familiar with this type of thing. Here is the link to the MCP2515 documentation.
https://www.sparkfun.com/datasheets/DevTools/Arduino/MCP2515.pdf
What I have tried so far is during the Init of the CAN controller, I try to set a mask and filter for the CAN IDs I want. I set up the CTRL to be 0x20 which should indicate to filter by SID. I print all the settings to know that they took by reading the chipset back. I really dont know what to do its incredibly frustrating. I am hoping someone might know how to operate one of these chips.
Another strange thing I noticed is that when I put RXB0CTRL into 0x20 mode, the function receive() is no longer able to change the SID in RXB0SIDL and RXB0SIDH. You can try it by changing the CAN_ID argument.
Here is a link to the modified waveshare code I am using. If you change the RXB0CTRL to 0x60 you will see it starts to print can messages again.
https://github.com/Gallen1124/roamingtxcontroller/blob/main/mcp2515control
Beta Was this translation helpful? Give feedback.
All reactions