Ways to send data with CRC validation

crcdigital-communicationsserial

The data frames that are always sent using CRC are as follows:
enter image description here
a CRC calculated for each byte (DATA)

But to make the connection faster, could you send a single CRC for a whole frame of data? the first bit of the frame corresponds to the first bit of the CRC and then I send the data frame, and at the end of the frame I send the remaining data of the CRC [7: 1]

enter image description here
Is this last option viable? I know that it is not verified byte by byte, but in this way the sending of the entire frame is faster and therefore it is less likely that noise will enter in that period of time that it takes to send the frame? or is it very risky?

Best Answer

It doesn't make sense to calculate CRC per byte. Normal UART protocols tend to be designed like this:

  • 1-2 sync bytes.
  • 1 byte packet size.
  • n bytes of data payload.
  • 2 bytes checksum, CRC-16.

The width of the checksum/CRC should be in relation to the amount of data. CRC-8 might be sufficient if you just have a few bytes of data overall.