c# - Need of checksum in serial communication -
i working on project involving serial com pc ( usb serial application coded in c# ) embedded platform (stm32f4). saw in cases it's mandatory have checksum in communication frame. communication configuration:
baud-rate = 115200,
no parity bit,
one stopbit,
no handshake,
frame length : 16 bytes
is worth adding checksum in application? reasons why should (not) have checksum?
thank answer.
yes must have checksum. acceptable non-hobbyist solution proper checksum based on crc. common industry standard "crc-16-ccitt" (polynomal 0x1021). catch single-bit error, double-bit errors , burst errors.
even though you'll use rs-232 in office environment(?), emi caused crappy consumer electronics cause glitches , incorrect data. there lot of such crappy electronics around: example not uncommon electronics in pc have poor emc performance. in particular, there countless of usb-to-serial adapters downright awful quality.
the uart hardware in has no error detection worth mentioning: ancient 1960s technology. on hardware level, checks data integrity based on start , stop bits, , miss out errors in between. (parity checking equally poor).
alternatively, perhaps usb rs-485 adapter instead , use rs-485, far more rugged has differential signals. requires have rs-485 transceivers on target side too.
Comments
Post a Comment