2 frame check sequence (fcs), 1 overview, 2 crc calculation – Rainbow Electronics AT86RF231 User Manual
Page 85: Section 8.2 “frame check sequence (fcs)” on, Is u, Section 8.2 “frame check, Heck (see, Section 8.2

85
8111A–AVR–05/08
AT86RF231
8.2
Frame Check Sequence (FCS)
The Frame Check Sequence (FCS) is characterized by:
• Indicate bit errors, based on a cyclic redundancy check (CRC) of length 16 bit
• Uses International Telecommunication Union (ITU) CRC polynomial
• Automatically evaluated during reception
• Can be automatically generated during transmission
8.2.1
Overview
The FCS is intended for use at the MAC layer to detect corrupted frames at a first level of filter-
ing. It is computed by applying an ITU CRC polynomial to all transferred bytes following the
length field (MHR and MSDU fields). The frame check sequence has a length of 16 bit and is
located in the last two bytes of a frame (MAC footer, see
).
The AT86RF231 applies an FCS check on each received frame. The FCS check result is stored
in register bit RX_CRC_VALID in register 0x06 (PHY_RSSI).
On transmit the radio transceiver generates and appends the FCS bytes during the frame trans-
mission. This behavior can be disabled by setting register bit TX_AUTO_CRC_ON = 0 (register
0x04, TRX_CTRL_1).
8.2.2
CRC Calculation
The CRC polynomial used in IEEE 802.15.4 networks is defined by:
The FCS shall be calculated for transmission using the following algorithm:
Let
be the polynomial representing the sequence of bits for which the checksum is to be computed.
Multiply M(x) by x
16
, giving the polynomial
Divide N(x) modulo 2 by the generator polynomial, G
16
(x), to obtain the remainder polynomial,
The FCS field is given by the coefficients of the remainder polynomial, R(x).
Example:
Considering a 5 octet ACK frame. The MHR field consists of
0100 0000 0000 0000 0101 0110.
The leftmost bit (b
0
) is transmitted first in time. The FCS is in this case
0010 0111 1001 1110.
The leftmost bit (r
0
) is transmitted first in time.
G
16
x
( )
x
16
x
12
x
5
1
+
+
+
=
M x
( )
b
0
x
k
1
–
b
1
x
k
2
–
b
2
x
k
3
–
… b
k
2
–
x
b
k
1
–
+
+
+
+
+
=
N x
( )
M x
( ) x
16
•
=
R x
( )
r
0
x
15
r
1
x
14
… r
14
x
r
15
+
+
+
+
=