Specifications

AN93
150 Rev. 0.8
HDLC Example: Bit Errors on a Noisy Line
Bit errors can occur on an impaired line. The problem is determining and ignoring the spurious data resulting from
poor line conditions and recovering the valid data. This example illustrates a typical data corruption problem due to
a noisy line and how to analyze it.
For this example, the modem is a Si2404 configured with the following initialization string after reset.
AT+ES=6,,8
AT+ESA=0,0,0,,1,0
AT+ITF=0383,0128
AT:U87,010A
AT+MS=V22
AT:U7A,3
The following data stream was received over a noisy line.
0D 0A 43 4F 4E 4E 45 43 54 20 31 32 30 30 0D 0A 19 BE 20 20 19 B1 19 B0 19 B2 30 93
19 B1 19 B2 30 93 19 B1 19 B2 30 93 19 B1 19 B2 30 93 19 B1 19 B2 19 B2 B6 9E F7 46
19 B0 19 B2 29 C6 19 B0 19 B2 FF 98 89 18 19 B0 19 B2 92 6E EF 14 65 19 B0 19 B2 DA
BE C6 07 EA D8 31 C2 05 3C FA C8 86 C4 40 E6 19 A0 CA EA A8 F9 19 B2 8D 00 57 A5 43
29 19 B0 19 B2 05 CB 14 9F 7C 2D 19 B0 19 B2 19 B2 19 BA 0D 0A 4E 4F 20 43 41 52 52
49 45 52 0D 0A
First the data will be analyzed to point out the occurrence of bit errors and spurious data. Secondly, a simple
algorithm to filter the data will be proposed. Finally, the resulting valid data will be presented.
Table 100 lists an initial analysis of some recurring data patterns.
Table 100. Bit Errors
Data Meaning
19 B0 Is an indication the modem has detected a pattern with
> 6 marks in a row. Once this occurs, the receiver
begins looking for HDLC flags. Until the occurrence of
HDLC flags, 19 B2 and subsequent data is discarded.
19 B2
This pattern has three meanings.
If the receiver is looking for HDLC flags, 19B2
means that the receiver has found an HDLC flag.
If 19B2 is received after a packet has started (prior
data exists), the receiver assumes the CRC check
does not match the FCS bytes sent by the remote
transmitter, and declares the packet bad.
An isolated 19 B2 pattern (no preceding data) is
normal. This can occur when the following example
data pattern is seen: 7E 7E XX 7E 7E (where XX
can be up to 2 bytes of non-FLAG bit patterns at
the DCE).
The data can be analyzed as follows with valid data
shown in bold.
0D 0A 43 4F 4E 4E 45 43 54 20 31 32 30 30
0D 0A
CONNECT 1200
19 BE 20 20 tx 1200 rx 1200