|
Next: Firmware Modules
Up: Serial Communications Protocol
Previous: Physical Layer
  Contents
Before a raw data stream may be sent, it must be framed. A stream is
of variable length, and may contain full 8-bit data. No error detection or
correction is employed at this level of the protocol, however simple
CRC (Cyclic Redundancy Check) calculation could be added in at a later
date.
Three bytes are defined to facilitate framing the data. Most
importantly, the data link escape (DLE) character, defined as
0x10, tells the serial receiver that the next character
received has special meaning and is not simply data. The two framing
characters STX and ETX (Start Transmission and End Transmission,
respectively) are used to signify the beginning and end of a frame
when preceded by a DLE. STX and ETX are defined as 0x02 and
0x03 respectively. Figure 102 depicts a raw
data stream properly framed by DLE, STX and ETX.
Figure 102:
Serial protocol, 'clean' data framed for transmission.
|
Figure 102 shows a raw data stream with no
embedded DLE bytes. However, it is certainly possible that the raw
data stream may contain one or many DLE bytes. In this case, the
sender must character stuff, or escape the embedded DLE
characters. It simply doubles them up as it comes across them. The
receiver merely strips the extra DLE off upon receipt of the frame.
Figure 103 shows an example of a character stuffed
frame.
Figure 103:
Serial protocol, 'unclean' data character stuffed and framed for
transmission.
|
Next: Firmware Modules
Up: Serial Communications Protocol
Previous: Physical Layer
  Contents
Steve Richardson
2000-07-06
|
Table of Contents
[Whole document in PDF 1.9MB]
[more photos and information]
|