I am trying to load n number of CAN messages(datatype tCAN) to the CAN transmission buffer, and send them at a go to the CAN bus. I am not able to figure out the required methods from the sparkfun datasheets and online forums. Can anyone please suggest how to do that or any document for the same ?
if you use the library manager to load the mcp_can library
you will get a number of example programs under File>Examples>mcp_can to send and receive data.
what host micro are you planning to use and which particular CAN module?
it is a good idea to get a USB-CAN dongle to plug into a PC as an aid to debugging CAN networks
How many is n?
The MCP2515 transmit buffer can only hold 3 messages.
Is this a student project?
Are you expected to control the operation of the MCP2515 by setting registers so it only sends messages when you send it a specific command?
Hi !
I am using sparkfun mcp2515 can bus shield.
The module has 3 transmit buffers. I want to know how to load 3 consecutive messages into the buffers so that I can send it at a go and there is no time delay between them.
Is there any specific code or command for that in arduino for sparkfun mcp2515 can bus shield ?
Hi!
I know the mcp2515 transmit buffer can hold 3 messages. Is there any specific code or command for that so that I can load the messages into the buffer (3 at a time) beforehand and send it. Out of n array of messages, when one gets sent a new message gets loaded into the buffer and so on.
Yes I want to control the buffer so that it gets loaded beforehand and it only sends messages when a specific command is called.
Thanks
I'm not aware of any libraries that give precise control over when messages get sent.
If you look at the datasheet there are 3 pins TX0RTS, TX1RTS, TX2RTS that are designed as triggers for sending individual messages, but on the Sparkfun shield they don't appear to be connected to anything. You will probably have the same problem with other shields and breakout boards. How are your soldering skills?
It looks like you will need to modify the TXRTSCTRL register to use these pins as triggers. Also look at the SPI 'Request to send' instruction. If none of this makes sense then you should talk to your supervisor to see if this is the kind of solution you are expected to implement.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.