AN2503 Freescale Semiconductor / Motorola, AN2503 Datasheet - Page 9

no-image

AN2503

Manufacturer Part Number
AN2503
Description
Slave LIN Driver for the MC68HC908QT/QY Family
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
ChangeTimerConfig()
Function
WAITING_NEWFRAME
State
RECEIVING_BREAK
State
MOTOROLA
The ChangeTimerConfig() function is responsible for the timer configuration.
The timer can be configured to function as either input capture or as overflow
using one byte as a parameter.
If the timer is configured as input capture (parameter=0x00), the timer will be
configured to interrupt either with the rising or falling edge if trimming is in
process, or only the falling edges if in any other state.
If the timer is configured as overflow, the timer pin will be under port control and
the timer will overflow every bit-time. If the internal clock is not fast enough for
a High_Speed LIN, the timer must be configured to overflow sometimes at
one-half bit-time.
After the driver is initialized, it will be waiting in an idle state called
WAITING_NEWFRAME. In this state, the program will wait for bus activity (a
dominant state) which could be the beginning of a new frame. Activity will be
detected by the input capture function of the timer, and the possible break is
validated and jumps to the next state: RECEIVING_BREAK.
After a possible break is detected, it should be validated in this state. Basically,
the routine must check whether (during a defined number of bits) the state of
the Rx pin remains low. This is accomplished with the process illustrated in
Figure
Slave LIN Driver for the MC68HC908QT/QY Family
Freescale Semiconductor, Inc.
For More Information On This Product,
4.
Go to: www.freescale.com
INPUT CAPTURE
OVERFLOW
Figure 4. RECEIVING_BREAK Flowchart.
gu8BitCount++
YES
RX = 1
?
NO
NO
gu8BitCount > BREAK_BIT_COUNT
WAITING_NEWFRAME
SYNCH_RECEPTION
RECEIVING_BREAK
gu8BitCount = 0
?
YES
Driver Functionality
AN2503/D
9

Related parts for AN2503