0

I am trying to communicate between two boards with a serial port(rs232). One of the requirement is to be able to distinguish which task is sending/receiving data. So need a header field to identify task.

I plan to use asynchronous HDLC frame without caring much for control field. It looks like this

Flag | EOF(1bit)/Seq Number(7bits) | Task | Length | Info(length bytes) | CRC(16 bit) | Flag

Flag value is 0x7E.

I can limit the sequence number and Task and Length value to below 0x7E. So only information and CRC might have 0x7E value which i will replace by byte stuffing.

Almost everywhere i read people talk only about byte stuffing in information field. Is it not possible to get 0x7E in CRC. How do i handle that. Sould i do byte stuffing for CRC aswell if i end up with 0x7E

Sumanth V
  • 71
  • 1
  • 6
  • Take a look at [THIS](https://en.wikipedia.org/wiki/High-Level_Data_Link_Control) Paragraph **Asynchronous framing** is well explained. – LPs Feb 26 '16 at 07:36
  • My question is specifically regarding the CRC field. If we take the actual asynchronous HDLC frame, there is a 16 or 32 bit CRC field. Lets assume we are using 16 bit CRC. What if the generated CRC is 0x7E20. Should u do byte stuffing. Wont that change the CRC to 24 bits. I just need to know how this is supposed to be handled. Byte stuffing in Information field is ok as it is of variable size. – Sumanth V Feb 26 '16 at 08:36
  • No, beacuse of, before evaluate it, you have to remove escape char and reconvert the byte to the correct value. – LPs Feb 26 '16 at 08:47

0 Answers0