Communication Processor Module
MOTOROLA
MPC823 USER’S MANUAL
16-229
SCC2
COMMUNICATION
16
PROCESSOR
MODULE
To rearrange the transmit queue before the communication processor module finishes
transmitting all of the buffers, issue the STOP TRANSMIT command. This can be useful for
transmitting expedited data before previously linked buffers or when an error occurs. When
receiving the STOP TRANSMIT command, the SCC2 HDLC controller stops transmitting
the current frame and starts transmitting idles or flags. When the SCC2 HDLC controller
receives the RESTART TRANSMIT command, it resumes transmission. To insert a
high-priority frame without aborting the current frame, the GRACEFUL STOP TRANSMIT
command can be issued. A special interrupt can be generated in the event register when
the current frame is complete.
16.9.16.3 SCC2 HDLC CHANNEL FRAME RECEPTION PROCESS.The HDLC receiver
is designed to work with little or no intervention from the core and can perform address
recognition, CRC checking, and maximum frame length checking. You are free to use the
received frame to perform any HDLC-based protocol.
When the core enables one of the receivers, the receiver waits for an opening flag character
and when it detects the first byte of the frame, the SCC2 HDLC controller compares the
frame address against the user-programmable addresses. You have four 16-bit address
registers and an address mask available for address matching. The SCC2 HDLC controller
compares the received address field to the user-defined values after masking with the
address mask. The SCC2 HDLC controller can also detect broadcast (all ones) address
frames if one address register is written with all ones.
If a match is detected, the SCC2 HDLC controller fetches the next buffer descriptor and if it
is empty, it starts transferring the incoming frame to the buffer descriptor associated data
buffer. When the data buffer has been filled, the SCC2 HDLC controller clears the E bit in
the buffer descriptor and generates an interrupt if the I bit in the buffer descriptor is set. If
the incoming frame exceeds the length of the data buffer, the SCC2 HDLC controller fetches
the next buffer descriptor in the table and, if it is empty, continues transferring the rest of the
frame to this buffer descriptor associated data buffer.
During this process, the SCC2 HDLC controller checks for a frame that is too long. When
the frame ends, the CRC field is checked against the recalculated value and written to the
data buffer. The data length written to the last buffer descriptor in the HDLC frame is the
length of the entire frame. This enables HDLC protocols that “l(fā)ose” frames to correctly
recognize the frame-too-long condition. The SCC2 HDLC controller then sets the last buffer
in frame bit, writes the frame status bits into the buffer descriptor, and clears the E bit. The
SCC2 HDLC controller next generates a maskable interrupt, indicating that a frame has
been received and is in memory. The SCC2 HDLC controller then waits for a new frame.
Back-to-back frames can be received with only a single shared flag between frames.
In the received frames threshold (RFTHR) location of the parameter RAM you can configure
the SCC2 HDLC controller not to interrupt the core until a certain number of frames are
received. You can combine this function with a timer to implement a timeout if less than the
threshold number of frames are received.