27
votes
Accepted
What's the maximum CAN bus frame (message) rate at 125 kbit/s?
Per Olin Lathrop's suggestion, I'll expand on bit-stuffing.
CAN uses NRZ coding, and is therefor not happy with long runs of ones or zeroes (It loses track of where the clock edges ought to be). It ...
22
votes
What is the limiting factor for a CAN bus to exceed 1Mbps bandwidth?
From Controller Area Network Physical Layer Requirements
CAN is an open collector technology – the protocol could not work otherwise. This means that the recessive state of a CAN transceiver is not ...
19
votes
Accepted
Microchip documentation does not label CAN buss pins on micro controller pinout diagram
The CAN pins do not have fixed pin assignments. Instead you are able to select which of the "Remappable Pins" you wish to use (RP0 through RP15).
If you refer to page 180 of the datasheet, ...
18
votes
Accepted
Enable interrupt but no ISR
If there is no ISR defined, the location for the jump instruction in the interrupt vector will either be null, it may be a jump to an exception routine, it may jump to the beginning of the program, or ...
17
votes
Accepted
CAN bus signal integrity
No. The differential signalling is performing as intended.
No. As long as the "common mode voltage" does not exceed the ratings of the transceiver. And the maximum DC ratings, which for a CAN ...
16
votes
Accepted
Significant differences between CAN and RS485 regarding the physical layer
When comparing the physical layer only, CAN and RS-485 are similar in that they both use differential signaling. This gives them both good common mode noise immunity.
The main difference is that RS-...
16
votes
Accepted
How to deal with signed int overflows
Clearing up some misunderstandings will probably help.
First, your data is a 16-bit value. There's no "overflows" and "actual data" -- the 16 bits are just divided into two 8-bit pieces (bytes). To ...
15
votes
Accepted
CAN Bus Licensing
It's included in the cost of the parts.
It's a lot easier to collect money from a few IC makers than from every person who makes a product using those parts.
15
votes
Accepted
Which STM32 is best for logging a CAN network?
The shortest CAN frame is 55 bit times, so in the very worst case situation with a completely saturated bus consisting of one data byte frames (which is not really realistic for a CAN bus with any ...
14
votes
Accepted
Is the CAN bus protocol a master and slave protocol?
A CAN bus is multi-master and automatically arbitration free. The whole point is that you don't need a single master or main controller to take care of everything. Each message that is sent has a ...
13
votes
Accepted
What exactly is "dominant" and "recessive"?
Dominant is 0. Recessive is 1. Dominant applies to 0 because if two arbitration ID's are being transmitted at the same time and the first 4 bits are the same and the fifth is 0 for one of them and 1 ...
13
votes
Accepted
Twisted pair impedance
Do some time domain reflectometry, a useful video to this process is probably one from w2aew. He shows it with a coax, but it should work with anything that has a somewhat consistent impedance.
In ...
12
votes
CAN Bus Licensing
If you are using a third-party CAN controller chip, then they will have paid the licensing fee. The original patents related to the way the controller worked, so the vendor requires a license in order ...
12
votes
Does it matter which 2 nodes on a CAN bus you terminate?
Each beginning has its end. This can't be answered, because the question is not correct. What you have is the transmission line - a twisted pair that has two ends, and that's the place where the ...
11
votes
What exactly is "dominant" and "recessive"?
In addition to the perfectly accurate answer given elsewhere, it may also be useful to consider the lower level meanings of the phrases dominant and recessive. In both CAN and LIN at the physical ...
11
votes
Accepted
CAN bus test via loopback - possible or not?
All CAN hardware error checks are performed by hardware - the CAN controllers.
A CAN node cannot ack itself, by design. It will not receive its own messages. CAN is meant to have at least two nodes ...
11
votes
Accepted
CAN bus layout design
You are getting confused about the impedance. The type of CAN you are apparently using is implemented as twisted pair with roughly 120 Ω impedance. That is why there is a 120 Ω resistor ...
11
votes
Does it matter which 2 nodes on a CAN bus you terminate?
It doesn't matter which nodes are at the ends, but it does matter that the terminators are at each end.
The bus is a transmission line. To keep edges from reflecting at the ends of the cable, the ...
11
votes
Accepted
The CAN bus in this vehicle has only one 120 ohm termination resistance. What problems would this provoke?
From a professional point of view, this is a critical problem. Missing termination will cause energy bouncing back at the end which isn't terminated. This could lead to strange random noise on the ...
10
votes
What is the color code for CAN Bus?
CAN does not have a formalized physical-layer specification for conductor colors, or things like connector type or pin-out. There are common practices (like using a 9-pin D-sub connector) but no ...
10
votes
Accepted
Why common-mode choke on differential-signal serial lines?
Wouldn't the common-mode noise simply be cancelled in the receiver?
A lot of noise would be heavily cancelled in a differential receiver but, high frequency stuff can cause problems and, of course a ...
9
votes
Accepted
Using CAN bus tranceivers with custom data link layer
Many small and cheap microcontroller have CAN built in. Look at some of the PIC 18 with "8" in their part number. You only need to add the physical CAN transceiver, like a MCP2551.
If you just want ...
8
votes
Why does the CAN bus use a 120 ohm resistor as the terminating resistor and not any other value?
CAN Bus is a differential bus. Each differential pair of wire is a transmission line.Basically, the terminating resistor should match with the Characteristic Impedance of the transmission line to ...
8
votes
Accepted
Best method to transfer two int percentage values over a CAN bus
You don't need int to store those values - a simple int8_t will do. int8_t can store from -128 to +127.
Then just place int8_t A in data[0], int8_t B in data[1] (cast them to uint8_t) and set the ...
8
votes
Accepted
How and why is impedence matching done for a CAN bus?
The "terminators" of a CAN bus serve two purposes:
They terminate the transmission line. The type of CAN you are referring to is intended to be implemented as a twisted pair. 120 Ω is roughly ...
8
votes
CAN bus - Priority/collision
First let's clarify something. CAN bus addressing works on message IDs. CAN bus itself doesn't have node IDs. (One could create a scheme for where some kind of node ID is a part of the message ID, ...
8
votes
Accepted
CAN bus - Priority/collision
Funny that with so many correct answers, I still feel like something is amiss or not clear enough. Even most complete answer by @Nick does not correct some wrong assumptions in the question. So, I'll ...
7
votes
How can I determine a maximum run length for CANbus?
I mainly depends on your required bit rate. CAN works by the transmitter node checking that its bits are correctly on the bus. There are two reasons in the protocol that this intentionally doesn't ...
7
votes
Accepted
Multiplexing a CAN bus
In principle you should be able to multiplex MCU CAN signal lines, prior to their being used to interface to a CAN physical layer transceiver, using something like a 74HC4052.
In practice, I'd ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
can × 672stm32 × 75
microcontroller × 74
bus × 57
communication × 40
automotive × 38
termination × 34
rs485 × 32
canopen × 30
arduino × 28
transceiver × 26
obd × 26
embedded × 25
pic × 22
protocol × 20
c × 19
i2c × 17
spi × 17
microchip × 17
raspberry-pi × 13
baudrate × 12
connector × 10
uart × 10
differential × 10
interrupts × 10