AN2573 Freescale Semiconductor / Motorola, AN2573 Datasheet - Page 11

no-image

AN2573

Manufacturer Part Number
AN2573
Description
LINkits LIN Evaluation Boards
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
CodeWarrior Project
MOTOROLA
The function LED_display() writes the required data to the four I/O lines
connected to the LEDs, ensuring that no change is made to any of the other
bits on the same port. The data sent is the 4-bit variable data, or the 2-bit
variable ID, according to the current mode. The ID is not displayed in binary so
the variable ID is used to shift a single 1 to the appropriate position. To
distinguish the ID display, this LED flashes at about 2 Hz using the counter
count.
The function LIN_response() uses the variable ID so that the appropriate
LIN_PutMsg(ID, data) is active. In order that the others are inactive,
LIN_SEND_UPDATED should be specified in file slave.id (e.g. #define
LIN_MSG_20 LIN_SEND_UPDATED). If LIN_SEND is used, the LIN drivers
will always send a response after LIN_PutMsg(ID, data) has been executed for
that ID. This does not apply to the QY4 because it uses the file LINmsg.c
instead and the “type of send” can be defined there — see user’s manual in
References.
The GR60 doesn’t have an ICG to initialize but its slave code is otherwise very
similar to that of the EY16.
The QY4 has no TBM module so it uses the main timer’s overflow flag to pace
its loop. This MCU also doesn’t have an SCI; its LIN interface is implemented
using I/O pins in conjunction with the timer’s channel 1 input capture and output
compare interrupts. For this reason, the QY4’s timer counter and modulus
registers should not be modified by the application code. To avoid
compromising the timing of LIN communications, no interrupts, other than
those from the LIN drivers themselves, are allowed. Within these limitations,
channel 2 of the timer is available for use by the application.
The demonstration project is structured as shown in
sample contains the demonstration application code that is programmed into
the LINkits evaluation boards. This is where any application being developed
with the evaluation boards should reside. The other folders contain the LIN
driver code, which should not normally be modified by the user. Its source code,
include files, and user manual reside in the src, inc, and man folders,
respectively.
The vector definition file vector.c is in the hc08 folder. The sample directory
contains the application source code, slave.c, and two additional files that
determine the behavior of the slave node. The first is slave.cfg, which specifies
the SCI prescaler value appropriate for the frequency being used and the
number that determines the 5-second no-bus-activity timeout. The second is
slave.id, which defines the messages to be acted upon by this node. The use
of these files is described in the user’s manual (see References).
Freescale Semiconductor, Inc.
For More Information On This Product,
LINkits LIN Evaluation Boards
Go to: www.freescale.com
Figure
5. The folder
CodeWarrior Project
AN2573/D
11

Related parts for AN2573