Bosch, Data frame – Rainbow Electronics CAN интерфейс User Manual
Page 49

BOSCH
ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30
Sep. 1991
Part B - page 47
DATA FRAME: admissible numbers of data bytes: {0,1,....,7,8}.
Other values may not be used.
DATA FIELD (
Standard Format as well as Extended Format
)
The DATA FIELD consists of the data to be transferred within a DATA FRAME. It can
contain from 0 to 8 bytes, which each contain 8 bits which are transferred MSB first.
CRC FIELD (
Standard Format as well as Extended Format
)
contains the CRC SEQUENCE followed by a CRC DELIMITER.
CRC SEQUENCE (
Standard Format as well as Extended Format
)
The frame check sequence is derived from a cyclic redundancy code best suited for
frames with bit counts less than 127 bits (BCH Code).
In order to carry out the CRC calculation the polynomial to be divided is defined as the
polynomial, the coefficients of which are given by the destuffed bit stream consisting of
START OF FRAME, ARBITRATION FIELD, CONTROL FIELD, DATA FIELD (if
present) and, for the 15 lowest coefficients, by 0. This polynomial is divided (the
coefficients are calculated modulo-2) by the generator-polynomial:
X
15
+ X
14
+ X
10
+ X
8
+ X
7
+ X
4
+ X
3
+ 1.
The remainder of this polynomial division is the CRC SEQUENCE transmitted over the
bus. In order to implement this function, a 15 bit shift register CRC_RG(14:0) can be
used. If NXTBIT denotes the next bit of the bit stream, given by the destuffed bit
sequence from START OF FRAME until the end of the DATA FIELD, the CRC
SEQUENCE is calculated as follows:
CRC_RG = 0;
// initialize shift register
Data
or
Control
Field
CRC Sequence
CRC Delimiter
Ack
Field
CRC FIELD
Data Frame