English
Language : 

MC68HC908QL4 Datasheet, PDF (160/226 Pages) Motorola, Inc – Microcontrollers
Slave LIN Interface Controller (SLIC) Module
The next SLIC interrupt which occurs, if unmasked, will indicate the end of the request message frame
and will either indicate that the frame was properly transmitted or that an error was encountered during
transmission. Refer to 14.9.9.4 Possible Errors on Request Message Data for more detailed explanation
of these possible errors. This interrupt also signals to the application that the message frame is complete
and all data bytes and the checksum value have been properly transmitted onto the bus.
The SLIC module cannot begin to transmit the data until the user writes a 1 to TXGO, indicating that data
is ready. If the user writes TXGO without loading data into the transmit buffer, whatever data is in storage
will be transmitted, where the number of bytes transmitted is based on the data length value in the data
length register. Similarly, if the user writes the wrong value for the number of data bytes to transmit, the
SLIC will transmit that number of bytes, potentially transmitting garbage data onto the bus. The checksum
calculation is performed based on the data transmitted, and will therefore still be calculated.
The identifier must be processed, data must be loaded into the transmit buffer, and the SLCDLC value
written to initiate data transmission in a certain amount of time, based on the LIN specification. If the user
waits too long to start transmission, the master node will observe an idle bus and trigger a Slave Not
Responding error condition. The same error can be triggered if the transmission begins too late and does
not complete before the message frame times out. Refer to the LIN specification for more details on timing
constraints and requirements for LIN slave devices. This is especially important when dealing with
extended request frames, when the data must be loaded in 8 byte sections (maximum) to be transmitted
at each interrupt.
14.9.9.2 Extended Request Message Frames
Handling of extended frames is very similar to handling of standard frames, providing that the length is
less than or equal to 64 bytes. Because the SLIC module can only transmit 8 bytes at a time, the transmit
buffer must be loaded periodically for extended message frames. This is not standard LIN operation, and
is likely only to be used for special cases, so the added steps required for processing should not be as
critical to performance. During these types of operations, the application code is likely very limited in
scope and special adjustments can be made to compensate for added message processing time.
When handling extended request frames, it is important to clear the SLCF flag first, before loading any
data or writing TXGO. The data length is still written only one time, at the time the identifier is decoded,
along with the TXGO and CHKMOD bits, after the first 8 data bytes are loaded into the transmit buffer.
When this is done, a software counter must also be initialized to keep track of how many bytes are to be
transmitted in the message frame. The SLIC will generate an interrupt, if unmasked, after 8 bytes are
transmitted or an error is detected. At this interrupt, the SLCSV will indicate an error condition (in case of
byte framing error or bit error) or that the transmit buffer is empty. If the data is transmitted successfully,
the user must then clear the SLCF flag, subtract 8 from the software byte count, load the next 8 bytes into
the SLCD registers, and write a 1 to TXGO to tell the SLIC that the buffers are loaded and transmission
can commence. When this software counter reaches 8 or fewer, the remaining data bytes will fit in the
transmit buffer and the SLIC will automatically append the checksum value to the frame after the last byte
is sent.
NOTE
Do not write the CHKMOD or data length values in SLCDLC more than one
time per message frame. The SLIC tracks the number of sent or received
bytes based on the value written to this register at the beginning of the data
field and rewriting this register will corrupt the checksum calculation and
cause unpredictable behavior in the SLIC module. The application software
must track the number of sent or received bytes to know what the current
MC68HC908QL4 Data Sheet, Rev. 7
160
Freescale Semiconductor