AN2633 Freescale Semiconductor / Motorola, AN2633 Datasheet - Page 11

no-image

AN2633

Manufacturer Part Number
AN2633
Description
LIN Drivers for SLIC Module on the MC68HC908QL4
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
CodeWarrior Project — Assembly Source Code Basic SLIC Driver
MOTOROLA
in the main() routine. This monitors LINSleep flag and sets power states
accordingly. Due to differences in hardware between the EVB and LIN kit
board, this routine only turns off the LEDs to indicate the sleep mode condition.
In actual applications, it is likely the designer would power down the node for
sleep mode for energy conservation.
Exact procedures for putting the SLIC to sleep and waking it up again are
beyond the scope of this note, but it is important to remember a few basic
concepts. Like many communication peripheral modules, the SLIC contains a
state machine that synchronizes to the LIN message traffic. It is important to
safely disable the SLIC by writing the INITREQ bit before turning off the
physical layer. Doing this will avoid confusing the state machine and inducing
potentially undesirable side effects.
Depending on external circuitry, turning off the physical layer device can have
different effects on the rest of the system. On the LIN kit board, for example,
disabling the physical layer will activate the inhibit function (INH pin) on the
voltage regulator and power down the MCU. LIN bus activity will then restore
power to the MCU and the code will go through a POR.
On the EVB, however, the INH pin of the physical layer is not connected to the
regulator at all. Turning off the physical layer on the EVB will result in the Rx
line to the SLIC being driven to a low state. The SLIC should be disabled first,
to prevent it from trying to interpret this as a break symbol. Do NOT try to
disable the SLIC from within the SLIC ISR. Disable the SLIC only in a code
location outside the ISR such as the Check_LIN_Sleep() routine, where the
LINSleep flag is recognized and before the physical layer is disabled.
The first project described shows a basic C-based LIN slave application with a
SLIC ISR written in assembly code. Writing the ISR in assembly allows the
greatest degree of control over the performance and the size of the final code.
In very small embedded systems, such as those used in LIN slave nodes, code
size and performance efficiency are critical to getting the most out of very few
resources.
One of the key features of handling the ISR in assembly code is to use the
design of the SLIC module to ensure maximum execution efficiency. The SLIC
state vector register (SLCSV) is encoded to allow the user to build a jump table.
When using a jump table, no matter what interrupt source is being serviced, the
ISR will begin servicing the interrupt in a fixed amount of time.
The SLCSV register value is loaded into the index register, then used as an
offset into the jump table. The entries in the jump table point to service handler
LIN Drivers for SLIC Module on the MC68HC908QL4
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
CodeWarrior Project — Assembly Source Code Basic SLIC Driver
AN2633/D
11

Related parts for AN2633