0% found this document useful (0 votes)
106 views35 pages

CAN Protocol

CAN BUS

Uploaded by

najjaymourad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
106 views35 pages

CAN Protocol

CAN BUS

Uploaded by

najjaymourad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

Sb.

ilou WIN05

Controller Area Network


Sb.ilou WIN05

Table des matières


1. CAN SPEED ....................................................................................................................................... 3
2. Data limité ....................................................................................................................................... 3
3. CAN Bus ........................................................................................................................................... 4
4. CAN Network Topology.................................................................................................................... 5
5. CAN priorities .................................................................................................................................. 5
6. Message filtering ............................................................................................................................. 7
7. Acknowledgement method ............................................................................................................. 8
8. CSMA-CA Protocol ........................................................................................................................... 8
9. Type of Frames ................................................................................................................................ 8
1.2 Data frame ............................................................................................................................... 9
2.2 REMOTE frame ........................................................................................................................ 9
3.2 Error Frame............................................................................................................................ 10
4.2 Overload Frame ..................................................................................................................... 11
10. Can STANDART data frame format ............................................................................................ 11
11. EXTENDED FRAME FORMAT ...................................................................................................... 14
12. Priority ....................................................................................................................................... 16
5.2 Mechanism de detection d erreur ......................................................................................... 16
13. Bit seg segmentation ................................................................................................................. 17
14. BIT Arbitration ........................................................................................................................... 21
15. BIT stuffling ................................................................................................................................ 22
16. CRC in CAN ................................................................................................................................. 25
17. CAN errors ................................................................................................................................. 27
18. Reaction to CAN errors .............................................................................................................. 27
19. Can errors .................................................................................................................................. 28
20. Bit errors .................................................................................................................................... 29
6.2 Bit errors exceptions .............................................................................................................. 29
21. Ack error .................................................................................................................................... 30
7.2 Stuff errors ............................................................................................................................. 32
22. Form errors ................................................................................................................................ 32
23. Conclusions’ ............................................................................................................................... 33
24. ERRORS Frame format ............................................................................................................... 33
25. Basic error frame ....................................................................................................................... 34
26. CAN FD ....................................................................................................................................... 35
Sb.ilou WIN05

CAN Protocol

1. CAN SPEED

2. Data limité
Sb.ilou WIN05

3. CAN Bus

Notes : the two twisted buses always end with resistor=120 OHM

1- Delta V is the difference between the CAN_H and CAN_L


2- Logic0 is dominate because it has the priority
3- CAN is not sensibale to the noises because:

Supposed the we have a voltage noise Vn: so CAN_H=VH+Vn and CAN_L=VL+Vn

Which means that the difference between them nothing but Delt_V

4- The 120 ohm is to optimize the signal reflection.


5- The ECU work with TTL(0-5V) Logic and not the Can Logic that why we will use the can
transceiver
Sb.ilou WIN05

6- The CAN transceiver(physiq la,yer) convert from the CAN logic to th TTL logic, and the Can
controller(Hardwarem, Network layer) form the Can Frame but in the TTL bit

4. CAN Network Topology

1- It’s a bus topology


2- The CAN busses and the ECUS forme a CAN Network
3- If the speed of the CAN busses is equal to X Kbps all the ECUS must configure on the same
value which is x Kbps

5. CAN priorities

1- CAN is Wire Protocol


Sb.ilou WIN05

2- CAN is serial communication


3- CAN is a Asynchrone communication protocol, the difference between the Synch and the
Asyn : the first one if the node(ECU) has the data ready it cannot send it till it has the
permission it could be in a Front Descendent or Front Montant, The Asynchron the node can
send the data at any time it wants.
4- CAN is a Multicast protocol, Broadcast

5- CAN is a message based protocol, because in the frame we don’t know who is the receiver.
6- Each msg has something called msg ID and the msg ID has three porpuses :
- What kind of data carried or what is about
- The priority
- Filtring: if the id msg=X I wont let it pass
Sb.ilou WIN05

6. Message filtering

7- CAN is a Half-duplix,
Sb.ilou WIN05

7. Acknowledgement method

- In the can frame we have the data and also the bit pf acknowledgement.

8. CSMA-CA Protocol
Carrier Sense Multiple Access Collision Avoidance Protocol

CAN is a CSMA-CA protocol

9. Type of Frames
They are 4 types of can Protocol,
Sb.ilou WIN05

- Data Frame
- Remote Frame
- Error Frame
- Overload Frame

1.2 Data frame

Frame carrying the data from the transmitter, noede tp all recieiver nodes. And ther is two types of
data frame:

- Standards frame:11BIT msg Id


- Extended Frame:29 BIT MSG ID

2.2 REMOTE frame


This frame requesting data frame,

IF a node wants a specific dataFrame, so it sends the Remote frame with same msg ID on the BUS
Sb.ilou WIN05

It s approximately just like data frame but only the data frame is missing

3.2 Error Frame


This frame signals an error condition in the data frame being transmitted currently.
Sb.ilou WIN05

Retransmeted the same frame again

As u see in the pic upper the frame is detected as an error so the transmission of the frame in the bus
stopped and after the destroying we have retransmission

4.2 Overload Frame


It’s a frame transmitted by a node when it is overloaded and needs some time to process the data
frame received previously.

But now we have ecu that works in GH so this frame is very rare

10. Can STANDART data frame format


- When there is no frame in the bus we say: BUS IDLE (Recessive state=logic 1)
- Every data frame start with a dominante bit SOF (start of frame), the important of this
frame is to tell the nodes of a starting of frame on the bus and the bus is no longer IDLE
Sb.ilou WIN05

- THEN WE HAVE TO IDENTIFY THE FRAME BY Msg IDE (CAN is msg based Protocol), 11bits
- In the standar Can Frame we have 9 bits of the 11 Bits that can change and the are not
fix, so we can have 2^9=512 Different Can Frame in the standard Can frame (000X to
7FFx)

-
- after the msg ide we must tell the Bus if it is data frame or Remote Frame, becu zyou
know the data frame and the remote frame have the same Msg ID for this we use RTR Bit
- RTR: remote transmut Request:(=1 means Remote frame, =0 Data Frame)

- R1 and R0 bits:R1 used as IDE or difference between the Standard frame and the
extended frame. R0 used as FDF to difference between a

- DLC data length the Code, 4bits: tells how many bytes of data in the frame, u know the
can frame contain 1 bits or 2 3 OR 4;;;;;8bits,
- Data: 0 to 8 bits
Sb.ilou WIN05

- Checksum, 15 bits : detect if the bit changed due to noises for example
- CD 1bit: If the checksum number is the same we must validate the data frame for that we
use the checksome Delimiter

- ACK 1 bit: here where the nodes can tell that the frame is received and it is valid. Here
how it is happened the Tx node puts a recessive bit in the ACK, so All th Rx who valide
this frame and want to ACK it will put a dominant bit in the slot, so THE Tx if he find that
the bit change to a dominant he will that it s ack by the receiver.
If this bit got a 0 and 1 by two nodes in the same time the bus will take the dominant
bit value 0

- AD ack delimiter 1bit: always Recessive


- EOF the end of data frame 7bit: marks the frame is ended
- IFS inter frame space 3bits:
Sb.ilou WIN05

- Every dat frame ends with 11 conecutive Recessive bits , AD, EOF, IFS just after those bits
the bus consider IDLE again and every node can send data frame

- SOF and msg ID and RTR: called Arbitration field, R0 (IDE) and R1 DLC: control field,
checksum (CRC seaquence), CD (DEL) CRC field, ACK and DEL (AD) CK field

11. EXTENDED FRAME FORMAT


- In the extended bit the msg IDE 29 bits, means that 436 milion is Possibal
- Standar and extended can frame could co-exist, means mixt frame
Sb.ilou WIN05

-
Sb.ilou WIN05

Identifier base and the second identifier extension

SRR 1bit: Subtitude remote requist in the place of RTR in standard data format.
Always Recessive

IDE: Identifier Extension Indication Bit : indicate the presence of Extended


identifier or not

12. Priority
The fra;e who had the low ID has the priority

5.2 Mechanism de detection d erreur


1- Au niveau de bit : bit monotoring , bit shuffling
2- :Niveau msg : Verification de crc m la for ; des trame , l ack
Sb.ilou WIN05

13. Bit seg segmentation


In CAN bus every bit divide into 4 parties , this segmentations are not equal
Sb.ilou WIN05

pic they look equal

Sync_seg:

Bus
Sb.ilou WIN05

The RX node will be synchoronising to Tx. So

Pro_Seg:
Sb.ilou WIN05

… used to compense the delay of propagation

Phase_seg1 , Phase_seg2:

Point of the bit in the bus


Sb.ilou WIN05

That s whay we have Prop-_Seg

14. BIT Arbitration


Look at resource
Sb.ilou WIN05

15. BIT stuffling


Sb.ilou WIN05

When we have a succesice bits it hard to detect each bit


Sb.ilou WIN05

So if we have an accumulation of Delta error, this could be transorm the data


Sb.ilou WIN05

ALL RX nodes *

16. CRC in CAN


In can the crc I scomputed by the Can controller itself, by using a method BCH
Sb.ilou WIN05

t
Sb.ilou WIN05

Sfter the calculation the pulynom of checksum should be = to the result

17. CAN errors

18. Reaction to CAN errors


Sb.ilou WIN05

19. Can errors

Transmitter errors means that only the Tx can detect those errors. Same fot Rx erreors
Sb.ilou WIN05

20. Bit errors

If the transmitter put a value in the bus the bus should take the same value, but for some reason shit
happens as u see in the pic below, and we will have a bit errors. So the TX after detection of the b.it
errors will send an error flag, just after this detection

6.2 Bit errors exceptions


Sb.ilou WIN05

21. Ack error

To understand this we will have some cases below:

In this case there is no error


Sb.ilou WIN05

So here the Tx understand that there an error in the frame, because he not receiving any ACK, stull
have a rececive bit. That s what we call a ACK error,

So to make a difference between ACK And CRC errors, THE first one start just after the ACK slot and
the second one after the DLC slot. And that s why ze have a delimiter BIT DLC
Sb.ilou WIN05

7.2 Stuff errors

22. Form errors


Sb.ilou WIN05

23. Conclusions’

24. ERRORS Frame format


Sb.ilou WIN05

25. Basic error frame


Sb.ilou WIN05

26. CAN FD
Look the ressource

The orange part will transferred at regular speed, the blue high speed

BRS: ables us to choos if the frame will be in higher frame or not. Cuz the option of high speed is
optional. If it 1 then it is a dual frame

You might also like