# CAN FD bit stuffing

Ok, it may be just peanuts, but here the author says that the max. length (i.e. max. bit stuffing) of the flexible data rate part of a 64 Byte payload frame is 673 bit (Figure 6).
That part consists of:

• ESI (1 bit)
• DLC (4)
• Data field (64 * 8 + x stuff)
• CRC (21 + 6 stuff )
• CRC Delimiter (1)

Now, 673 is the sum of the above plus 128 stuff bits. However that means that he considered a stuff bit after four consecutive bits of the same level, like it is done for the CRC part.

But in the Data Field a stuff bit has to be inserted after five consecutive bits, hasn't it? Therefore, the max. length of the Data field is 512 + 512/5 = 615 bit, what gives a maximum of 648 instead of 673 bit.
Am I correct?

• Just a guess, but is not bit stuffing to maintain a certain level of transitions only at the physical layer. That bit stuffing is removed when the physical layer is translated into the "data" layer. So, other than jitter, bit stuffing may not change the "data" layer one way or another. – st2000 Feb 6 '17 at 15:59
• Almost certainly. The source of confusion on the part of the writer probably originates with the new rule that bit stuffing in the CRC occurs after 4 bits, not 5. – WhatRoughBeast Feb 6 '17 at 16:02
• @st2000: Sure, but the stuffed bits also consume bandwidth ;-) – mic Feb 6 '17 at 16:03
• While the stuffed bits consume bandwidth, they also increase reliability. The original usage (manufacturing control) didn't need much bandwidth, and CAN systems are noted for reliable data transfer. At the expense of bandwidth, of course. – WhatRoughBeast Feb 6 '17 at 18:30

Input:   00000   1111   0000   1111...