Documentos de Académico
Documentos de Profesional
Documentos de Cultura
bob.boys@arm.com V 4.0
drops
The important
voltage is the
difference between
CAN Hi and Lo
and not to ground.
Recessive and Dominant Bits
Any node can pull Hi and Lo apart on the bus.
No node can force Recessive.
This is how arbitration works.
A bus can sit idle for a hundred years and every
node will see the first message sent.
Whether your processor sees it depends if you
configured the CAN controller correctly.
If do nothing: nothing happens.
The clocks in CAN need to be good ones.
Differential Signals
Algebraically Subtracted:
17
Differential Twisted Pair
18
Differential Pair
Subtraction: Noise cancels out. a-b = 0
Good signals add: x-(-y) = x+y
19
Differential Pair far apart
20
Differential Pair close
21
22
Another one
23
Bit Stuffing
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Desired Data
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Actual
Data Stream
Stuff Bits
25
Differential CAN
signal
Rain sensor
output
SPI signals in
ECU
CAN decode
120 ohm
resistor
removed
J1939
Orion Bus
27
2nd Generation Truck J1939 CAN
1st Generation Truck J1939 CAN
ISO 11898
ISO 11898 = CAN go deeper now.
4 parts to this.
In addition to the Bosch specification.
Part 1: Data Link + part of Physical Layer.
Part 2: Hi Speed Physical Layer
Part 3: Fault Tolerant CAN
Part 4: Time Triggered CAN
30
Data Link: the frame.
IFS
Field Field Data Field CRC Field Field Frame
11-bit DLC
ACK
DEL
DEL
Identifier (4) 0-8 Bytes 15-bit CRC 7 3
18-bit
DEL
11-bit DLC
ACK
DEL
SRR
IFS
Control ACK End of
Arbitration Field Field Data Field CRC Field Field Frame
* IDE 1 bit
IDE = 0
Is the frame 11 or 29 bits long ?
11 bit ID
IDE = 1 29 bit ID
* DLC 4 bit How many data bytes are there ? DLC = 0 thru 8
sample point
Sync- Propagation Phase Phase
segmentTime Segment Buffer Buffer
Segment 1 Segment 2
37
Timings for this example:
Assume 500 Kbps CAN network.
Bit time = 1/(500 x 103) = 2 usec.
With 8 tqs, tq time is 2 usec/8 = 250 nsec.
Sample point is 250 nsec(5) = 1,250 nsec.
1 bit
time
1 time quantum (tq)
transmit point
sample point
Sync- Propagation Phase Phase
segmentTime Segment Buffer Buffer
Segment 1 Segment 2
38
Acknowledge: Newbie mistake # 1.
Data Frame
ACK
RTR
DLC
11-bit Identifier (4) 0-8 Bytes 15-bit CRC 7 3
ACK
RTR
DLC
11-bit Identifier 0-8 Bytes 15-bit CRC
(4) 7 3
42
Bit-wise Arbitration
43
Both are dominant (0)
44
Both are recessive
45
Both are recessive
46
Node 2 WINS !
47
Arbitration Notes:
48
What can you put into the ID ?
53
BUT !
Not always true:
Some transceivers might
not be in spec.
CAN LO short
No ground OK
CAN LO open ?
No ground OK
54
ISO 11898 Part 3
Fault Tolerant CAN up to 125 kpbs
Built to withstand severe line failures:
CAN_H or CAN_L open circuit different places.
CAN_H or CAN_L shorted to battery or ground
CAN_L shorted to CAN_H
CAN_H and CAN_L interrupted at the same location (is a
bad situation)
Loss of termination
Needs Vbatt and Gnd to detect these errors.
55
FT CAN Voltage Levels
5V
CAN_H
3.6V
2.2V 5V
1.4V
CAN_L
56
Error Frames
Up by 8, down by 1
Can read as an 127
indication of bus health. 96
Busoff return: RESET
or 128 good messages Reset
:its what you decide. TEC REC
Note: 96 is considered a significant error level
>Error notes:
59
CAN Filters
Allow only selected messages through to CPU.
On ID and sometimes 1st byte of data.
This is why IDs are carefully chosen.
Typical microcontroller
Filters
Tips & Hints
nodes: never send the same message same time.
Get a bus error or both think successful.
Use same # data bytes all the time.
Software is much simpler to debug and
maintain.but you dont have to
Never change the bus speed !
Beware of short bursts of high bus traffic.
Read TEC & REC to view state of your bus
If use a protocol implement all of it !
Throw data on the floor but take care of it.
more Tips & Hints
67
Developing the diagnostic system:
68
Deutsch Connectors
J1939 Heavy Duty Truck & Bus
69
CAN Statistics
Periodic Auto bus rates about 6 7 %
GM periodic about 15 % @ 500 Kbps.
Simulation done to test networks.
Hardware-in-the-Loop also.
What priority a message has is important.
These are not determined randomly but with
great thought and planning.
70
Other Useful Protocols: