AN2623 Freescale Semiconductor / Motorola, AN2623 Datasheet - Page 7

no-image

AN2623

Manufacturer Part Number
AN2623
Description
LIN Temperature Sensor Using the MC68HC908QY/QY MCU
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Main Program
Structure
MOTOROLA
LIN Temperature Sensor Using the MC68HC908QT/QY MCU
The message ID is written in the hexadecimal format with parity bits included,
and the data field can be 2, 4, or 8 bytes long. In this application, two message
IDs are used:
A list of all the operations necessary to set up the LINmsg.c file is presented
here:
U8 volatile Message0x1A[2];
U8 volatile Message0x5B[2];
U8 volatile * MessagePointerTbl[] = {Message0x1A, Message0x5B};
U8 const near IdTbl[] = {0x1A, 0x5B};
U8 const near MessageCountTbl[] = {0x13, 0x03};
The main program flowchart can be seen in
periphery initialization, two functions LED_display() and LIN_response() are
called.
At first, the LED status is updated according the message received from the
master.
The second function called from the main program loop is the LIN_response().
There the current temperature is measured (the value stored in MsgSent[0]
1. Create a message buffer for the frame data field of each application
2. Define a pointer array MessagePointerTbl[] that contains pointers to all
3. Create an identifier table (array) IdTbl[] containing all IDs relevant to this
4. Then, define an array variable MessageCountTbl[]. This is a table which
Freescale Semiconductor, Inc.
For More Information On This Product,
Message ID equal to 0x1A (0x1A with the parity bits included) is used for
reception
Message ID 0x1B (0x5B with parity) is used for transmission
message.
application message buffers.
node. Note that it must be set up in the same order as in
MessagePointerTbl[] and MessageCountTbl[]. And, message IDs must
have parity bits included.
defines (for each available message) the length of the frame data and
checksum fields. It also indicates whether the specific message should
be sent or received. The least significant half-byte (LSHB) of each entry
indicates the length of the data and checksum fields (length of the
checksum field is equal to 1). The most significant half-byte (MSHB) is
equal to 1 for message reception, and to 0 for transmission. In addition,
it could also be equal to 0xF (ignore), which means that the message is
ignored unless it has been updated since its last read/write.
Go to: www.freescale.com
// ID 0x1A = 0x1A with parity
// ID 0x1B = 0x5B with parity
Figure
3. After the necessary MCU
AN2623/D
Software
7

Related parts for AN2623