AN2600 Freescale Semiconductor / Motorola, AN2600 Datasheet - Page 10

no-image

AN2600

Manufacturer Part Number
AN2600
Description
A Simple Keypad Using LIN with the MC68HC908QT/QY MCU
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
AN2600/D
CPU Usage
10
NOTE:
NOTE:
NOTE:
A Simple Keypad Using LIN with the MC68HC908QT/QY MCU
The driver uses only timer channel 1, but usage of the timer modulus counter
is prohibited because the driver assumes that the overflow value of the timer is
set to 0xFFFF. No ISR is allowed other than the one used by the LIN driver
during communication. The reason for this is that both the Tx and Rx pins are
software driven and must have a predictable latency for the ISR response.
The use of the LDA/modify/STA sequence for the control of port B in this
interrupt-driven bit-banged driver is strongly discouraged because one pin of
this port (PTB2) is used as a Tx pin of the LIN driver. If the level of this Tx pin
is changed by an interrupt occurring during the sequence, the wrong level will
be restored. The solution is to use only BSET and BCLR instructions when
writing to port B.
For maximum benefit, please see the
This section provides estimated values of CPU usage during the LIN
communication. The MCU uses some of its power when executing the LIN
reception/transmission functions of the LIN driver. The demand on the CPU
time will depend linearly on the baud rate of the LIN network and the bus
frequency of the MCU.
To provide these estimates, the following measurements were taken. Because
all LIN driver communication activities are executed within the ISR of timer A
channel 1 [TimA1ISR()], it is possible to use one unused pin of the MCU, set
this pin high on the interrupt entry, and clear it to low just before the rti
instruction of the ISR.
Several scope screen captures were created. These measurements indicate
that an average CPU usage during the LIN communication measured over one
received byte is approximately 30% at a 9600 bps baud rate, and
approximately 53% at a 19,200 bps baud rate. And over one relevant frame
(two data bytes long), CPU usage is approximately 24% (for a 9600 bps baud
rate) and 41% (for a 19,200 bps baud rate).
Figure
Figure
Figure
Figure 6
6. Define the transmit pin of the LIN node in the Tx_Config.h file; default is
7. Update the vectors of the project in vector.c file. Specifically, it is
Freescale Semiconductor, Inc.
For More Information On This Product,
pin 2 of port B (PTB2).
necessary to define interrupt service routine (ISR) TimA1ISR() as a
VECTOR 5 (0xFFF4).
4,
7,
4,
and
Figure
Figure
Figure
Go to: www.freescale.com
Figure 9
5,
5, and
8, and
Figure
display reception of a full message.
Figure 6
Figure 9
7, and
were measured at a 9600 bps baud rate.
were measured at a 19,200 bps baud rate.
Figure 8
Application Source
show a reception of one data byte.
Code.
MOTOROLA

Related parts for AN2600