text
stringlengths
0
99.6k
the two most common line hits - a
garbaged block, and an <ACK> reply
getting garbaged. <xx> represents the
checksum byte
SENDERRECEIVERtimes out after 10 sec.
<---<NAK> <SOH>01
FE-data-<xx>---><---<ACK><SOH>02
FD-data-<xx>--->(data gets line hit)
<---<NAK> <SOH>02
FD-data-<xx>---><---<ACK><SOH>03
FC-data-<xx>--->(ack gets garbaged)
<---<ACK> <SOH>03
FC-data-<xx>---><---<ACK> <EOT>
---><---<ACK>
6. PROGRAMMING TIPS.
* The character-receive subroutine should
be called with a parameter specifying
the number of seconds to wait. The
receiver should first call it with a
time of 10, then <NAK> and try again,
10 times. After receiving the <SOH>,
the receiver should call the character
receive subroutine with a 1-second
timeout, for the remainder of the
message and the <cksum>. Since they
are sent as a continuous stream, timing
out of this implies a serious like
glitch that caused, say, 127 characters
to be seen instead of 128.
* When the receiver wishes to <NAK>,
it should call a "PURGE" subroutine, to
wait for the line to clear. Recall the
sender tosses any characters in its
UART buffer immediately upon completing
sending a block, to ensure no glitches
were misinterpreted. The most common
technique is for "PURGE" to call the
character receive subroutine,
specifying a 1-second timeout, and
looping back to PURGE until a timeout
occurs. The <NAK> is then sent,
ensuring the other end will see it.
* You may wish to add code recommended
by John Mahr to your character receive
routine - to set an error flag if the
UART shows framing error, or overrun.
This will help catch a few more
glitches - the most common of which is
a hit in the high bits of the byte in
two consecutive bytes. The <cksum>
comes out OK since counting in 1-byte
produces the same result of adding 80H
+ 80H as with adding 00H + 00H.
7. OVERVIEW OF CRC OPTION
The CRC used in the Modem Protocol is
an alternate form of block check which
provides more robust error detection
than the original checksum. Andrew S.
Tanenbaum says in his book, Computer
Networks, that the CRC-CCITT used by
the Modem Protocol will detect all
single and double bit errors, all
errors with an odd number of bits, all
burst errors of length 16 or less,
99.997% of 17-bit error bursts, and
99.998% of 18-bit and longer bursts.
The changes to the Modem Protocol to
replace the checksum with the CRC are
straight forward. If that were all
that we did we would not be able to
communicate between a program using the
old checksum protocol and one using
the new CRC protocol. An initial
handshake was added to solve this
problem. The handshake allows a
receiving program with CRC capability
to determine whether the sending
program supports the CRC option, and to
switch it to CRC mode if it does.
This handshake is designed so that it
will work properly with programs which
implement only the original protocol.
A description of this handshake is
presented in section 10.
8. MESSAGE BLOCK LEVEL PROTOCOL, CRC
MODE
Each block of the transfer in CRC mode
looks like:
<SOH><blk #><255-blk #><--128 data
bytes--><CRC hi><CRC lo> in