Questions tagged [can-bus]

Controller Area Network (CAN) bus is a networking technology typically used in cars and other vehicles. It supports deterministic priority arbitration with multiple transmitting nodes.

The CAN bus is a serial bus that allows multiple masters and uses a broadcast model. A message start with an ID, can contain up to eight data bytes (64 data bytes for CAN FD) and uses non-return-to-zero encoding. Each node can receive, but only one can send at each point in time. It uses CSMA/CA algorithm for bus access. The lower the (numerical) ID, the higher the priority. Short networks (below 40 m) can achieve bit rates up to 1 Mbit/s.

A distinguishing feature of CAN is that when two nodes with different message identifiers attempt to transmit at the same time, there are no collisions (CSMA/CA). The higher priority message will go through without any need for the sender to re-transmit it. This ensures that a CAN system can never get into a live lock state in which two nodes would continually re-send the same two messages, and continually collide with each other.

A newer version/generation called CAN FD was recently developed. It supports higher clocking of the data portion of the message, allowing up to 64 bytes of payload.

Tag usage:

  • Use this tag for all questions related to CAN or CAN FD software/firmware: drivers, controllers, communication, frames etc. Please note that hardware questions are off-topic and should be asked at https://electronics.stackexchange.com instead.
  • It is recommended to combine the tag with , to draw more attention to the question from the right kind of people.
  • If you are using a particular programming language (say, ), you should add that tag as well.
  • If the question is about higher layer protocols such as CANopen, J1939 or DeviceNet, the tag should be combined with the applicable higher layer protocol tag.

Links:

1162 questions
-3
votes
1 answer

Need tutorial on CAN protocol

I have been assigned a project in my lab to implement CAN protocol on ARM 7. I looked for some tutorials and sample code, but all looks so much complex that I think I should get some help on the coding part. Can anybody explain me the basic…
mrigendra
  • 1,472
  • 3
  • 19
  • 33
-5
votes
1 answer

Casting a CAN Message to regular values

I'm getting a CAN message 8 bytes length and that's it format I'm getting Lat and Long as a9 00 ff 0f 32 ff cf 7f Hope I get a C code that interprets the value. The expected values, 53.3, 10.0
andreahmed
  • 29
  • 5
-5
votes
1 answer

source code to transmit data using CAN protocol using C++

I'm using a QT creator application. In my application I need to transmit and receive data's using CAN protocol using C++ source code. I searched a lot on Google also, but I was not able to find the source code for this.
sivanesan1
  • 779
  • 4
  • 20
  • 44
1 2 3
77
78