Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Assigning ID to CAN messages

Kittu20

Member level 2
Joined
Oct 18, 2022
Messages
52
Helped
1
Reputation
2
Reaction score
0
Trophy points
6
Activity points
427
Hello, I've been researching on Wikipedia for CAN protocol and going through specifications CAN, but I'm struggling to understand how tAssigning IDs to messageso obtain the CAN ID for a node. Assigning IDs to messages is important in a CAN network.

Consider a scenario with two nodes: one node sending a message to control an LED connected to the other node. For clarity, let's call the PIC18F45K80 the CAN microcontroller and the MCP2515 the transceiver IC.

My question is whether we can assign any number 11 bit long or 29 bits long to the CAN ID or CAN ID is specific to a device, similar to how an I2C slave device has an address provided by the vendor in its datasheet?
 
My question is whether we can assign any number 11 bit long or 29 bits long to the CAN ID or CAN ID is specific to a device.
The CAN ID is not specific to any device you can assign any 11 bit or 29 bit identifier.

1700561313617.png


0x100, 0x101, 0x102 message ids can be used to send different information on CAN bus
0x200,0x201,0x202 message ids can be used to send different information on CAN bus.

It is also possible to assign
0x100 - 0x0102 to Node 2 and 0x200 - 0x202 to Node1. All this done through programming and in general there will be dbc file to describe what message ids are assigned to which nodes and what information they will send or receive.
 
Hi,

it is a "message ID" and not an "address ID".

The message ID (CAN) is to tell what data in the message is included. For example: The ID tells: the message includes climate date like temperature and humidity
The address ID on the opposite is meant to address a specific sensor/device. For example: this message is delivered to the motor control unit

So the CAN idea is that every node can decide which message to process or not. So the climate sensor sends out it´s data on to the bus and every node that is interested in will accept the message and process it. There is no need for the climate sensor to know which node needs the data.
Each node can set up a bunch of messages to be interested in. (Where address usually is a unique identifier on the bus)

****

What does this mean for you?

The big question is:
* Is your system a part of an existing system? In this case you need to get the description of the manufacturer of the existing system.
* Or do you build your own CAN bus system? You are free to do what ever you want. You may even "mistreat" the message ID as address ID.

Klaus
 
Imagine we have three nodes: Node 1, Node 2, and Node 3. We've assigned the CAN ID 0x100 to Node 2 and 0x101 to Node 3. we have two CAN messages. If Node 1 sends a message with the CAN ID of Node 3, both Node 2 and Node 3 will receive it.

My question , How physically Node 3 will know the message is for him not for Node 2 ?
 
Last edited:

    FvM

    Points: 2
    Helpful Answer Positive Rating
Hi,

It seems you did not read my post ...

And you did not even answer my "The big question"...

So I don´t know how to answer your new question....


Klaus
 
Imagine we have three nodes: Node 1, Node 2, and Node 3. We've assigned the CAN ID 0x100 to Node 2 and 0x101 to Node 3. we have two CAN messages. If Node 1 sends a message with the CAN ID of Node 3, both Node 2 and Node 3 will receive it.

My question , How physically Node 3 will know the message is for him not for Node 2 ?
According to you can id and Message id are same or different?
 
Hi,

What does this mean for you?

The big question is:
* Is your system a part of an existing system? In this case you need to get the description of the manufacturer of the existing system.
* Or do you build your own CAN bus system? You are free to do what ever you want. You may even "mistreat" the message ID as address ID.

Klaus

Now imagine we have CAN network with a one PIC8F45K80 CAN microcontroller , two MCP2515 Transceiver ICs, and two LEDs (Red and Green), let's assign CAN IDs to control these LEDs. I am assuming 0x100 for the red LED on Node 1 and 0x101 for the green LED on Node 2

We are building CAN network in case

We mention CAN ID in message so ID is one part of message. In message there may be many field like control field, data field, CRC Field ..
 

LaTeX Commands Quick-Menu:

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top