![]() ![]() Repeat step 2 through 4 until all bytes of the message have been exclusive OR’rd with the 8-bit register and shifted 8 times.Ħ. Repeat steps 3 until 8 shifts have been performed.ĥ. If the bit shifted out to the right is zero return to step 3a.Ĥ. If the bit shifted out to the right is one, exclusive OR the generating polynomial with the 8-bit register.ģb. Shift the 8-bit register one bit to the right.ģa. The step by step procedure to form the CRC-8 is as follows:Ģ. Note that this reversal of the bit order will have no effect whatever on the interpretation or the bit order of characters external to the CRC calculations. The MSB of the polynomial is dropped since it affects only the quotient and not the remainder. To be consistent, the bit order of the generating polynomial must be reversed. For convenience then, and since there are no carries used in arithmetic, let’s assume while computing the CRC that the MSB is on the right. In generating the CRC, the first bit transmitted is defined as the MSB of the dividend. ![]() The device used to serialize the data for transmission will send the conventional LSB or right-most bit of each character first. An example of the CRC-8 error check for message HEX 0207, (address 2, function 7 or a status request to slave number 2) follows: All arithmetic is performed modulo two, (no carries). (The receiving unit recalculates the CRC and compares it to the transmitted CRC). The resulting message including the CRC, when divided by the same polynomial (X**8 + X**7 + X**2 + 1), at the receiver will give a zero remainder if no errors have occurred. The integer quotient digits are ignored and the 8-bit remainder (initialized to all ones at the start to avoid the case where all zeroes being an accepted message), is appended to the message, (MSB first), as the two CRC check bytes. The message is pre-multiplied by X**8, (shifted left 8 bits), then divided by X**8 + X**7 + X**2 + 1 expressed as a binary number (11000000000000101). The message, (data bits only, disregarding start/stop and parity bits), is considered as one continuous binary number whose most significant bit, (MSB), is transmitted first. The CRC-8 error check sequence is implemented as described in the following paragraphs. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |