AN2103 Freescale Semiconductor / Motorola, AN2103 Datasheet - Page 31

no-image

AN2103

Manufacturer Part Number
AN2103
Description
Local Interconnect Network (LIN) Demonstration
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
AN2103
MOTOROLA
4.2.2.4 Master Node
Main Loop
Freescale Semiconductor, Inc.
The main routine is essentially a simple infinite loop that waits for
either a msgrxd system flag to be set or a loopcontrol system flag to
be cleared. The msgrxd flag is set in the CANRx_ISR when a CAN
message is received. If the flag is set, the MsgHandlerTable is called
and the appropriate handler routine executed as described in the
Receiving CAN Messages section. The loopcontrol flag is cleared
periodically in the TIMBOVF_ISR, which overflows every 150ms.
When the flag is cleared, the ScheduleMsg function is called and the
selected mode executed. Once the CAN message is received or the
mode executed, the main function resets the appropriate flags and
returns to the infinite loop waiting for a flag to change again.
The main loop also performs initialization, by calling the appropriate
initialization function, before the infinite loop is entered. Initialisation
of the MCU registers, LIN drivers and application is also performed.
For More Information On This Product,
Go to: www.freescale.com
Master code implementation
Software Description
31

Related parts for AN2103