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

Page 15

Advertising
background image

BOSCH

ROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1

Sep. 1991

Part A - page 13

DATA FIELD
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
contains the CRC SEQUENCE followed by a CRC DELIMITER.

CRC SEQUENCE
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

REPEAT

CRCNXT = NXTBIT EXOR CRC_RG(14);
CRC_RG(14:1) = CRC_RG(13:0);

// shift left by

CRC_RG(0) = 0;

// 1 position

Data

or

Control

Field

CRC Sequence

CRC Delimiter

Ack
Field

CRC FIELD

Data Frame

Advertising