AN2573 Freescale Semiconductor / Motorola, AN2573 Datasheet - Page 6

no-image

AN2573

Manufacturer Part Number
AN2573
Description
LINkits LIN Evaluation Boards
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
AN2573/D
Master Software
6
The flow chart of the master code is shown in
at the end of this document. After MCU and LIN driver initialization, the slide
switch on the PCB is checked to see if LIN activity should be active. If not, a
continuous sweeping LED display is enabled. If, however, LIN activity is
required, the while(1) loop in the master’s main() function continually cycles
round the 16 IDs used in the demonstration application (see
done using the array idList[16], which is initialized to contain all the defined IDs.
If LIN_MsgStatus() indicates that there is a response for a particular ID, its data
is read and its byte in the array activeList[16] is checked to see if this is a new
node (it wasn’t previously present). If so its byte is set to a 1 and NewNode() is
executed to perform the LED display which indicates that a node has been
added.
If there is no response to a particular ID, activeList[16] is checked to determine
whether there was a response to that ID the previous time around the loop. If
there was a response the previous time, the node has since been removed.
This is indicated on the LEDs using LostNode(). NewNode() and LostNode()
are also used to provide the continuous sweeping LED display when the LIN
master is not active. This is determined in the function LINActive(), which reads
the slide switch on the master PCB.
Freescale Semiconductor, Inc.
For More Information On This Product,
LINkits LIN Evaluation Boards
Go to: www.freescale.com
Figure
2. The code itself is listed
Table
MOTOROLA
1). This is

Related parts for AN2573