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

Adding RTR ID #47

Open
paulmac00 opened this issue Sep 21, 2020 · 5 comments
Open

Adding RTR ID #47

paulmac00 opened this issue Sep 21, 2020 · 5 comments

Comments

@paulmac00
Copy link

The library is working great, however I am struggling with adding an RTR tag to the CAN ID.

Is anyone able to provide a quick pointer? I've been searching the interwebs for the past 3 hours or so

Thank you!

@jxltom
Copy link
Collaborator

jxltom commented Sep 21, 2020

I have a demo here for different kind of message https://github.com/jxltom/micropython-mcp2515/blob/master/demo.py, though it is written in python

@paulmac00
Copy link
Author

Hey JX,

Thanks for the quick response! Any help is very much appreciated.

I found where you added the RTX tag:
rtr_frame = CANFrame(can_id=0x7FF | CAN_RTR_FLAG)

I'm working on an arduino so I've written:
frame.can_id = 0x4a | MCP2515::CAN_RTR_BITMASK;

I also look into MCP2515_Const.h where it is defined as
static uint32_t constexpr CAN_RTR_BITMASK = 0x40000000;

However it doesn't seem to be working properly. I'll play around with it tomorrow and see if I can make some more progress.

@jxltom
Copy link
Collaborator

jxltom commented Sep 21, 2020

Can you receive the standard frames? If so, please check the configuration of your RXB. You need to enable it to receive extended frames by RXBnCTRL_RXM_STDEXT or just disabled the filters/masks.

@paulmac00
Copy link
Author

paulmac00 commented Sep 22, 2020

Hey JX,

Can you receive the standard frames?
Yes, I can receive and send standard frames. I will look into the RXB config today.

I've taken a look at it and I think my problem is I can't work out how to add to the CAN_ID frame. Any tips for arudino?

@fkaraokur
Copy link

I'm having trouble here too. Can you explain what he said?

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

3 participants