AN2573 Freescale Semiconductor / Motorola, AN2573 Datasheet - Page 27

no-image

AN2573

Manufacturer Part Number
AN2573
Description
LINkits LIN Evaluation Boards
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
void LED_display (void);
void LIN_response (void);
/******************************************************************************
*
*
*
*
*
*
******************************************************************************/
void main (void)
{
while (1)
{
}
}
/******************************************************************************
*
*
*
*
*
*
*
MOTOROLA
CONFIG1 = 0x01;
CONFIG2 = 0x45;
ICGMR = 64;
DDRA = 0x00;
DDRB = 0x3F;
DDRC = 0x80;
PTB
TBCR = 0x20;
TBCR = 0x22;
ICGTR = 158;
asm cli;
LIN_Init();
if (TBCR & 0x80)
{
}
Function name: Main
Originator:
Date:
Function:
Function name: Read_button
Originator:
Date:
Function:
TBCR |= 0x08;
LIN_IdleClock ();
if (LIN_DriverStatus () != 0x01)
{
}
count++;
PTB ^= 0x10;
Read_button ();
LED_display ();
LIN_response ();
= 0x20;
PTB &= ~(0x20);
P. Topping
18th June 2003
Loop at 75Hz. Switch off if no LIN activity for 5s (375). *
P. Topping
19th June 2003
The port line is read and its level compared with what
it was the previous time through the loop. If it is the
same, the counter "keycount" is used for debounce (80ms)
Freescale Semiconductor, Inc.
For More Information On This Product,
LINkits LIN Evaluation Boards
Go to: www.freescale.com
/* dissable COP
/* slow clock for TBM
/* ICG nominal 19.6608 MHz */
/* button on A4
/* LEDS on B0-3, LPI on B5 */
/* MCLK on C2
/* enable MC33399 LPI
/* / by 262144 for 75Hz @
/* 19.661MHz & enable TBM
/* insert trim value here
/* enable interrupts
/* initialise LIN drivers
/* is TBM flag set?
/* yes, clear it
/* check for LIN activity
/* bus idle for 375 trys ? */
/* yes, power down MCU
/* used for LED flashing
/* toggle tick output
/* read button on PTA4
/* update LEDs on PTB0-3
/* send LIN response msg.
MC68HC908EY16 Slave Software Listings
[tick on B4 */
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*
*
*
*
*
*
*
*
*
*
*
*
AN2573/D
27

Related parts for AN2573