Why can't I see the same CAN message I sent on the bus using the MCP2515

I have a very specific question about using the MCP_CAN.h library for the MCP2515 CAN IC by coryjfowler.

I have been very successful using this and I have a fully functional send and receive code and my colleague and I have created a HW/SW interface to generate incoming data sorted lists and an ability to simultaneously send CAN data.

The question is, when we send CAN data onto the bus, we would like to be able to actually "SEE" it / read it back from the same bus. So let's say I am connected to another module on a bus and I actively see CAN traffic but then I send a message out, I still only see the traffic sent on the bus by the module. Is there a way to do both MCP_Normal and MCP_loopback at the same time or something like that?

This shows the sending CAN messages tab:

This shows the incoming CAN messages tab. We want to be able to see the sent messages from our SW inside this tab as well.

@coryjfowler I have not spoken to you previously, however you seem to be the go-to CAN person around here so I thought I would try to draw your attention to this. :slight_smile: thank you so much!

Not to worry when transmitting CAN monitors its transmissions to validate they were sent properly and it is also used for arbitration. If the message is not received correctly by another node (you must have at least two nodes on the bus) it will give you an error. This is automatically done during transmission as the remote has to acknowledge the message while it is being sent. The transmitter always sends a recessive bit and the receiver places a dominate bit on the bus during the acknowledge bit time. Also while sending a message the transmitter monitors the bus and turns off if what it sends is not appearing on the bus. This works because of the dominance and recessive modes of the bus.

Thanks for the response. I am actually fully aware of that. It is more of a SW tool design that I am trying to accomplish. This way I can monitor a single tab of my SW to show all messages being received and sent. I want to make is so that in the 2nd screenshot, the column titled "Channel" can show "Sent" in place of "CH_A" for example. It is easy to just directly feed it from the sent messages by piping the data in, but I want to have that piece of mind that it is truly sent and then read on the bus.

It was validated as being sent however you can either add an additional can receiver on the system or have the target confirm the message got there with some sort of software acknowledge. You could even have it send back the complement then xor to make checking easy.

Your ideas are good and valuable input. I am not inclined to want to add a full second HW receiver but the other ideas are great. I appreciate it. :slight_smile:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.