AN2575 Freescale Semiconductor / Motorola, AN2575 Datasheet - Page 21

no-image

AN2575

Manufacturer Part Number
AN2575
Description
MC68HC908EY16 ESCI LIN Drivers
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
/******************************************************************************
*
*
*
*
*
*
*
******************************************************************************/
void Read_LINtemp (void)
{
unsigned char bits;
unsigned char units;
unsigned char tens;
unsigned char negative;
MOTOROLA
bits = LIN_MsgStatus (0x0A);
if ((bits != LIN_OK) && (bits != LIN_MSG_OVERRUN))
{
}
else
{
}
if (error_count > 4)
{
}
else
{
Function name: Read_LINtemp
Originator:
Date:
Function:
if (error_count < 5 )
{
}
error_count = 0;
Line2[2] = 0x20;
Line2[0] = 0xA5;
Line2[1] = 0xA5;
LIN_GetMsg (0x0A, LIN_data);
bits = LIN_data[0];
if (bits < 60)
{
}
else
{
}
error_count ++;
bits = 60 - bits;
negative = 1;
bits = bits - 60;
negative = 0;
P. Topping
26th March 2003
Check for LIN message, if there decode and put temperature
into display array, if not enter **
Freescale Semiconductor, Inc.
For More Information On This Product,
MC68HC908EY16 ESCI LIN Drivers
Go to: www.freescale.com
/* an ID 0A message ?
/* no, error counter
/* already 5 ?
/* no, inc. error counter
/* yes, new data available */
/* data in last second ?
/* (needs approx 4MHz bus) */
/* no, display "** "
/* to signify no valid
/* LIN data available
/* yes, data available
/* read sensor message
/* and extract temp. byte
/* negative ?
/* yes,convert to positive */
/* but remember it wasn't
/* no, remove offset and
/* clear negative flag
/* has there been
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
Software Listing
AN2575/D
21

Related parts for AN2575