AN2503 Freescale Semiconductor / Motorola, AN2503 Datasheet - Page 8

no-image

AN2503

Manufacturer Part Number
AN2503
Description
Slave LIN Driver for the MC68HC908QT/QY Family
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
AN2503/D
LIN Initialization
LINInit() function
void LINInit( void )
pin*/
checking */
}
8
{
#ifdef TWOPINS
#endif
gu8InpMode = WAITING_NEWFRAME;
ChangeTimerConfig(INPCAPTURE);
gu8IdOrData = ID;
#endif
gu8RxErrCounter = 0x00;
#ifdef ENABLE_TRANSCEIVER
TRANSCEIVER_ENABLE;
#endif
EnableInterrupts;
return;
#ifdef CHECK_BIT_ERROR
SET_OUTPUT_PIN;
NOTE:
/* TWOPINS */
gu8ErrReg = 0x00;
gu8TxErrCounter = 0x00;
The main.c file contains the basic structure for initializing this driver based on
the lincfg.h file. Basically the registers that should be configured are:
In the example, Start08.c doesn’t initialize variables. Therefore, the user must
ensure proper initialization of variables. All variables used by the driver are
properly initialized in code.
This function initializes hardware and variables to a default state.
Error flags are cleared; the transceiver is enabled; the Tx pin is set to a default
state of 1, and the timer is configured for the input capture function in the idle
state of WAITING_NEWFRAME. The timer configuration is performed in the
ChangeTimerConfig()
Slave LIN Driver for the MC68HC908QT/QY Family
Freescale Semiconductor, Inc.
For More Information On This Product,
CONFIG1 and CONFIG2 — One-time writable registers used to initialize
various options (internal/external oscillator, enable IRQ, COP
disabled/enabled, etc)
OSCTRIM — Specifies the size of the internal capacitor used by the
internal oscillator (changes the oscillator frequency)
Variables — All must be initialized to be used in this driver. This
functionality is performed by
Go to: www.freescale.com
Function.
/* If two pins are defined for I/O, set output
/* Set initial state */
/* Initialize variables used for bit_error
/* Initialize error variables */
LINInit() function
MOTOROLA

Related parts for AN2503