初级会员

- 积分
- 68
- 金钱
- 68
- 注册时间
- 2012-10-15
- 在线时间
- 4 小时
|
DF是这样的
Network Layer
PEC Byte: The packet error code (PEC) byte is a cyclic
redundancy check (CRC) value calculated for all of the
bits in a register group in the order they are passed, using
the initial PEC value of 01000001 and the following
characteristic polynomial:
x8 + x2 + x + 1
To calculate the 8-bit PEC value, a simple procedure can
be established:
1. Initialize the PEC to 0100 0001.
2. For each bit DIN coming into the register group, set IN0
= DIN XOR PEC[7], then IN1 = PEC[0] XOR IN0, IN2 =
PEC[1] XOR IN0.
3. Update the 8-bit PEC as PEC[7] = PEC[6], PEC[6] =
PEC[5],……PEC[3] = PEC[2], PEC[2] = IN2, PEC[1]
= IN1, PEC[0] = IN0.
4. Go back to step 2 until all data are shifted. The 8-bit
result is the final PEC byte.
请问这个要怎么去实现 ,用STM32?
|
|