AN2432 Freescale Semiconductor / Motorola, AN2432 Datasheet - Page 10

no-image

AN2432

Manufacturer Part Number
AN2432
Description
LIN Sample Application for the MC68HC908EY16 Evaluation Board
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Freescale Semiconductor, Inc.
AN2432/D
The LIN driver functions “LIN_IdleClock()” and “LIN_DriverStatus()” are then
used to determine whether or not there is any activity on the LIN bus.
“LIN_IdleClock()” checks whether or not there is any bus activity. If not, it
increments a counter whose value is compared with LIN_IDLETIMEOUT.
LIN_IDLETIMEOUT is defined as 500 in slave.cfh. If this number is exceeded,
the function “LIN_DriverStatus()” ceases to return a 1 (LIN_STATUS_RUN)
indicating that the bus has been idle for, in this case, about 2 seconds. If a
master node is connected to provide LIN activity then the LED, D5, will indicate
its presence and that the MC33399 LIN physical interface is functioning
1
correctly
.
“LIN_MsgStatus(0x20)” is then used to check for the presence of a message
with an ID of 20. The flow chart is shown in figure 3. In this case the timeout is
determined by the application software and not by the LIN drivers. The counter
value chosen (250) means that the LED will go out if there is no message with
this ID for a period of about a second. An ID of 20 was used for the keypad in
AN2205 (Car door keypad using LIN, reference [6]). If this message is present
then the D7 LED is illuminated. If present, the message is read and D8
th
indicates the state of the most significant bit in the 4
byte. This is the bit used
for the child-lock switch in the keypad application. D6 is similarly used to
indicate the presence of a second message with an ID of 30 (figure 4). Clearly
this is an arbitrary choice of message IDs and only a single bit of data can be
displayed but it does indicate the full functionality of the LIN bus. For example,
if the wrong baud rate is used, the bus activity LED will still come on but LEDs
D6, D7 and D8 will not.
1. In an application in which the regulator can be controlled (e.g. by using an LT1121 instead of
an MC78L05), the enable pin of the MC33399 could be taken low to put the node into sleep mode
by switching off the regulator and powering down the MCU. The code to do this is included in the
listing as a comment.
10
LIN Sample Application for the MC68HC908EY16 Evaluation Board
MOTOROLA
For More Information On This Product,
Go to: www.freescale.com

Related parts for AN2432