DRM047 — Rev 0
Designer Reference Manual
MOTOROLA
LIN Master Software Description
39
Designer Reference Manual — DRM047
Section 5. LIN Master Software Description
The software is described in terms of:
•
General State machine diagram
•
Data flow chart for each Master Board mode
5.1 State Machine
presents a general description of the implemented software.
The main routine consists of
MCU Init
ialization and
Mode selection
procedures.
5.1.1 MCU Initialization
Provides initialization of the microcontroller:
•
Ports A, H (pull-up/pull-down), M (wired-or), P (pull-up), S
initialization
•
Phase Locked Loop setup (Core is running on 48MHz)
•
Enable global interrupt mask bit
5.1.2 Mode Selection
Act as a device mode selection module. It tests the Port A (MODE
SELECTION header, see
) as long as one
out of four possible values (each of them is corresponding to one mode)
is recognized. The corresponding subroutine is initialized. In that routine
the program is running until reset or power die event. The modes were
described in
.
F
re
e
sc
a
le
S
e
m
ic
o
n
d
u
c
to
r,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
c
.
..