AN2633 Freescale Semiconductor / Motorola, AN2633 Datasheet - Page 18

no-image

AN2633

Manufacturer Part Number
AN2633
Description
LIN Drivers for SLIC Module on the MC68HC908QL4
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
AN2633/D
18
NOTE:
After message buffer storage has been created for all messages that will be
recognized by the node, these must be included in a number of additional
arrays. The order of the messages must be consistent in all arrays. The
following three arrays are required:
Remember that the order of the messages must be consistent in all previous
tables. All the arrays (except the message buffers) must to be named as
described above.
The data type U8 frequently used in the driver and its API is defined as an
unsigned 8-bit number. For this compiler this is done as “unsigned char.”
LIN Drivers for SLIC Module on the MC68HC908QL4
Freescale Semiconductor, Inc.
For More Information On This Product,
Message buffers — Define one array for each message frame that
either requires a response or must be received. When defining, it is good
practice to include the frame ID in the name (for example,
“Message0xID”, where ID is the message identifier in hexadecimal with
the parity bits included).
This buffer is for the frame data field for each message. The data field
can be 1 to 8 bytes. The array size must equal the number of data bytes
for that message. An example of a 2-byte message could be:
U8 volatile Message0xD8[2];
MessagePointerTbl[] — Consists of pointers to all message buffers
defined above.
IdTbl[] — Contains all IDs relevant to this node. It is very important that
the ID includes the parity bits. The order of the messages must be the
same as in MessagePointerTbl[] and MessageDLCTbl[].
MessageDLCTbl[] — Defines the SLIC data length code register values
for each message. This control register in the SLIC module tells the
hardware how many bytes of data are in the message, shows if the
message should be sent or received by the slave, and what method of
checksum calculation should be used to ensure data integrity. LIN 2.0
allows for standard or enhanced checksum, where the ID byte is
included in the calculation. This DLC register value is copied directly to
the SLCDLC register at the appropriate time during the message
interrupt handling to send or receive data for this message frame with
the proper checksum calculation method.
This example shows that the message with ID 0xD8 (in IdTbl above) is
2 bytes long (plus checksum), uses standard checksum (ID not
included), and it is defined for sending.
Example: U8 volatile * MessagePointerTbl[] =
Example: U8 const near IdTbl[] = {0xD8, 0x99,…};
Example: U8 volatile near MessageDLCTbl[] =
{Message0xD8, Message0x99,…};
{0xC1,0x44,0x47,…};
Go to: www.freescale.com
MOTOROLA

Related parts for AN2633