Chapter 12
274
A message format can also define a field that indicates the length of the data
that follows, and receiving nodes can use this value to determine when a message
ends.
0
A header is information that uses a defined format and appears at the beginning
of a message or other block of data. The header typically consists of a series of
fields, with each field having a defined size and location. The information
included in a header can vary. A header might include some or all of these
items:
??? Start-of-communication code.
??? Address of the receiving node.
??? Address of the sending node.
??? Length of the data that follows the header.
??? Checksum or other value used for error detection.
??? Description of the type of data that follows.
??? Time and date information.
)"4
Another option for distinguishing between addresses and data uses a 9-bit format.
Bit 8 (the ninth bit) indicates whether bits 0??“7 contain data (0) or an
address (1). Not all UARTs support the 9-bit format. The longer words in 9-bit
data mean that communications are slightly more sensitive to mismatches in
the rates at the transmitting and receiving ports. Messages that consist of only
US ASCII text can use seven data bits for a text character and the eighth bit to
indicate address or data.
Some microcontrollers have a built-in ability to use the ninth bit to detect an
address.
Pages:
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301