AN2623 Freescale Semiconductor / Motorola, AN2623 Datasheet - Page 9

no-image

AN2623

Manufacturer Part Number
AN2623
Description
LIN Temperature Sensor Using the MC68HC908QY/QY MCU
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Project Building
Special
Considerations
MOTOROLA
LIN Temperature Sensor Using the MC68HC908QT/QY MCU
This section provides a brief description of how to create a new project based
on the Motorola LIN QY/QT driver software. For more detailed information, it is
necessary to study AN2599/D: Generic LIN Driver for MC68HC908QY4.
Before designing an application, you should be aware of these special
considerations:
Freescale Semiconductor, Inc.
For More Information On This Product,
Create a new project in the Metrowerks CodeWarrior development
system.
Copy the Motorola LIN QY/QT driver software into the folder structure of
the project (for example, into the folders lin_src and lin_inc). The driver
consists of these files: LINapi.c, LINdriver.c, LINdriver.h, LINmsg.c, and
Tx_Config.h.
Add the Motorola LIN QY/QT driver software into the CodeWarrior tool
project tree (for example, into the folders Sources\Driver source and
Sources\Driver config).
In the application source file (e.g. LINtemp_sensor.c), include the LIN
driver by:
#include "LINdriver.h"
Define the messages in the LINmsg.c file, as described in the
Message Configuration File
Define the transmit pin of the LIN node in the Tx_Config.h file (default
value is pin 2 of Port B).
Update the vectors of the project in vector.c file. Specifically, it is
necessary to define interrupt service routine TimA1ISR() as a VECTOR
5 (0xFFF4).
The driver uses only timer channel 1, but use of the timer modulus
counter is prohibited. This is because the driver assumes that the
overflow value of the timer is set to 0xFFFF. No interrupt service routine
(ISR) is allowed other than the one used by the LIN driver during
communication. This is because both the Tx and Rx pins are software
driven and must have a predictable latency for the ISR response.
The use of the LDA/modify/STA sequence for the control of port B in this
interrupt-driven bit-banged driver is strongly discouraged because one
pin of this port (PTB2) is used as a Tx pin of the LIN driver. If the level of
this Tx pin is changed by an interrupt occurring during the sequence, the
wrong level will be restored. The solution is to use only BSET and BCLR
instructions when writing to port B.
Go to: www.freescale.com
section.
LIN
AN2623/D
Software
9

Related parts for AN2623