AN2623 Freescale Semiconductor / Motorola, AN2623 Datasheet - Page 13

no-image

AN2623

Manufacturer Part Number
AN2623
Description
LIN Temperature Sensor Using the MC68HC908QY/QY MCU
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
}
/*******************************************************************************
*
*
*
*
*
*
*
*******************************************************************************/
void main (void)
{
}
MOTOROLA
k = (unsigned int) (256*TEMP_REFERENCE) / MeasuredReference;
MsgSend[0] = (unsigned char) ((k*MsgSend[0])/256);
Ret = LIN_PutMsg (ID_SEND, MsgSend);
Function name: Main
$Author:
Date:
Last modify:
Function:
CONFIG1 = 0x09;
CONFIG2 = 0x00;
DDRB = 0xFA;
PTB_PTB7 = 1;
PTB &= 0x87;
TSC = 0x00;
TSC_TOF = 0;
ADICLK = 0x40;
OSCTRIM = 0;
asm cli;
LIN_Init();
for EVER
{
}
if (TSC_TOF)
{
}
TSC_TOF = 0;
LED_display ();
LIN_response ();
re004c $
21st June 2003
1st September 2003
LIN Temperature Sensor Using the MC68HC908QT/QY MCU
Freescale Semiconductor, Inc.
For More Information On This Product,
/* disable COP
/* default (int. osc.)
/* enable port B outputs
/* LEDs:B3-6, MC33399 enable:B7, TX: B2 */
/* enable MC33399
/* switch off all LED
/* timer prescaler /1
/* start timer
/* ADC clock rate = 4
/* cannot be faster then aprox
/* 1.2 MHz.
/* trim to max. frequency
/* enable interrupts
/* initialise LIN drivers
/* is overflow flag set?
/* yes, clear it
/* update LEDs on PTB
/* send LIN response msg.
Go to: www.freescale.com
/* LIN response to ID_SEND
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
Appendix - Software Listing
*
*
*
*
*
*
*
AN2623/D
13

Related parts for AN2623