Help - Can Bus Scheme

Hello!

I am studying and practicing the CAN protocol. Looking for information, I see many examples that use only two boards (one master and one slave)

image

but my question, which I cannot find on the internet, is how would the scheme be if I wanted to have 1 master and 2 slaves, using the CAN.

Could anyone help me with this information?

Thank you!

Sorry... they don't get into multiple nodes, either... Seeedstudios has an example of multiple notes...
Introduction to CAN-BUS and How to use it with Arduino - Latest Open Tech From Seeed

A 72 response on this forum does address multi-nodes.

You can have as many nodes as you like.

First and last nodes require a 120Ω terminating resistors. These are usually included on most modules.

Nodes not on the ends require the 120Ω resistors be removed.

Longer Network distances(see pic) require slower network speeds.

Node Distance(see pic) should be no more than 1'(0.3m)

There are no Master's or Slave's only nodes.


Pic from link above.

Hi @filipekerplunk,

our fellow member @Hutkikz has already shown the principle of wiring several CAN controller to a common bus

This page

https://circuitstate.com/tutorials/what-is-can-bus-how-to-use-can-interface-with-esp32-and-arduino/

gives great information about how CAN bus works in detail. It might be worth to understand the underlying concept of this bus!

CAN bus itself does not provide a master and slave concept.It is based on Message IDs which are sent with the data and used by the CAN Controllers to avoid bus collisions.

Regards
ec2021

Thank you all!

So, in a CAN network, for me to send data to just one of the nodes, can I only do it through the message ID? (For only that particular node, with a specific ID, to receive the data)

The design of CANBus is based on the principles

  • Each message ID is dedicated to only one node which is allowed to send it (except so-called remote frames, but that's a special use...)
  • Each node may (but must not) receive other nodes' messages.
  • The message ID is defining which message has a higher priority. If two controllers start transmission at the same time, the message with the higher priority "wins". The controller with the lower priority message detects that one of its ID bits is overwritten by another controller's message ID and stops transmission.

It was designed for automotive purposes where a message to the breaks may be more important than one to switch on the internal lights ...

Regards
ec2021

Same Issue :Connect three or more nodes on a CAN BUS:Can someone provide a pictorial and a schematic of such with code -using either Arduino , ESP 32 and sensors , etc
Studied the two node tutorials and will check the circuitstate.com tutorial. I'm a novice need something more fundamental- I worked on the FRC CAN/Max Spark , Daisy chain , Java on our FRCrobot ( but it is a canned set up-and tryng to reverse engineer it) and read TI literature -Just have desire to experiment/learn with a more fundamental set up Appreciate any help or guidance Thanks

Hi @aedford1551 ,

there is an introduction to CANBus with Arduino you might check

https://www.seeedstudio.com/blog/2019/11/27/introduction-to-can-bus-and-how-to-use-it-with-arduino/

and another comprehensive page is this

https://how2electronics.com/interfacing-mcp2515-can-bus-module-with-arduino/

You may just google for Arduino, ESP32, CANBus, multiple nodes, etc. and you will get links to further information.

Be aware that the CANBus usually has to be terminated by 120 Ohm resistors at both ends of the communication lines. Check the hardware you use if there are appropriate resistors integrated or not. (Older people may remember the times of coax Ethernet cabling where terminators (terminal resistors, not the one from the movie :wink: ) were required.

Thanks
Found another source. Youtube
Using STEM 32
STEM 32 CAM peripheral. By Controllers Tech. You can google five tutorials
We can close my post I'll work with this one
Thanks
Al

Good luck!

To close your thread you may mark one post as "solution" :slight_smile:

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