You are on page 1of 96

CAN

2008-7-5

www.hirain.com

Confidential

CAN
CAN

CAN

http://www.hirain.com

CAN

CANController Area Network20


80Bosch

http://www.hirain.com

http://www.hirain.com

CAN

Body Control
Powertrain Control

Engine
Control

Door
Control

Transmission

Seat
Control

Power
Locks

Control
Dash

board
ABS/ASR

Active

Suspension

http://www.hirain.com

Air
Condition

Airbag
Light
Control

CAN

CAN
Body Control
Powertrain Control

Engine
Control

Door
Control

Transmission

Seat
Control

Power
Locks

Control
Dash

CAN

CAN

board
ABS/ASR

Active

Suspension

http://www.hirain.com

Air
Condition

Light
Control

Airbag

CAN

1983Bosch
1986BoschSAECAN
1987IntelPhilipsCAN

1991BoschCAN 2.0
CAN2.0AB
1991CANBenz S

http://www.hirain.com

CAN

1993ISOCAN ISO-11898
1994SAECANJ1939
2003Maybach76ECU
CANLINMOST
2003VW35ECUGolf

CANFlexRay
CAN

http://www.hirain.com

CAN

http://www.hirain.com

CAN

ID

CAN

CAN

CAN

CAN
ID
CAN

http://www.hirain.com

Data

CAN

10

CAN

CAN
CRC

http://www.hirain.com

11

CAN

1Mbps<=40
NRZ
/kbps

1000
NRZ

500
200
100
50
20
10
5

/m
0 10

http://www.hirain.com

40

100

200

1000

10000

12

CAN

/CSMA/CA (Carrier Sense


Multiple Access/Collision Avoidance)

(CS)

(MA)

(CA)

http://www.hirain.com

13

CAN
CAN

CAN

http://www.hirain.com

14

CAN

/kbps

~10

10~125

125~1000

ABS

LIN
CAN
J1850
VAN
CAN
CAN
MOST

1000~

FlexRay
D2B
IEEE1394

http://www.hirain.com

15

CAN

from Renesas

http://www.hirain.com

16

CAN

CAN

CANOSI
zCAL, CANopen (CiA)
zDeviceNet (ODVA)
zSDS (Honeywell)
zNMEA-2000(NMEA)
zJ1939(SAE)

http://www.hirain.com

LLC, Logical Link Control

MAC, Medium Access Control

PLS, Physical Signaling Sublayer

PMA, Physical Medium Attachment

MDI, Medium Dependent Interface

17

CAN

CAN

CAN2.0

2.0A29ID
2.0B29ID
2.0B1129ID

http://www.hirain.com

18

CAN

CAN

ISO11898
OSI
2

CAN

ISO11898

CAN2.0

ISO11898-1

CAN

ISO11898-2
ISO11898-3

CAN

CAN

LLC
MAC
PLS

PMA
MDI

CAN

ISO 11898-12003

Road vehicles -- Controller area network (CAN) -- Part 1:


Data link layer and physical signalling

ISO 11898-22003

Road vehicles -- Controller area network (CAN) -- Part 2:


High-speed medium access unit

ISO 11898-32006

Road vehicles -- Controller area network (CAN) -- Part 3:


Low-speed, fault-tolerant, medium-dependent interface

ISO 11898-42004

Road vehicles -- Controller area network (CAN) -- Part 4:


Time-triggered communication

ISO 11898-5

Road vehicles -- Controller area network (CAN) -- Part 5:


High-speed medium access unit with low-power mode

http://www.hirain.com

Singlewire

19

CAN

CAN

82C250

CAN

TJA1054

CAN

http://www.hirain.com

20

CAN
CAN

CAN

CAN
CAN

CAN_H

3.5V
2.5V

CAN_L

1.5V

10

http://www.hirain.com

CAN

21

CAN

CAN
(V)

1 (recessive)

0 (dominant)

CAN_H
~ 3.5 V

~ 2.5 V

~ 1.5 V

CAN_L

CAN message

http://www.hirain.com

22

CAN
CAN

CAN

http://www.hirain.com

23

http://www.hirain.com

24

ID
ID

http://www.hirain.com

25

http://www.hirain.com

26

CAN
1CAN

ABCDID5
736
3
CAN node A

CAN node B

CAN node C

CAN node D

CAN bus

http://www.hirain.com

27

CAN
1CAN

CAN node A

CAN node B

CAN node C

CAN node D

CAN bus

http://www.hirain.com

28

CAN

NRZ

NRZ

NRZ
NRZ
NRZ

NRZ

http://www.hirain.com

29

CAN

NRZ

1 1 1 2 3 4 5 1 2 3 4 5 2 3 4 5 1

CAN

http://www.hirain.com

30

CAN

(Acceptance Filter)
CAN

CAN

CAN

10

CAN
ID
CAN

Data

0
I D
1 0
E N
0 1
T 1
I 0
F 1
I 0
E R
0 0

(Selector or
ID
Code)

0
S 1
E 0
L 1
E
X C
1 1
T
X O
1
X R
1
X 0 0 1
X

(Mask)

M
1 A
1 1
S K
0 1 0 0 0 1 1 0

CAN

ID

(ID)

1 =
0 =

http://www.hirain.com

32

CAN
CAN
CAN

CAN

http://www.hirain.com

33

CAN

http://www.hirain.com

34


CRC

Bus Idle

11

1 1 1

S
O
F

ID

R I
T D r DLC
R E

ACK

0-64

15

1 1 1

Data Field

CRC

D A D
E C E
L K L

EOF

I
T
M

Bus Idle

CRC

Bus Idle

11

1 1

18

S
O
F

ID

S I
R D
R E

Extended ID

SOF, Start of Frame

RTR, Remote
Transmission Request

R
r r
T
DLC
1 0
R

0-64

15

1 1 1

Data Field

CRC

D A D
E C E
L K L

EOF

I
T
M

ACK,
Acknowledgement

EOF, End of Frame

ITM, Intermission

IDE, Identifier Extension

DLC, Data Length Code

SRR, Substitute
Remote Request

http://www.hirain.com

Bus Idle

1 1 1

ACK

35

SOF

http://www.hirain.com

36

IDRTRIDESRR
ID

1129

http://www.hirain.com

37

IDRTRIDESRR
RTR

RTR=0
RTR=1

http://www.hirain.com

38

IDRTRIDESRR
IDE

IDE=011ID
IDE=129ID

http://www.hirain.com

39

IDRTRIDESRR
SRR

SRR=1

http://www.hirain.com

40

r0r1DLC
r0r10
DLC

DLC0-8DLC9-15

http://www.hirain.com

41

0-8
CAN

http://www.hirain.com

42

CRC

CRC

CRC

CRC

CRC

http://www.hirain.com

43

CRC

CRC
1
CRC

http://www.hirain.com

44

ACK

ACK

http://www.hirain.com

45

ACK

ACK
ACK
ACK

ACK

http://www.hirain.com

46

7
11
11

D
E
L

EOF

I
T
M

11

http://www.hirain.com

47

SOF

CRC

http://www.hirain.com

48

CAN
CAN

CAN

http://www.hirain.com

49

http://www.hirain.com

50

ACK

CRC

http://www.hirain.com

51

CRC

CRCCRC

CRCCRC

ACK

CRCACK

ACKACK

ACK

http://www.hirain.com

52

CRC

ACK

ACK
CRC
2000/500kbps
25%
1000

http://www.hirain.com

53

ACK

CRCACK

http://www.hirain.com

54

http://www.hirain.com

55

point t1

t1

1
2

http://www.hirain.com

56


2
t1

S
O
F

t2
S
O
F

()
()

http://www.hirain.com

ITM

57

S
O
F

http://www.hirain.com

58

CRC

CRC

http://www.hirain.com

59

http://www.hirain.com

60

ACK

http://www.hirain.com

61

RECTEC

http://www.hirain.com

62

CAN
CAN

CAN

http://www.hirain.com

63

CAN

http://www.hirain.com

64

CAN

CAN

http://www.hirain.com

65

CAN

http://www.hirain.com

66

CAN

http://www.hirain.com

67

CAN

I want to know
the oil temp

OK! No problem!

ID= oil temp

ID= oil temp


Date= 115C

oil temp
sensor
~~~~~
~~~~~
115C
115C

http://www.hirain.com

68

CAN

CAN

0-

I
T
M

Transmission
Suspension

Bus Idle

http://www.hirain.com

CAN

69

CAN

http://www.hirain.com

70

CAN

http://www.hirain.com

71

CAN
CAN

CAN

http://www.hirain.com

72

=1/
CAN

tQ

http://www.hirain.com

73

(Time Quantum)

BRP=BaudRatePrescaler

http://www.hirain.com

74

48-25
Time Quantum
CAN
13

http://www.hirain.com

75

Synchronization Segment

http://www.hirain.com

76

Propagation Segment

2
18

http://www.hirain.com

77

1Phase Buffer Segment1

18

http://www.hirain.com

78

2Phase Buffer Segment2

18

http://www.hirain.com

79

CAN

SOF
SOF

SOF

http://www.hirain.com

80

SOF

R
S
S

PTS

PES1

PES2

http://www.hirain.com

81

<SJW
12

>=SJW

1
=SJW

2=SJW

http://www.hirain.com

82

1SJW=4

Slower
Transmitter

Faster
Receiver

http://www.hirain.com

83

2SJW=4

Faster
Transmitter

Slower
Receiver

http://www.hirain.com

84

Synchronization

Jump Width

SJWPES1PES2
SJWPES1PES2

http://www.hirain.com

85

tdel=tel,1+tBus+tel,2=tel+tBus

tProp>=2(tEl+tBus)

tCAN_Controller,2+tCAN_Transceiver,2
tCAN_Controller,1+tCAN_Transceiver,1

http://www.hirain.com

86

T(Bit) = 1/Baudrate
T(tq) = T(Bit) / NBT
T(Prop_Seg)= 2*(DelayTransceiver+DelayBus)
Prop_Seg = T(Prop_Seg) / T(tq)
If (NBT-1-Prop_Seg) /2
Phase_Seg1 = Phase_Seg2 = (NBT-1Prop_Seg) / 2
else
Phase_Seg1 = (NBT-1-Prop_Seg)/2,
Phase_Seg2 = (Phase_Seg1)+1

http://www.hirain.com

87

SJW = min ( Phase_Seg1 , 4 )

Df <= SJW / (2*10*NBT)


Df <= (min(Phase_Seg1,Phase_Seg2))/
(2*(19*NBT-Phase_Seg2))

http://www.hirain.com

88

MCU
8MHz1Mbps20m
5ns/m
150ns@85C (From Freescale AN1798)

1) = 20X5= 100ns
tProp = 2X (100+150) =500ns
2) BRP = 1tQ = 125nsNBT = 8
3) PROP_SEG = 500/125=4
4) NBT - PROP_SEG - 1 = 3, PHASE_SEG1 =
1, PHASE_SEG2 = 2

http://www.hirain.com

89

MCU8MHz1Mbps
20m5ns/m
150ns@85C

5) RJW= min { 4, PHASE_SEG1 }=1


6) df <= 1/2(13X8-2)=0.00490
df <=1/20X8=0.00625

http://www.hirain.com

90

CAN
CAN

CAN

http://www.hirain.com

91

ISO11898-2

http://www.hirain.com

92

ISO11898-3_

4.7K>R>500
Rall>100

http://www.hirain.com

93

ISO11898-3_

http://www.hirain.com

94

CAN

http://www.hirain.com

95

CAN
CAN

CAN

http://www.hirain.com

96

CAN

http://www.hirain.com

97