Electronic – CAN bus possibilities

canmicrocontrollersensor-node

Is it possible to add something, such as a microcontroller, to act as a new node that will integrate into the CAN bus system and be dominant over other nodes or at least speak on the bus to work what you're trying to work other than reverse engineer the whole CAN bus?

Best Answer

Yes, of course you can use a microcontroller as a node. I had used the CAN bus recently connected to three other microcontrollers (nodes). The biggest advantage of using CAN is that the CAN controller hardware present takes care of data collision and timing and so on which makes programming a CAN oriented system much easier.

If you had to work a bus topology using UART then it would have been much more difficult, but CAN is very convenient. And there is no dominant node on the bus; all nodes in CAN listen to whatever each node is sending, but by setting the acceptance filter value you can filter the contents. Every message has an ID and using the ID we get to know what the content of the data is about. A good basic framework of CAN is provided in the following link which you could check out. https://www.kvaser.com/about-can/the-can-protocol/

And the priority of the message being sent in the node depends on the identifier value of the message. A smaller identifier corresponds to a higher priority and there are also priority configuration where a particular node can send a message as soon as the current transaction is completed. Since all nodes listen to what you are sending the node that you want to act like a master could be close to a master.