AN2343 Freescale Semiconductor / Motorola, AN2343 Datasheet - Page 4

no-image

AN2343

Manufacturer Part Number
AN2343
Description
HC908EY16 LIN Monitor
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
AN2343/D
Software: Demonstration of LIN functionality
General Overview
Use of the
Metrowerks LIN
Software Drivers
Monitoring LIN
activity
4
The application developed on the HC908EY16 Sample board makes extensive
use of the Metrowerks LIN drivers (reference 4). These drivers take care of the
interfacing between the Enhanced SCI module of the EY16 with the LIN bus.
LIN drivers have been developed for many Motorola MCUs by Metrowerks and
these drivers are available to customers. The LIN drivers used with this
HC908EY16 application are currently in the testing stage of the Software Life
cycle: the final production version should be sought when developing future
applications.
When installing the LIN drivers, they automatically create a sample LIN project
which may then be either cloned or edited. Once these drivers are included as
part of the project, many functions are available to the user, but this application
only makes use of the following:
LIN_Init
LIN_GetMsg
LIN_PutMsg
LIN_DriverStatus &
LIN_IdleClock
The main software loop of this application constantly monitors the LIN bus for
activity. If no activity has been detected for greater than a timeout period
(LIN_IDLETIMEOUT is specified in the LIN header file slave.cfg by the user),
then a simple ‘No Messages’ is written to the LCD display.
If activity is detected, Port C bit 2 is monitored to determine which message id
will be processed. This application only looks for two messages (Id 0x20 & Id
0x30), depending on the level on Port C bit 2.
With very little effort, it would be straightforward to extend this further.
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
HC908EY16 LIN Monitor
Software initialisation of driver (eg resets counters)
Hardware initialisation of the ESCI (Baud rate, Tx pin, etc)
The LIN drivers utilise the ESCI to automatically update
various data buffers if activity has occurred on the LIN bus.
This routine is used to extract that data from these registers.
Not used in this application, but allows data to be written to
the LIN bus when prompted by the Master.
These two functions are used together to determine the
length of inactivity on the bus. Particularly useful in low
power applications where the application may need to go to
‘sleep’ after particular timeout periods.
MOTOROLA

Related parts for AN2343