AN2503 Freescale Semiconductor / Motorola, AN2503 Datasheet - Page 15

no-image

AN2503

Manufacturer Part Number
AN2503
Description
Slave LIN Driver for the MC68HC908QT/QY Family
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
FindInTable()
Function
CalcCheckSum()
Function
Sample() Function
MOTOROLA
Use this simple look-up function when a small ROM table is defined for space
purposes. The function starts looking for an ID from the bottom of a table to the
first of its elements. It can increase overhead, but it is very useful for code sizing
purposes. Because it is written in assembly, it executes quickly.
FindInTable() function code:
UINT8 FindInTable(UINT8 temp)
}
This function is used to check the integrity of a frame calculating the checksum
of the buffer using modulo-256 sum. This functionality can be enabled or
disabled in compiler options.
This function is used when the integrity of data is very important and there is a
lot of noise in the environment. Each bit is sampled four times, obtaining the
most common value in the sample and flagging an error when values obtained
vary from each other. This function is not recommended in most cases because
it increases the code, it is not specified in LIN, and it can increase overhead
(which creates problems with synchronization). The user has the option to
enable it or disable it.
{
Slave LIN Driver for the MC68HC908QT/QY Family
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
asm{
}
return gu8P1;
LDA temp
STA gu8P1
LDHX #POINTER_TO_LAST
LDA #LIN_MSGS
LOOP:
END:
STA gu8P1
PSHA
LDA gu8P1
CMP ,X
BNE NE
PULA
DECA
BRA END
NE:
TXA
SUB #3
TAX
PULA
DBNZA LOOP
LDA #0xFF
Driver Functionality
AN2503/D
15

Related parts for AN2503