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
0
votes
1 answer

Any PIC18F microcontroller with both CANTX, CANRX and USB D+/D-

I found some PIC18F microncontroller (e.g. PIC18F258) with built-in CAN module. They have own CANTX and CANRX pins, which can save a lot work (without connect to other device based on SPI). I also want to transmit the CAN message into computer by…
TJCLARK
  • 489
  • 1
  • 5
  • 19
0
votes
0 answers

Is it possible to test the CAN loopback mode without using oscilloscope?

I am working on the CAN on LPC1857 microcontroller. This is the first time I am working on the CAN driver. I am right now testing the loopback mode in CAN. I have successfully transmitted the message. This I know because of the values in the status…
0
votes
3 answers

what will happen if two nodes with same name claiming same address in j1939?

If two nodes with same name claiming same address in j1939 what will happen in this situation? will any one of node will claim address or error will occour ?
0
votes
0 answers

CAN implementation and DE9

Refering to below link. https://mbed.org/handbook/CAN 1) Can I use the same diagram on breadboard? I mean the Can bus part (connection A in pic) - where two wires are connected with two 120 ohm resistors? Does this bus need any external voltage…
Gaurav K
  • 2,864
  • 9
  • 39
  • 68
0
votes
0 answers

Error in sending configuration MSG to ARS308 Radar sensor through CANcaseXL

I'm working on a research that includes sending and reviving CAN msgs from ARS308 radar sensor through the CANcaseXL ,, I was able to write a VB.net code that can send this configuration msg using ID 0x200 ,, but out of sudden the radar just stop…
baraa
  • 33
  • 1
  • 1
  • 4
0
votes
1 answer

Missing master heartbeat does not cause node to react in a CANopen system

I have a strange finding about the heartbeat-protocol in CANopen. Maybe somebody else has seen something like this and maybe it is supposed to work like this... Anyway, here's what it's about: In CANopen there are two timeout-based life-guarding…
Henning
  • 21
  • 3
0
votes
0 answers

JSSC readBytes() - What is coming in and what do I do with it?

I am a student and as a project I'm developing some software to talk to a CAN that would read from that can through a serial over USB interface. I'm confused on what occurs when I receive these bytes. I'm receiving them in -127-128 format and then…
branmg
  • 1
0
votes
1 answer

Infineon XMC4400 CAN message object and LIST register

I am using Infineon XMC4400 Controller and I am converting Basic CAN functionality to Full CAN functionality. I am facing difficulty in understanding Message Object allocation with LIST register- As per my knowledge- XMC4400 supports 64 Message…
Rahul
  • 3
  • 1
0
votes
0 answers

Timer-Backgroundworker called from another backgroundworker-thread

I am currently much developing on CAN-technology in C#, and in relation to message receiption and message transmitting. So far, every message, I send, is correctly transmitted to the consumer, and every message the producer sends, will correctly be…
phonophunk
  • 67
  • 8
0
votes
1 answer

Converting Analog input to digital for CAN on the mbed LPC1768

I need help with a code to convert an AnalogIn input on the mbed LPC1768 to digital to be used by the CAN controller.The example syntax I'm using is if(can1.write(CANMessage(1337, &counter, 2))) { .......... } where "counter" is the data to be…
Sue
  • 1
  • 1
0
votes
0 answers

Canbus, one host does not receive

I have a small Canbus network containing three hosts: two Fujitsu MB90342-microcontrollers, which have been terminated, and one CAN-USB-converter to my laptop, with no termination. The three hosts are connected with a flatcable. The problem is that…
0
votes
1 answer

CAN busoff with CAN_High and CAN_Low shorted

It is known fact that short circuiting CAN_High and CAN_Low on a CAN bus leads to a bus off condition. With respect to the physical layer, how does this condition lead to bus off condition?
Jagdish
  • 45
  • 2
  • 4
0
votes
1 answer

PDO mapping and cyclic data transfer over CANopen with Anybus Compactcom

I recently switched my device from ModbusRTU to CANopen by changing out the Anybus Compactcom and making some minor firmware updates. The device now seems to be properly functioning as a CANopen node, but I am having a bit of trouble mapping the…
0
votes
0 answers

CAN message read error

I am using the Infineon XC2768X microcontroller. The problem is at the line with the if statement. 'uwspeed' is the speed of motor I am receiving from the external CAN Bus. When the code reaches this line, it doesn't turn on the LED P10_6 and P10_7.…
user3219952
  • 13
  • 1
  • 2
0
votes
1 answer

Understanding the CAN filters

I am unable to understand the CAN filter configuration for the stm32f4-discovery. CAN_FilterInitStructure.CAN_FilterNumber = 0; CAN_FilterInitStructure.CAN_FilterMode = CAN_FilterMode_IdMask; CAN_FilterInitStructure.CAN_FilterScale =…