Questions tagged [can]

CAN stands for Controller Area Network and is a bus often used in automotive applications. It is a two-wire differential protocol and works on baud rates from 10 kbits/sec to 1 Mbits/sec.

The CAN bus is a serial bus. It allows multiple masters and uses a broadcast model. A message start with an ID, can contain up to eight data bytes 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.

Links:

817 questions
53
votes
5 answers

Is a CAN enabled microcontroller sufficient to drive a CAN bus?

There are a number of CAN modules built into microcontrollers these days. The PIC18F2480 is an example of that. Is that microcontroller (with built-in CAN) capable of driving a CAN bus on its own or is an external CAN transceiver/controller…
efox29
  • 11,955
  • 10
  • 57
  • 104
14
votes
3 answers

Transmission of different messages with the SAME ID on a CAN bus

CAN arbitration is done with IDs, and any node on the bus can transmit with any ID (ideally it should not, but a nasty node can). What if two different nodes connected on the same CAN bus transmit messages with the same IDs but different data…
Swanand
  • 3,275
  • 5
  • 30
  • 46
9
votes
6 answers

How to check the CAN bus is free or not

I read a lot of stuff regarding CAN bus arbitration, but it didn't answer my questions. If one node is already transmitting the data on the bus and in between another node wants to initiate the data transfer, how will that "another node" get to know…
Swanand
  • 3,275
  • 5
  • 30
  • 46
9
votes
3 answers

What is the limiting factor for a CAN bus to exceed 1Mbps bandwidth?

Why can't CAN baud rate increase beyond 1Mbps
8
votes
3 answers

For the CAN bus, is it OK to swap CANH and CANL lines?

Similar to question In a USB cable, is it OK to swap the D+ and D- wires?, is it okay if we interconnect CAN-H and CAN-L lines? CAN is a differential protocol. Is it that dominant and recessive bits are nothing but voltage differences on these…
Swanand
  • 3,275
  • 5
  • 30
  • 46
8
votes
3 answers

Most efficient way to handle addressing / termination in a daisy-chained CAN bus?

I'm working on some devices that will talk to each other over CAN. The simple idea is to daisy chain essential signals between each device: power (+12V and ground), enable and CAN high / low. Now, there main two problems I have with introducing…
Toby Lawrence
  • 3,128
  • 3
  • 27
  • 34
7
votes
1 answer

CAN bus troubleshooting. How?

I am trying to connect ICP CON i-7565 (USB <-> CAN interface) to a custom made device (supporting CAN 2.0B, proved to work with PCL-841 card). Although I think I have configured the Baud rate and acceptance code/mask correctly, I can't see any CAN…
lot
  • 171
  • 4
7
votes
1 answer

Sync Jump Width (SJW) in Controller Area Network

Is there any drawback to a longer SJW vs a shorter SJW? The PIC32MZ2048EFH064 has a minimum phase 2 requirement of two time-quanta. This means that the SJW could be one or two time-quanta. Why wouldn't an SJW of two not be used by…
vini_i
  • 7,108
  • 3
  • 33
  • 52
5
votes
4 answers

CAN bus - Priority/collision

I have a hard time understanding how a CAN bus can actually work. It looks to me like a scenario where everyone is talking at the same time. The CAN bus is simply two wires that everyone is connected to, CAN-H and CAN-L, right? If we have lets say…
BufferOverflow
  • 697
  • 2
  • 8
  • 15
5
votes
2 answers

CAN Baud rate configuration - STM32F207

I need to configure the CAN module of a STM32F207 to the following different baud rates: 500 kbit/s, 600 kbit/s, 700 kbit/s, and 1 Mbit/s. For 500 kbit/s and 1 Mbit/s I am able to get exact integer values for the following registers. Prescaler = 2…
Vivek V
  • 163
  • 1
  • 2
  • 4
5
votes
1 answer

Is this bit stuffing correct on CAN Bus?

I'm implementing a CAN Bus receiver in VHDL under 250 kbit/s, and a curious frame turned up. This is finishing the field of CRC, the last under the application of bit stuffing. And I have: ...011111000001 I don't know if that final 1-bit is the…
ferdepe
  • 565
  • 2
  • 5
  • 17
4
votes
2 answers

Issue with CAN communication

I'm new to CAN and currently having problem with a setup. The image shows how my devices are connected to each other. I'm using the canutils Linux package to send messages (Linux uses its network layer to register and operate the CAN interfaces).…
Thomas
  • 41
  • 3
4
votes
1 answer

CANBUS corruption due to stuff errors/excessive dominant bits

I've seen an issue on a 14-node, 250k CANBUS (with a mixture of 11-bit and 29-bit nodes) where CAN frames are often corrupted by some incorrect bus activity. The screenshot explains it more clearly. This generally happens around 10-15 seconds after…
4
votes
4 answers

Hardware solution to guarantee read-only access on a CAN bus

For cybersecurity reasons, I want to make sure a device connected to my CAN bus is read-only. What's the state-of-the-art way of doing this? My naive plan was to simply use two diodes.
gbt
  • 691
  • 6
  • 17
4
votes
1 answer

CAN bus split termination impedance - no 60 ohm resistors?

Typical CAN Bus termination involves a 120Ω resistor between CANH and CAHL. To go further than this, I've read that the 120Ω resistance can be split into two 60 ohm resistors with a capacitor in between to ground (Typically 4.7uF). This has the…
dos584
  • 369
  • 3
  • 14
1
2 3
9 10