AN2633 Freescale Semiconductor / Motorola, AN2633 Datasheet - Page 22

no-image

AN2633

Manufacturer Part Number
AN2633
Description
LIN Drivers for SLIC Module on the MC68HC908QL4
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
AN2633/D
LIN_Wakeup()
Error Handling
22
LIN_Wakeup() issues the LIN wake-up signal, which consists of eight dominant
bits (including start bit) followed by at least four recessive bits (including stop
bit and a recessive pause).
This function uses the WAKETX bit feature of the SLIC module to send a single
wake-up signal on the bus. No wake-up signal is sent if the driver is in SLEEP
state (the LINSleep flag is set) because the LIN_GotoRun() function should
have been called before, which changes the state to RUN (clear LINSleep = 0).
After the wake-up signal is sent, there should be a SynchBreak and
communication should resume from the master.
LIN_Wakeup() takes no parameters. There are two possible return values,
either LIN_OK (the wake-up signal was successfully sent) or
LIN_INVALID_MODE (if the current driver state is SLEEP).
Usage example:
The driver detects two types of errors in the LIN message — bit errors and
checksum errors.
A bit error is detected when a recessive bit is sent and a dominant bit is
detected on the bus. This indicates that the bus is controlled by another node
or shorted to GND. In either case, the transmission is aborted and the
BitERROR flag is set.
The SLIC automatically detects bit errors and this function in the ISR simply
sets the BitERROR flag in the API. The user must then clear the flag when the
BitERROR condition is handled (generally setting up for a re-transmission of
the corrupted error frame).
The node receiving data will calculate the checksum by doing a modulo-256
sum of the message data bits. This checksum must match the received
checksum. If not, the message is corrupt, and the receiving node will set the
ChecksumERROR flag and ignore the received data.
As with the bit error, checksum errors are automatically detected by the SLIC
module, then the ISR simply sets the ChecksumERROR flag. Note that a
checksum error might occur if the message DLC value in the MessageDLCTbl[]
array in LINmsg.c was set incorrectly.
The error flags are single bit field values that are set by the driver (set to 1) and
cleared by the application code (set to 0). The flags are global and can be
polled in the application to check whether there is an error during send or
receive.
Table 7
LIN Drivers for SLIC Module on the MC68HC908QL4
Freescale Semiconductor, Inc.
For More Information On This Product,
provides a description of bit errors and checksum errors.
Go to: www.freescale.com
status = LIN_Wakeup();
MOTOROLA

Related parts for AN2633