AN2623 Freescale Semiconductor / Motorola, AN2623 Datasheet - Page 5

no-image

AN2623

Manufacturer Part Number
AN2623
Description
LIN Temperature Sensor Using the MC68HC908QY/QY MCU
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Software
CodeWarrior Project
MOTOROLA
LIN Temperature Sensor Using the MC68HC908QT/QY MCU
The temperature sensor node measures and corrects the current temperature
and provides the corrected value to the other nodes. As in every LIN network,
it is necessary to define a specific 6-bit long ID for each message that will be
used to transfer the data between nodes. The ID is protected by two parity bits.
A data field block length, which can be 1 to 8 bytes, must also be defined
(according to the LIN specification, see References). In this application, 2-byte
long messages are used.
LIN communication is bidirectional and driven by the master. Therefore, the
slave sends the current temperature measurement value after the master
sends a request for it. In the first byte, the current corrected temperature
measurement is sent. The second one remains unused; therefore it can be
used, for example, to transfer the reference voltage value.
The slave LED is driven according to the LSB of the first data byte received
from the master. As a possible enhancement of the application, the
temperature sensor type can be transferred to the slave by these messages,
which allows a change in the hardware configuration without a slave software
change.
Because the slave node module uses the Motorola LIN QY/QT driver, all LIN
connectivity tasks are handled outside the application code. This allows
developers to use the “LIN_GetMsg()” API function to receive the data provided
by the master and the “LIN_PutMsg()” function to send data to the master.
Using the LIN drivers allows the programmer to concentrate on the application
without having to get too involved with the communications protocol. These
drivers are available free of charge from
http://www.motorola.com/semiconductors/LIN.
The project is structured as shown in
application source code (LINtemp_sensor.c), board dependent data (Board.h),
vector.c file, sub folder Driver config with LIN configuration files (LINmsg.c,
TxConfig.h), and sub folder Driver source, with the Motorola LIN QT/QY
drivers.
LINmsg.c and vector.c files define the behavior of the slave node. The
LINmsg.c file is used to determine the LIN frames, as provided in
Configuration File
used as a LIN transmit pin. Files in Drive source sub folder contain Motorola
LIN driver implementation code and, in most cases, it should not be modified
by the user.
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
section. The TxConfig.h file specifies which MCU pin is
Figure
2. The folder Sources contains the
LIN Message
AN2623/D
Software
5

Related parts for AN2623