Anti-Pinch Window Lift Control Module User's Guide

ANTI-PINCH WINDOW LIFT
CONTROL MODULE
USER’S GUIDE
© 2006 Microchip Technology Inc.
DS51604A
Note the following details of the code protection feature on Microchip devices:
•
Microchip products meet the specification contained in their particular Microchip Data Sheet.
•
Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.
•
There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
•
Microchip is willing to work with the customer who is concerned about the integrity of their code.
•
Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Information contained in this publication regarding device
applications and the like is provided only for your convenience
and may be superseded by updates. It is your responsibility to
ensure that your application meets with your specifications.
MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED,
WRITTEN OR ORAL, STATUTORY OR OTHERWISE,
RELATED TO THE INFORMATION, INCLUDING BUT NOT
LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE,
MERCHANTABILITY OR FITNESS FOR PURPOSE.
Microchip disclaims all liability arising from this information and
its use. Use of Microchip devices in life support and/or safety
applications is entirely at the buyer’s risk, and the buyer agrees
to defend, indemnify and hold harmless Microchip from any and
all damages, claims, suits, or expenses resulting from such
use. No licenses are conveyed, implicitly or otherwise, under
any Microchip intellectual property rights.
Trademarks
The Microchip name and logo, the Microchip logo, Accuron,
dsPIC, KEELOQ, microID, MPLAB, PIC, PICmicro, PICSTART,
PRO MATE, PowerSmart, rfPIC and SmartShunt are
registered trademarks of Microchip Technology Incorporated
in the U.S.A. and other countries.
AmpLab, FilterLab, Migratable Memory, MXDEV, MXLAB,
SEEVAL, SmartSensor and The Embedded Control Solutions
Company are registered trademarks of Microchip Technology
Incorporated in the U.S.A.
Analog-for-the-Digital Age, Application Maestro, dsPICDEM,
dsPICDEM.net, dsPICworks, ECAN, ECONOMONITOR,
FanSense, FlexROM, fuzzyLAB, In-Circuit Serial
Programming, ICSP, ICEPIC, Linear Active Thermistor,
MPASM, MPLIB, MPLINK, MPSIM, PICkit, PICDEM,
PICDEM.net, PICLAB, PICtail, PowerCal, PowerInfo,
PowerMate, PowerTool, Real ICE, rfLAB, rfPICDEM, Select
Mode, Smart Serial, SmartTel, Total Endurance, UNI/O,
WiperLock and Zena are trademarks of Microchip Technology
Incorporated in the U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated
in the U.S.A.
All other trademarks mentioned herein are property of their
respective companies.
© 2006, Microchip Technology Incorporated, Printed in the
U.S.A., All Rights Reserved.
Printed on recycled paper.
Microchip received ISO/TS-16949:2002 quality system certification for
its worldwide headquarters, design and wafer fabrication facilities in
Chandler and Tempe, Arizona and Mountain View, California in
October 2003. The Company’s quality system processes and
procedures are for its PICmicro® 8-bit MCUs, KEELOQ® code hopping
devices, Serial EEPROMs, microperipherals, nonvolatile memory and
analog products. In addition, Microchip’s quality system for the design
and manufacture of development systems is ISO 9001:2000 certified.
DS51604A-page ii
© 2006 Microchip Technology Inc.
ANTI-PINCH WINDOW LIFT CONTROL
MODULE USER’S GUIDE
Table of Contents
Preface ........................................................................................................................... 1
Introduction............................................................................................................ 1
Document Layout .................................................................................................. 1
Conventions Used in this Guide ............................................................................ 2
Recommended Reading........................................................................................ 3
The Microchip Web Site ........................................................................................ 3
Customer Support ................................................................................................. 3
Chapter 1. Getting Started – Quick Setup
1.1 Introduction ..................................................................................................... 5
1.2 Hardware ........................................................................................................ 5
1.3 Setup .............................................................................................................. 5
Chapter 2. Window Lift Control Module Hardware
2.1 Introduction ..................................................................................................... 7
2.2 Hardware ........................................................................................................ 7
2.3 Schematics ................................................................................................... 10
Chapter 3. Window Lift Control Module Software
3.1 Introduction ................................................................................................... 11
3.2 Software ....................................................................................................... 11
Worldwide Sales and Service .................................................................................... 16
© 2006 Microchip Technology Inc.
DS51604A-page iii
Anti-Pinch Window Lift Control Module User’s Guide
NOTES:
DS51604A-page iv
© 2006 Microchip Technology Inc.
ANTI-PINCH WINDOW
LIFT CONTROL MODULE
Preface
NOTICE TO CUSTOMERS
All documentation becomes dated, and this manual is no exception. Microchip tools and
documentation are constantly evolving to meet customer needs, so some actual dialogs
and/or tool descriptions may differ from those in this document. Please refer to our web site
(www.microchip.com) to obtain the latest documentation available.
Documents are identified with a “DS” number. This number is located on the bottom of each
page, in front of the page number. The numbering convention for the DS number is
“DSXXXXXA”, where “XXXXX” is the document number and “A” is the revision level of the
document.
For the most up-to-date information on development tools, see the MPLAB® IDE on-line help.
Select the Help menu, and then Topics to open a list of available on-line help files.
INTRODUCTION
This chapter contains general information that will be useful to know before using the
Anti-Pinch Window Lift Control Module. Items discussed in this chapter include:
•
•
•
•
•
Document Layout
Conventions Used in this Guide
Recommended Reading
The Microchip Web Site
Customer Support
DOCUMENT LAYOUT
This document describes how to use the Anti-Pinch Window Lift Control Module. The
manual layout is as follows:
• Chapter 1. “Getting Started – Quick Setup”
• Chapter 2. “Window Lift Control Module Hardware”
• Chapter 3. “Window Lift Control Module Software”
© 2006 Microchip Technology Inc.
DS51604A-page 1
Anti-Pinch Window Lift Control Module User’s Guide
CONVENTIONS USED IN THIS GUIDE
This manual uses the following documentation conventions:
DOCUMENTATION CONVENTIONS
Description
Arial font:
Italic characters
Initial caps
Quotes
Underlined, italic text with
right angle bracket
Bold characters
N‘Rnnnn
Text in angle brackets < >
Courier New font:
Plain Courier New
Represents
Referenced books
Emphasized text
A window
A dialog
A menu selection
A field name in a window or
dialog
A menu path
MPLAB® IDE User’s Guide
...is the only compiler...
the Output window
the Settings dialog
select Enable Programmer
“Save project before build”
A dialog button
A tab
A number in verilog format,
where N is the total number of
digits, R is the radix and n is a
digit.
A key on the keyboard
Click OK
Click the Power tab
4‘b0010, 2‘hF1
Italic Courier New
Sample source code
Filenames
File paths
Keywords
Command-line options
Bit values
Constants
A variable argument
Square brackets [ ]
Optional arguments
Curly brackets and pipe
character: { | }
Ellipses...
Choice of mutually exclusive
arguments; an OR selection
Replaces repeated text
Represents code supplied by
user
DS51604A-page 2
Examples
File>Save
Press <Enter>, <F1>
#define START
autoexec.bat
c:\mcc18\h
_asm, _endasm, static
-Opa+, -Opa0, 1
0xFF, ‘A’
file.o, where file can be
any valid filename
mcc18 [options] file
[options]
errorlevel {0|1}
var_name [,
var_name...]
void main (void)
{ ...
}
© 2006 Microchip Technology Inc.
Preface
RECOMMENDED READING
This user’s guide describes how to use the Anti-Pinch Window Lift Control Module.
Other useful documents are listed below. The following Microchip documents are available and recommended as supplemental reference resources.
It is recommended that you become familiar with the documents listed below, prior to
using the Anti-Pinch Reference Design.
PICkit™ 2 Microcontroller Programmer User’s Guide (DS51553)
Consult this document for instructions on how to use the PICkit 2 Microcontroller
Programmer hardware and software.
PIC16F688 Data Sheet (DS41203)
Data sheet for the PIC16F688 14-pin, Flash-based, 8-bit CMOS microcontrollers with
nanoWatt Technology.
MCP201 LIN Transceiver with Voltage Regulator Data Sheet (DS21730)
Data sheet for the MCP201 LIN transceiver. Gives an overview of the device including
modes of operation and electrical characteristics.
THE MICROCHIP WEB SITE
Microchip provides online support via our web site at www.microchip.com. This web
site is used as a means to make files and information easily available to customers.
Accessible by using your favorite Internet browser, the web site contains the following
information:
• Product Support – Data sheets and errata, application notes and sample
programs, design resources, user’s guides and hardware support documents,
latest software releases and archived software
• General Technical Support – Frequently Asked Questions (FAQs), technical
support requests, online discussion groups, Microchip consultant program
member listing
• Business of Microchip – Product selector and ordering guides, latest Microchip
press releases, listing of seminars and events, listings of Microchip sales offices,
distributors and factory representatives
CUSTOMER SUPPORT
Users of Microchip products can receive assistance through several channels:
•
•
•
•
•
Distributor or Representative
Local Sales Office
Field Application Engineer (FAE)
Technical Support
Development Systems Information Line
Customers should contact their distributor, representative or field application engineer
(FAE) for support. Local sales offices are also available to help customers. A listing of
sales offices and locations is included in the back of this document.
Technical support is available through the web site at: http://support.microchip.com
© 2006 Microchip Technology Inc.
DS51604A-page 3
Anti-Pinch Window Lift Control Module User’s Guide
NOTES:
DS51604A-page 4
© 2006 Microchip Technology Inc.
ANTI-PINCH WINDOW LIFT CONTROL
MODULE USER’S GUIDE
Chapter 1. Getting Started – Quick Setup
1.1
INTRODUCTION
The Anti-Pinch Window Lift Control module is shipped programmed and ready for use.
The user will need to supply hardware and corrections as described below.
1.2
HARDWARE
The user needs to supply a motor (5-10A SP continuous load current), a power supply
(rated to operate the motor) and a single-pole, double-throw, center-off switch.
Connectors J1 and J2 provide interface to the board.
The mating connectors (AMP/TYCO) are:
• PLUG HOUSING 6-POSITION MINI UNIV-MATE, PN# 172168-1, one per
connector
• SOCKET TERMINALS 16-20AWG TIN CRIMP, PN# 171637-1, 6 per connector
1.3
SETUP
The Anti-Pinch Window Lift motor is connected to J1-1 and J1-3.The terminals will be
determined by the type of motor selected.
The control switch is a single-pole, double-throw, center-off. The common terminal is
connected to GND (J2-4 or J1-6). The UP terminal is routed to J2-1 and the DOWN side
is hooked to J2-3.
Power is supplied to J2-6 (+12 VDC) and J2-4 (Chassis GND).
Before applying power, make sure that jumpers E1 and E2 are connected to pins 1 and
2 (see Figure 1-2).
FIGURE 1-1:
WINDOW LIFT CONTROL MODULE
J1-1
1
4
2
5
3
6
J1-3
1
4
2
5
J2-1
J2-4
3
6
M
J2-3
J2-6
DOWN
UP
+12 VDC
GND
LIN
© 2006 Microchip Technology Inc.
DS51604A-page 5
Anti-Pinch Window Lift Control Module User’s Guide
LIN commands are sent via the LIN bus connected to J2-5.
Programmed with the standard firmware, the module responds to LIN 2.0 message
frame of two data bytes and classic checksum (checksum only includes data). The
identifier is 0x05. Bit 2 of the first databyte signals ‘down’ and bit 1 signals ‘up’. The
second databyte is not used.
FIGURE 1-2:
DEFAULT JUMPER POSITIONS
Pin 1 of
Jumpers
E1 and E2
are closest
to the board
edge.
The board may be re-programmed through JP1 with a Microchip PICkit™ 2
Development Programmer (not included).
PROGRAMMING BY PICkit™ 2 PROGRAMMER VIA JP1
PICkit™ 2
FIGURE 1-3:
DS51604A-page 6
© 2006 Microchip Technology Inc.
ANTI-PINCH WINDOW LIFT CONTROL
MODULE USER’S GUIDE
Chapter 2. Window Lift Control Module Hardware
2.1
INTRODUCTION
The Anti-Pinch Window Lift Control module is implemented using a Microchip generic
LIN Actuator and DC Servo board. Hard-wired switch inputs, as well as LIN commands,
can be used to control the two output relays.
This module consists of a microcontroller, power supply, relays with their associated
drivers, input conditioning circuits and network physical interface.
FIGURE 2-1:
LIN ACTUATOR/DC SERVO
Motor Current Feedback
Relays
H-Bridge
Analog IN
Motor Position Feedback
Aux Input
Direction Switch Inputs
Analog IN
Microcontroller
Digital or Analog IN
Digital IN
Digital IN
Bus
Transceiver
Motor
Network
Board
2.2
HARDWARE
2.2.1
Inputs
The CW (Clockwise) and CCW (Counterclockwise) inputs from connector J2 (see
Figure 2-3) can be routed either to the microcontroller or directly to the motor relay
drivers as selected by E1 and E2. In this application, the microcontroller has full control
over the motor so the switch inputs are routed to the microcontroller as direction
requests (see Figure 2-5).
The current across the motor is measured by a current-sensing resistor at location
CSR1 on the circuit board.
An auxiliary input signal, such as Ignition or Accessory-On, can be sent through J1-4
(see Figure 2-2). A resistor-capacitor-diode network can be installed in positions R7
through R10. These are component footprint placeholders and accept standard 0805
parts. This input is not used at this time.
2.2.2
Outputs
The two relays are driven by two logic-input MOSFETs. The relays are configured in an
H-bridge arrangement to apply reversible voltage to the controlled motor. These relays
can supply up to 20A of continuous current.
© 2006 Microchip Technology Inc.
DS51604A-page 7
Anti-Pinch Window Lift Control Module User’s Guide
2.2.3
Microcontroller
The microcontroller can be any one of the 14-pin PIC® device family members, but in
this instance, it is a PIC16F688. The PIC16F688 has an Enhanced Addressable
USART that supports the Local Interconnect Network (LIN) and SAE J2602 protocol.
The following table shows the I/O port connections.
TABLE 2-1:
I/O CONNECTIONS
PORT Pin
Function
Notes
Inputs
Not used
ICSP™ Data
RA1
Motor current sense feedback input
ICSP Clock
RA4
Clockwise switch input
RA5
Counterclockwise switch input
RC3
Auxiliary input
RA0
Outputs
RC0
Clockwise motor driver output
RC1
Counterclockwise motor driver output
Network Transceiver Interface
RC2
CS output
RC4
TX output
RC5
RX input
Unused pins
RA2
Not used
RA3
Not used
ICSP MCLR
The microcontroller Flash program and E2 data memory may be programmed through
JP1. This connector is pinout compatible with PICkit 1 and 2 programmers. Microchip’s
MPLAB® ICD 2 may also be used with an appropriately pinned cable (not supplied).
(See “PIC16F688 Data Sheet” (DS-41203), for additional information.)
2.2.4
Network Interface
A MCP201 LIN Bus Transceiver is used for the physical slave bus driver to connect to
a LIN- or J2602-compatible network. A Zener diode protects the LIN bus pin from transient voltages. The capacitor between the LIN bus pin and ground should have its value
adjusted for the particular network topology. A large pull-up resistor on the
FAULT/SLPS pin ensures that a MCP201 device resets to a standard slope control
profile. (See “MCP201 Data Sheet” (DS-21430), for more information.)
DS51604A-page 8
© 2006 Microchip Technology Inc.
Window Lift Control Module Hardware
2.2.5
Power Supply
Power is supplied to the board through a J2 system connector (AMP 770969-1) (see
Figure 2-2). The voltage should be in the range of 8-18 VDC. The voltage regulator is
reverse-battery, transient and load-dump protected.
To reduce power consumption in key-off situations, the ‘power-on’ LED may be
removed.
2.2.6
Connectors
FIGURE 2-2:
J1 MOTOR CONNECTOR
Motor Output 1
1
4
Auxiliary Input
Motor Position Feedback Signal
2
5
VCC
Motor Output 2
3
6
Chassis GND
FIGURE 2-3:
J2 SYSTEM CONNECTOR
CW Switch Input 1
4
Chassis GND
VCC 2
5
LIN BI-Directional BUS
6
+12 VDC VBAT
CCW Switch Input
FIGURE 2-4:
3
JP1 PROGRAMMING CONNECTOR
MCLR 1
VCC 2
VSS 3
ICSPDAT 4
ICSPCLK 5
N/C 6
© 2006 Microchip Technology Inc.
DS51604A-page 9
A
B
C
3
+
+
+
APG
D2
1N4755 43V
4
5
6
5
D1
13
12
11
4
3
2
1
4
Drawn by
Chuck Simmers
Size
A
Shee
Sheet
1 of
Rev
Re
1.0uF
C4
+
RC0/AN4/C2IN+
RC1/AN5/C2INRC2/AN6
RC3/AN7
RC4/C2OUT/TX
RC5/ECCP/RX
1K
240
Window Lift
With Anti-Pinch Feedback
2.2
h
03-01892
LIN Window Lift Controller w/anti-pinch
R5
U1
LED1 Green LED
"ON"
"
R11
PIC16F688
RA0/CIN+/AN0
RA1/CIN-/AN1
RA2/C1OUT/INT/AN2
RA3/MCLR
RA4/OSC2/AN3
RA5/OSC1
Microchip Technology Inc.
Automotive Products Group
AMAD
2355 W. Chandler Blvd.
Chandler, Arizona 85224
C3
10uF
+
GND
LINbus
HCVbat
3
1N4004
1
1
C1
VCC
240
.005uF
R2
TP2
TP1
AMP770969
+
+
+
J2
1
E2
tbd
LVP
ICSPCLK
ICSPDAT
CW0in1
VCC 2
3
R1
6
5
4
3
2
1
Wednesday, February 01, 2006
1
E1
VCC
2
D
CCW0in
JP1
2
4
3
TP3
C5
.01uF
10
9
8
7
6
5
3
1
VCC
100K
R6
CW0
CCW0
2
4
1
8
U2
47K
R3
VCC
47K
MCP201
CS/WAKE
TX
LIN
RX
FAULT/SLPS
GND
5
6
2
.01uF
C2
Q2
NUD3112
Inverted OD
R4
VCC
2
Q1
NUD3112
Position Feedback
3
DS51604A-page 10
VDD
VD
R10
R9
K2
K1
15K
25K
220pF
C6
R8
R7
1N4750 27V
D3
Current Feedback
tbd
tbd
+
+
CSR1
2
1
Shunt Resistor
1
AMP770969
J1
+ + 4
+ + 5 VCC
+ + 6
M1 1
FB 2
M2 3
1
A
B
C
D
FIGURE 2-5:
7
2.3
VBAT
5
Anti-Pinch Window Lift Control Module User’s Guide
SCHEMATICS
SCHEMATIC
© 2006 Microchip Technology Inc.
ANTI-PINCH WINDOW LIFT CONTROL
MODULE USER’S GUIDE
Chapter 3. Window Lift Control Module Software
3.1
INTRODUCTION
The software supplied with this board is used as a basic guideline, or framework, rather
than a production-ready program. The software includes all foundation routines to
begin testing and evaluation, but final refinement and individual optimization is left to
the user.
3.2
SOFTWARE
The set of modules presented in this user’s guide implements the following features:
•
•
•
•
Interrupt driven LIN 2.0 protocol state machine
Error detection and accumulation (error reporting is not addressed).
Motor current-sensing of a stall condition with auto-reverse.
Internal 8 MHz oscillator (auto-baud rate detection for LIN messages).
3.2.1
MODULE OVERVIEW
The code presented in this user’s guide is composed of the following basic modules:
TABLE 3-1:
File
Description
WindowLift20.asm
Main program
UART688i.inc
EAUSART variables and constants
UART688i.asm
LIN protocol handler
ID_table.inc
LIN Identifier information tables
WindowLift20.asm contains a loop that reads the direction requests from the
switches and from slave LIN message frames (see Figure 3-1). Window ‘DOWN’
requests, either from the switch or from a LIN command, are directed to the motor
outputs without qualification. Window ‘UP’ requests are passed to the motor while
monitoring the drawn current. There is an initial in-rush spike when the motor is first
turned ON. This spike is monitored and once the current falls below a pre-determined
threshold, the anti-pinch detection is armed. Any increase in current over the threshold
will cause the motor to reverse for 500 mS and stop. This sequence is repeated as long
as there is a pending ‘DOWN’ request.
Some refinements that could be added to the firmware are:
• Better in-rush spike detection
• Current threshold averaging for motor and transmission aging. This would also
yield closer threshold anti-pinch tolerance.
• Filtering the motor current ripple to measure motor speed and travel
• Express UP/DOWN commands from the switches
• Anti-pinch override (UP button held down)
© 2006 Microchip Technology Inc.
DS51604A-page 11
Anti-Pinch Window Lift Control Module User’s Guide
FIGURE 3-1:
ANTI-PINCH CONTROL FLOWCHART
Main
Initialization
Setup EAUSART
Setup Interrupts
LIN
State Machine
Idle?
Yes
No
ID Correct?
Yes
No
No
Down Command?
No
Up Command?
Yes
Yes
Read Switch
Inputs
Down Switch
Pushed?
Yes
Motor = Down
No
Up
Switched
Pushed?
Yes
Motor = Up
No
No
LIN Command
= 0?
Yes
Stop Motor
Motor Up
Starting?
No
Yes
Inrush
Current
Spike Done?
Yes
Motor
Stalled?
No
Yes
No
Reverse Motor
for 500 ms
Stop Motor
Set Window
Status = Run
DS51604A-page 12
© 2006 Microchip Technology Inc.
Window Lift Control Module Software
3.2.2
LIN Protocol Handler
The LIN Handler routine is outlined in Figure 3-2. This code constitutes a LIN
2.0-compatible slave interface. The status of the state machine is based on the
MESSAGE_COUNTER value and is serial port interrupt driven.
• Break characters are detected and validated for length
• Sync characters are checked to content (0x55) and speed (auto-baud overflow).
The identifier byte is passed through an ID look-up table and checked for validity for
this slave, message length is extracted and whether this message data field is supplied
or to be consumed.
If the Break or Sync characters cause an error, or the identifier is not listed in the table,
the state machine is reset and returns to waiting for a valid Break.
Received data is stored in a buffer and the identifier parity bits and message frame
checksum are checked.
Data to be transmitted is taken from the buffer and the appropriate checksum
generated.
All the state machine activities are handled in the background in an interrupt service
routine. An Idle state machine is signalled by the MESSAGE_COUNTER = 12,
indicating a full/empty data buffer.
Some enhancements that can be easily made to the LIN handler:
• Although an ERROR_BYTE exists to accumulate parity and checksum errors, it is
cleared on every incoming frame. Error counters could be added for additional
error reporting.
• No transmitted data bit testing is done. This could be added at point ‘A’ marked in
the flowchart. Bus errors thus detected can be accumulated and reported in the
ERROR_BYTE.
• Bus time-out and Idle detections using and internal timer/counter.
© 2006 Microchip Technology Inc.
DS51604A-page 13
Anti-Pinch Window Lift Control Module User’s Guide
FIGURE 3-2:
LIN HANDLER FLOWCHART
LIN_HANDLER Entered by either a Receive or a Transmit Interrupt
Receiving
Data?
No
Decrement
MESSAGE_COUNTER
Transmit Next
Data from Buffer
MESSAGE_COUNTER
= 0?
A
Yes
No
Yes
MESSAGE_COUNTER
= 12
MESSAGE_COUNTER
= 12?
Yes
Yes
Yes
MESSAGE_COUNTER
= 10
Setup Auto-Baud
module
Sync character
OK?
Update Baud Rate
Generator
No
No
MESSAGE_COUNTER
= 10?
MESSAGE_COUNTER
= 11
No
No
MESSAGE_COUNTER
= 11?
Yes
Break character
OK?
MESSAGE_COUNTER
= 12
Yes
ID Byte Ok?
No
MESSAGE_COUNTER
= 12
Yes
Calculate ID
Parity Bits
Yes
Setup Data
Buffer
Yes
No
MESSAGE_COUNTER
= number of data bytes
Transmit Data?
Calculate
Checksum
Transmit First
Data Byte
No
Receive
Data?
Clear
ERROR_BYTE
No
1 <=
Yes
MESSAGE_COUNTER
<= 9?
Put Data Into
Receive Buffer
Decrement
MESSAGE_COUNTER
No
Put Checksum
Byte Into Buffer
ID Parity Bits
OK?
No
Set ID
ERROR Bit
DS51604A-page 14
Yes
Checksum
OK?
Yes
MESSAGE_COUNTER
= 12
No
Set Checksum
ERROR Bit
Return
© 2006 Microchip Technology Inc.
Window Lift Control Module Software
3.2.3
LIN Description File Information
Example 3-1 is an excerpt of a LDF file defining this module.
Note:
The ID = 5, DOWN = databyte1 - bit 0, UP = databyte1 - bit 1, and the
remaining bits of databyte1 and all of databyte2 are not used.
EXAMPLE 3-1:
LDF FILE EXAMPLE
LIN_description_file;
LIN_protocol_version = “2.00”;
LIN_language_version = “2.00”;
LIN_speed = 10.40 kbps;
Nodes
Master: Master, 10 ms, 0.10 ms;
Slaves: Slavel;
Signals
UP: 1, 0, Master, Slavel;
DOWN: 1, 0, Master, Slavel;
Frames
Window: 5, Master, 2
DOWN, 0;
UP,
1;
Node_attributes
Slavel
LIN_protocol = “2.0”;
configured_NAD = 127;
product_id = 32767, 65535, 0;
P2_min = 0 ms;
ST_min = 0 ms;
© 2006 Microchip Technology Inc.
DS51604A-page 15
WORLDWIDE SALES AND SERVICE
AMERICAS
ASIA/PACIFIC
ASIA/PACIFIC
EUROPE
Corporate Office
2355 West Chandler Blvd.
Chandler, AZ 85224-6199
Tel: 480-792-7200
Fax: 480-792-7277
Technical Support:
http://support.microchip.com
Web Address:
www.microchip.com
Australia - Sydney
Tel: 61-2-9868-6733
Fax: 61-2-9868-6755
India - Bangalore
Tel: 91-80-4182-8400
Fax: 91-80-4182-8422
China - Beijing
Tel: 86-10-8528-2100
Fax: 86-10-8528-2104
India - New Delhi
Tel: 91-11-5160-8631
Fax: 91-11-5160-8632
Austria - Wels
Tel: 43-7242-2244-399
Fax: 43-7242-2244-393
Denmark - Copenhagen
Tel: 45-4450-2828
Fax: 45-4485-2829
China - Chengdu
Tel: 86-28-8676-6200
Fax: 86-28-8676-6599
India - Pune
Tel: 91-20-2566-1512
Fax: 91-20-2566-1513
France - Paris
Tel: 33-1-69-53-63-20
Fax: 33-1-69-30-90-79
China - Fuzhou
Tel: 86-591-8750-3506
Fax: 86-591-8750-3521
Japan - Yokohama
Tel: 81-45-471- 6166
Fax: 81-45-471-6122
Germany - Munich
Tel: 49-89-627-144-0
Fax: 49-89-627-144-44
China - Hong Kong SAR
Tel: 852-2401-1200
Fax: 852-2401-3431
Korea - Gumi
Tel: 82-54-473-4301
Fax: 82-54-473-4302
China - Qingdao
Tel: 86-532-8502-7355
Fax: 86-532-8502-7205
Korea - Seoul
Tel: 82-2-554-7200
Fax: 82-2-558-5932 or
82-2-558-5934
Atlanta
Alpharetta, GA
Tel: 770-640-0034
Fax: 770-640-0307
Boston
Westborough, MA
Tel: 774-760-0087
Fax: 774-760-0088
Chicago
Itasca, IL
Tel: 630-285-0071
Fax: 630-285-0075
Dallas
Addison, TX
Tel: 972-818-7423
Fax: 972-818-2924
Detroit
Farmington Hills, MI
Tel: 248-538-2250
Fax: 248-538-2260
Kokomo
Kokomo, IN
Tel: 765-864-8360
Fax: 765-864-8387
Los Angeles
Mission Viejo, CA
Tel: 949-462-9523
Fax: 949-462-9608
San Jose
Mountain View, CA
Tel: 650-215-1444
Fax: 650-961-0286
China - Shanghai
Tel: 86-21-5407-5533
Fax: 86-21-5407-5066
China - Shenyang
Tel: 86-24-2334-2829
Fax: 86-24-2334-2393
China - Shenzhen
Tel: 86-755-8203-2660
Fax: 86-755-8203-1760
China - Shunde
Tel: 86-757-2839-5507
Fax: 86-757-2839-5571
China - Wuhan
Tel: 86-27-5980-5300
Fax: 86-27-5980-5118
China - Xian
Tel: 86-29-8833-7250
Fax: 86-29-8833-7256
Malaysia - Penang
Tel: 60-4-646-8870
Fax: 60-4-646-5086
Philippines - Manila
Tel: 63-2-634-9065
Fax: 63-2-634-9069
Italy - Milan
Tel: 39-0331-742611
Fax: 39-0331-466781
Netherlands - Drunen
Tel: 31-416-690399
Fax: 31-416-690340
Spain - Madrid
Tel: 34-91-708-08-90
Fax: 34-91-708-08-91
UK - Wokingham
Tel: 44-118-921-5869
Fax: 44-118-921-5820
Singapore
Tel: 65-6334-8870
Fax: 65-6334-8850
Taiwan - Hsin Chu
Tel: 886-3-572-9526
Fax: 886-3-572-6459
Taiwan - Kaohsiung
Tel: 886-7-536-4818
Fax: 886-7-536-4803
Taiwan - Taipei
Tel: 886-2-2500-6610
Fax: 886-2-2508-0102
Thailand - Bangkok
Tel: 66-2-694-1351
Fax: 66-2-694-1350
Toronto
Mississauga, Ontario,
Canada
Tel: 905-673-0699
Fax: 905-673-6509
02/16/06
DS51604A-page 16
© 2006 Microchip Technology Inc.
Similar pages