S
S
Sterpa2015-05-26 15:39:12
Arduino
Sterpa, 2015-05-26 15:39:12

How to calculate the parity bit for the 1st byte of information (CRC-1 checksum, check digit, parity check) in C++/Arduino?

There is a byte of information (8 bits). A C++/Arduino function is needed to calculate the ninth bit, the parity bit (CRC-1 checksum, check digit, parity).
An example of a specific code is needed to implement the standard CRC-1 algorithm, described as : The parity bit or check bit is formed when performing the XOR operation bit by bit .
Not to be confused with the LSB parity, this has nothing to do with CRC-1.
I searched a lot on the Internet, read a lot of forums, but there is no ready-made code anywhere, ANYWHERE. There are good examples and even libraries for CRC-16, CRC-32, but for 8 bits they are redundant (the checksum is larger than the word itself per byte). What is needed is the simplest, most primitive CRC-1, for the X + 1 polynomial. A simple, resource-intensive (for Arduino) code to bitwise XOR process a byte of information and get one control bit. Perhaps some recursive function with a register shift.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
monah_tuk, 2015-05-26
@Sterpa

You won't believe it: https://www.google.ru/search?num=20&newwindow=1&q=...
In particular: www.atmel.com/webdoc/AVRLibcReferenceManual/group_...
Good luck.

V
Vladimir Martyanov, 2015-05-26
@vilgeforce

Do you need to write the code for you? It's not here.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question