Microprocessor User's Manual

188 Rabbit 3000 Microprocessor
the current receive frame is not needed (because it is addressed to a different station, for
example) a Flag Search command is available. This command forces the receiver to ignore
the incoming data stream until another Flag is received. In the transmitter, the CRC gener-
ator is preset and the opening Flag is transmitted automatically after the first byte is writ-
ten to the transmitter buffer, and CRC and the closing flag are transmitted after the byte
that is written to the buffer through the Address Register. If no CRC is required, writing
the last byte of the frame to the Long Stop Register automatically appends a closing flag
after the last byte. If the transmitter underflows, either an Abort or a Flag will be transmit-
ted, under program control. A command is available to send the Abort pattern (seven con-
secutive ones) if a transmit frame needs to be aborted prematurely. The Abort command
takes effect on the next byte boundary, and causes the transmission of an 0xFE (a zero fol-
lowed by seven ones), after which the transmitter will send the idle line condition. The
Abort command also purges the transmit FIFO. The idle line condition may be either
Flags or all ones.
Both the receiver and transmitter contain four bytes of buffering for the data. Status bits
are buffered along with the data in both receiver and transmitter. The receiver automati-
cally generates an interrupt at the end of a received frame, and the transmitter generates an
interrupt at the end of CRC transmission, at the end of the transmission of an Abort
sequence, and at the end of the transmission of a closing Flag.
The transmitter is not capable of sending an arbitrary number of bits, but only a multiple
of bytes. However, the receiver can receive frames of any bit length. If the last "byte" in
the frame is not eight bits, the receiver sets a status flag that is buffered along with this last
byte. Software can then use the table below to determine the number of valid data bits in
this last "byte." Note that the receiver transfers all bits between the opening and closing
Flags, except for the inserted zeros, to the receiver data buffer.
Several types of data encoding are available in the HDLC mode. In addition to the normal
NRZ, they are NRZI, Biphase-Level (Manchester), Biphase-Space (FM0) and Biphase-
Mark (FM1). Examples of these encodings are shown in the Figure below. Note that in
NRZI, Biphase-Space and Biphase-Mark the signal level does not convey information.
Rather it is the placement of the transitions that determine the data. In Biphase-Level it is
the polarity of the transition that determines the data.
Last Byte Bit Pattern Valid Data Hits
bbbbbbb0 7
bbbbbb01 6
bbbbb011 5
bbbb0111 4
bbb01111 3
bb011111 2
b0111111 1