22
September 2013 Rev 2 1/22 AN2334 Application Note Complete car door module Introduction A car door module typically consists of a rubber-sealed carrier, onto which a variety of door components such as the window lift mechanism, the wing mirror electric motor, the wiring harness, the loud speaker, the door latch inner release cable, locks and various switches are fitted, forming a “cassette”. The trend in both Europe and the U.S. is to increase the complexity of the door module by adding more electronic features needed to drive all door loads and functions, with the possibility to connect the module to other car subsystems via standard automotive communication protocols (LIN, CAN). Among many of these automotive subsystems, the connectivity via a single wire, decentralizing electronic modules, reduces the number of wires required and in turn reduces wiring harness weight, contributes significantly to overall vehicle weight reduction. This is of concern to auto manufacturers, who are constantly striving to reduce vehicle weight and to improve fuel efficiency. In this document, an electronic module is presented that controls all the car door functions, including the window lift, all latching/locking operations, wing mirror movement, mirror turn indicator light, defroster and some lamps. To reduce the risk of bodily injury, especially to children, this module also includes an advanced trapping detection feature for the window lift motor, which stops the window if a body member such as a finger, a hand or an arm is introduced into the window climbing area during the window climbing process. A low-cost, high performance, antipinch algorithm based on monitoring the window motor driver current, has been developed. www.st.com

AN2334 Application Note - Home - STMicroelectronics 2013 Rev 2 1/22 AN2334 Application Note Complete car door module Introduction A car door module typically consists of a rubber-sealed

  • Upload
    vulien

  • View
    213

  • Download
    1

Embed Size (px)

Citation preview

Page 1: AN2334 Application Note - Home - STMicroelectronics 2013 Rev 2 1/22 AN2334 Application Note Complete car door module Introduction A car door module typically consists of a rubber-sealed

September 2013 Rev 2 1/22

AN2334Application Note

Complete car door module

IntroductionA car door module typically consists of a rubber-sealed carrier, onto which a variety of door components such as the window lift mechanism, the wing mirror electric motor, the wiring harness, the loud speaker, the door latch inner release cable, locks and various switches are fitted, forming a “cassette”.

The trend in both Europe and the U.S. is to increase the complexity of the door module by adding more electronic features needed to drive all door loads and functions, with the possibility to connect the module to other car subsystems via standard automotive communication protocols (LIN, CAN).

Among many of these automotive subsystems, the connectivity via a single wire, decentralizing electronic modules, reduces the number of wires required and in turn reduces wiring harness weight, contributes significantly to overall vehicle weight reduction. This is of concern to auto manufacturers, who are constantly striving to reduce vehicle weight and to improve fuel efficiency.

In this document, an electronic module is presented that controls all the car door functions, including the window lift, all latching/locking operations, wing mirror movement, mirror turn indicator light, defroster and some lamps. To reduce the risk of bodily injury, especially to children, this module also includes an advanced trapping detection feature for the window lift motor, which stops the window if a body member such as a finger, a hand or an arm is introduced into the window climbing area during the window climbing process. A low-cost, high performance, antipinch algorithm based on monitoring the window motor driver current, has been developed.

www.st.com

Page 2: AN2334 Application Note - Home - STMicroelectronics 2013 Rev 2 1/22 AN2334 Application Note Complete car door module Introduction A car door module typically consists of a rubber-sealed

Contents AN2334

2/22

Contents

1 Car door module description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2 Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

3 Local Interconnect Network (LIN) messages . . . . . . . . . . . . . . . . . . . . 10

4 PC Keypad software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

5 Hardware implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

Appendix A Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

Page 3: AN2334 Application Note - Home - STMicroelectronics 2013 Rev 2 1/22 AN2334 Application Note Complete car door module Introduction A car door module typically consists of a rubber-sealed

AN2334 List of tables

3/22

List of tables

Table 1. Door module actuators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5Table 2. Application Messages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Table 3. FR RL RR data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Table 4. Front Right Door . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Table 5. PC-VNH2 Diag. data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Table 6. Dashboard data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Table 7. PC - L9950 Diag. data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Table 8. Window and door lock coding. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14Table 9. Mirror and door lock coding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15Table 10. L9950 Loads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19Table 11. Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

Page 4: AN2334 Application Note - Home - STMicroelectronics 2013 Rev 2 1/22 AN2334 Application Note Complete car door module Introduction A car door module typically consists of a rubber-sealed

List of figures AN2334

4/22

List of figures

Figure 1. Door module block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5Figure 2. VNH2 PWM signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8Figure 3. Simplified algorithm flowcharts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Figure 4. Master/slave diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10Figure 5. LIN bus message frame format diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Figure 6. PC keypad screenshot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16Figure 7. Adjust thresholds screenshot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17Figure 8. Board connectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18Figure 9. Board Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19Figure 10. Board Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

Page 5: AN2334 Application Note - Home - STMicroelectronics 2013 Rev 2 1/22 AN2334 Application Note Complete car door module Introduction A car door module typically consists of a rubber-sealed

AN2334 Car door module description

5/22

1 Car door module description

This note describes a complete electronic module used to drive all loads in a car door, connected via a LIN bus to the dashboard and to other doors, and via a parallel port to a PC (for demonstration purposes). The block diagram in Figure 1 shows the system configuration.

Figure 1. Door module block diagram

Table 1. Door module actuators

Actuators PnomWorking voltage

Load speed (Typ)

Load current

(Typ)

Stall current

Window Lift 1 DC motor

12 V

>78 rpm <2.5A <20A

Door lock 1 DC motor

<2A <10AMirror axis control

2 DC motors

Mirror fold 1 DC motor

Mirror defroster 1 grounded resistive load

100W

Light bulbs4 grounded resistive loads

5W

Page 6: AN2334 Application Note - Home - STMicroelectronics 2013 Rev 2 1/22 AN2334 Application Note Complete car door module Introduction A car door module typically consists of a rubber-sealed

Car door module description AN2334

6/22

The microcontroller is the ST72F561, a member of the ST7 microcontroller family, designed for mid-range applications with CAN (Controller Area Network) and LIN (Local Interconnect Network) interfaces. It is based on an industry standard 8-bit core, featuring an enhanced instruction set. The enhanced instruction set and addressing modes of the ST7 offer both power and flexibility to software developers, enabling the design of highly efficient and compact application codes. In addition to standard 8-bit data management, all ST7 microcontrollers feature true bit manipulation, 8x8 unsigned multiplication and indirect addressing modes.

The voltage regulator is the L4979 which offers high precision output voltage and a programmable watchdog timer with an external capacitor. The programmable watchdog timer allows microcontroller auto-recovery from software runaway failures.

The L9638 performs LIN-bus interface functions between the protocol handler in the microcontroller and the physical bus in automotive applications. It has a Sleep mode that allows the lowest current consumption of the transceiver. It is possible to wake up the transceiver through LIN-bus, Enable input or Wake-up input.

The new VNH2SP30 window power bridge driver provides a smooth and fully-protected motor drive via 20 kHz PWM. A current sense (CS) output is used to monitor motor torque that provides an antitrap function via the ADC inputs of the microcontroller.

Finally, the L9950 actuator driver controls mirror adjustment and fold-in/-out, as well as an advanced locking system, driving the door latch and the dead bolt motor. Five intrinsic high-side drivers are available to control various lamps or LEDs, including the mirror defroster, and sophisticated diagnostic algorithms allow digital and analog load status to be monitored by reading fold, lock motors and defroster currents.

Page 7: AN2334 Application Note - Home - STMicroelectronics 2013 Rev 2 1/22 AN2334 Application Note Complete car door module Introduction A car door module typically consists of a rubber-sealed

AN2334 Algorithms

7/22

2 Algorithms

After turn on or resetting, the microcontroller initializes all used peripherals (I/Os, Timers, ADC and LIN-SCI) and variables, drives the L9950 to open the left wing-mirror and sends a LIN message to do the same for the right wing-mirror. Afterward, it starts an infinite loop that can be stopped only by resetting or turning off the board.

The microcontroller starts polling on both key pins (for driving window lift) and the keypad.

As soon as a load is turned on, the L9950 Enable Bit is set to switch the device into active mode, turning on the Charge Pump Output. This output drives the gate of an external n-channel power MOS used for reverse polarity protection. This action, guaranteeing the reverse battery protection, needs about 300µs, which is the activation delay for every load.

When no load is driven, the Enable Bit is cleared and the device goes into standby mode for power saving.

It is possible to drive the window lift by using both the PC keypad and board keys (#4 / #5 - Figure 9). The "Up key" and "Down key" pins are configured in the input pull-up mode, so they are normally at a high value (5V); if the UP or DOWN buttons are pressed, two different behaviors are shown, depending on the duration of the pressing time. If the button is pressed for less than 100 ms, the glass moves up or down (depending on the key pressed) until the top or bottom part of the window is reached; if the pressed time exceeds 100 ms, the window moves up or down following the touch temporization. The same behavior occurs when a PC software keypad is used.

The "Window Up switch" pin (#9 - Figure 9), also configured in input pull-up mode, must be connected using a mechanical switch that senses the window end run, indicating that the door upper limit has been reached.

The PWM 8-bit Autoreload Timer is used to perform a task temporized at 1 ms.

This task is in charge of all temporized events:

– It counts 250 ms before sending a LIN request message to the dashboard

– In case of window lift activation, it manages current sampling

– It also controls the mirror folding, locking and turn indicator light on and off switching timings

When either the Down or Up key (both in the board or on the PC keypad) are pressed, the Window_Lift routine is called:

– VNH2 InA and InB pins are, then, set or reset, depending on the key pressed, to lift the window up or down and,

– the 16-bit Timer is used to provide to the VNH2 a PWM signal with 20 kHz frequency and 30% duty cycle

– during a 1 ms task, the current sense voltage is acquired via ST7 ADC; the acquisition is averaged over a 10 ms period to eliminate noise. Motor power is calculated by multiplying the current sense by the estimated angular velocity. This value is averaged over 100 ms, providing a delayed signal compared to the original. The difference between power and averaged power must be compared with a threshold to determine whether a pinch event occurs. This threshold depends on the motor status (soft start up or steady state conditions).

Unless a Down/Up key is pressed or a pinch occurs, the duty cycle increases linearly until 100% is reached and the PWM becomes a constant (steady state phase, see Figure 2.)

Page 8: AN2334 Application Note - Home - STMicroelectronics 2013 Rev 2 1/22 AN2334 Application Note Complete car door module Introduction A car door module typically consists of a rubber-sealed

Algorithms AN2334

8/22

Figure 2. VNH2 PWM signal

At this point the system waits for any event: A pressed key or a pinch.

If a key is pressed, the motor is stops, resetting VNH2 PWM and setting InA and InB for braking to Vbatt the motor and stopping the glass.

In case of a pinch event, the Window Up switch is first checked. If this switch is closed (upper limit reached), the glass is locked driving the motor up for 800 ms.

Otherwise, if the glass moves up, it is driven down for 800 ms to release the pinched object; if it goes down the motor is stopped immediately.

When an abnormal condition is detected (Open Load, Short circuit or thermal shutdown), a LIN message is sent to the PC VNH2 diagnostic node. Open Load is detected by current sense voltage monitoring (value) while a short circuit and thermal shutdown are detected using the VNH2 DIAGx pin. When DIAGx pin is reset, while INx is set, the status pin indicates a thermal shutdown; otherwise, if INx is reset the status pin detects a short circuit.

For further information about antipinch algorithms, please refer to “AN2095 - VNH2 for window lift with antipinch routine”.

When a command for L9950 loads is detected through keypad input pins, the microcontroller drives such loads through the L9950 SPI bus. Serial data for controlling outputs and for receiving status registers is sent via this bus.

For example, if one of the over-current bits is set, the corresponding driver is disabled. If the over-current recovery bit of the output is not set, the microcontroller must clear the over-current bit to enable the driver again.

If the thermal shutdown bit is set, all drivers go to high impedance state. Again, the microcontroller must clear the bit to enable the drivers.

When the Fold Mirror motor is activated, the relevant motor is driven for 4 seconds with a fully charged battery and for 6 seconds in other cases. Since the OUT1 is common to all mirror motors, it is impossible to drive two or more mirror motors at the same time.

The turn indicator and the defroster are driven using PWM2 and PWM1 respectively.

For all lights, the over-current Recovery Enable bit is set by the microcontroller; this automatically reactivates the output after a delay time, resulting in a PWM modulated current with a programmable duty cycle.

The over-current recovery feature is intended for loads which have an initial current higher than the over-current limit of the output (for example, cold light bulbs).

The described algorithm, including LIN message managing, is stored in less than 10 kB on the microcontroller Flash memory.

tSoft Start

5VPWM

DutyCycle30%

DutyCycle50%

DutyCycle70%

DutyCycle100%

Page 9: AN2334 Application Note - Home - STMicroelectronics 2013 Rev 2 1/22 AN2334 Application Note Complete car door module Introduction A car door module typically consists of a rubber-sealed

AN2334 Algorithms

9/22

Figure 3. Simplified algorithm flowcharts

NO

Reset

Init

Ext. WDG reload

Paral. Port and keys read

Load turn ON/OFF

Diagnostic

Send LIN Msg to PC

NO

Key or keypad Pushed

NO

Reset

Init

Ext. WDG reload

Paral. Port and keys read

Load turn ON/OFF

Diagnostic

Send LIN Msg to PC

NO

Key or keypad Pushed VNH2 L9950

SPI send MSGWindow Lift Routine

Load Turn ON/OFF

Turn On Charge Pump

VNH2 or L9950

LOAD ?VNH2 L9950

SPI send MSGWindow Lift Routine

Load Turn ON/OFF

Turn On Charge Pump

VNH2 or L9950

LOAD ?

250 ms Task

LIN Msg Request to Dashboard

Receive Data

Defroster ON

SPI send Msg

Turn Light ON

YESNO

SPI send Msg

YES

NO

PWM1 On

PWM2 On

250 ms Task

LIN Msg Request to Dashboard

Receive Data

Defroster ON

SPI send Msg

Turn Light ON

YESNO

SPI send Msg

YES

NO

PWM1 On

PWM2 On

Page 10: AN2334 Application Note - Home - STMicroelectronics 2013 Rev 2 1/22 AN2334 Application Note Complete car door module Introduction A car door module typically consists of a rubber-sealed

Local Interconnect Network (LIN) messages AN2334

10/22

3 Local Interconnect Network (LIN) messages

Created by the LIN Consortium (a collection of automotive, software and semiconductor manufacturers), LIN is a low speed bus with a maximum speed of 20kbaud. The most significant advantage offered by LIN bus is the low cost of implementation. Implementing a LIN node costs approximately half of an equivalent CAN bus node.

The LIN bus protocol is based on the common UART byte interface. Any microcontroller with a UART interface can be used as a node on the LIN bus since the basic transmission uses the UART format. The LIN bus protocol specification 1.2 defines three standard baud rates: 2400 baud, 9600 baud and 19200 baud. Communication is based on a master/slave mechanism.

The bus is composed of one master node (Driver door) and five slave nodes (All Doors, Front Right Door, Dashboard, PC VNH2 Diagnostic and PC UH22/L9950 Diagnostic). All arbitration and collision management takes place in the master node to further simplify and lower the cost of the slave nodes.

Figure 4. Master/slave diagram

– All Doors is used for locking/unlocking all doors

– Front Right Door is the slave node in the front right door that receives all messages for mirror positioning (X-Y and fold) and for front right window lift

– Dashboard is questioned from the master node each 250 ms in order to give information for turning on/off turn indicator and defroster

– PC-VNH2 is used for demonstration purposes to send VNH2 diagnostic information to PC

– PC-UH22/L9950 is also used for demonstration purposes to send L9950 diagnostic information to PC

All communications on the bus take the form of messages, which have a defined format known as the message frame. A diagram showing the format of the message is shown in Figure 5. The message frame is composed of a header and a response. The header is further broken down into three fields:

– The synchronization break field, composed of 13 dominant bits (0) and at least one recessive bit (1), which indicates the beginning of a frame.

– The synchronization field, which allows a slave to be synchronized on the current master baud rate.

– The identifier field, which identifies the requested message and the length of the response field.

MASTERDriver Door

SLAVEAll Doors

SLAVEFront Right Door

SLAVEDashboard

SLAVEPC-VNH2 Diag

SLAVEPC-UH22/L9950 Diag

LIN Bus

CAN Bus

Page 11: AN2334 Application Note - Home - STMicroelectronics 2013 Rev 2 1/22 AN2334 Application Note Complete car door module Introduction A car door module typically consists of a rubber-sealed

AN2334 Local Interconnect Network (LIN) messages

11/22

Figure 5. LIN bus message frame format diagram

Only the master node can initiate a message by sending a header field that is received by all nodes. Each slave node analyses the header and must be ready to send or receive data during the response field of the frame. The identifier field within the header informs all slave nodes in the network of the appropriate action to take. Such actions include:

– Receiving bytes transmitted in the response field

– Transmitting bytes in the response field

– Doing nothing

ST72F561 has a flexible microcontroller architecture that makes the implementation of LIN bus communication much easier than on other devices.

The LIN bus transmission of a master node, as this demoboard, has three distinct phases:

– Synchronization break field transmission: The length of this field is 13 dominant bits and 1 recessive bit

– Data byte transmission: The synchronization field, the identifier field, the data fields and the checksum field are each one byte fields.

– Data byte reception: The data fields and the checksum field are also transmitted in a byte wise manner.

The LIN bus protocol uses a standard baud rate: 19200 baud. In case of microcontroller debugging, when CPU frequency is divided by two, a 9600 baud protocol is also possible. The software PC allows users to change the baud rate.

It is necessary to define a specific ID (6 bits long) for each message, which is used for reception or transmission. The message ID is written in a hexadecimal format with the parity bits included. According to the LIN specification, the data field can be 1 to 8 bytes long (for LIN 1.2 and newer).

The parity bits P0 and P1 are calculated as follows:

P0=ID0 ID1 ID2 ID4

P0=ID1 ID3 ID4 ID5

Because the application is for demonstration purposes, it uses two LIN messages for transmission with PC (2 bytes long for VNH2 diagnostic and 8 bytes long for L9950 diagnostic).

Page 12: AN2334 Application Note - Home - STMicroelectronics 2013 Rev 2 1/22 AN2334 Application Note Complete car door module Introduction A car door module typically consists of a rubber-sealed

Local Interconnect Network (LIN) messages AN2334

12/22

Table 2. Application Messages

Message IDSlave

response source

Slave response destination

N.transmit [bytes]

Message Data

Description

LinMsg1 (0xc1)

Driver Door (M)FR RL RR Doors (S)

2 See Table 3Master transmit doors lock / unlock command

LinMsg2 (0x42)

Driver Door (M)Front Right

Door (S)2 See Table 4

Master transmit FR Door commands

LinMsg4 (0x73)

Driver Door (M)PC-L9950Diag (S)

8 See Table 7 Master transmit diagnostic signals

LinMsg3 (0xC4)

Driver Door (M)PC-VNH2Diag (S)

2 See Table 5Master transmit RL Door commands

LinMsg5 (0x11)

Dashboard (S) Driver Door (M) 2 See Table 6 Master data request

Table 3. FR RL RR data

Description Data Value

Unlock Doors 0x01

Lock Doors 0x02

Table 4. Front Right Door

Description Data Value

Front Right Mirror Dx 0x01

Front Right Mirror Sx 0x02

Front Right Mirror Up 0x03

Front Right Mirror Down 0x04

Front Right Mirror Close 0x05

Front Right Mirror open 0x06

Front Right Window Up 0x07

Front Right Window Down 0x08

Table 5. PC-VNH2 Diag. data

Description Data Value

No diag err 0x01

Therm. Shutdown Leg A 0x27

Therm. Shutdown Leg B 0x28

Short Circ. Leg A 0x29

Short Circ. Leg B 0x2A

Open Load 0x2B

Page 13: AN2334 Application Note - Home - STMicroelectronics 2013 Rev 2 1/22 AN2334 Application Note Complete car door module Introduction A car door module typically consists of a rubber-sealed

AN2334 Local Interconnect Network (LIN) messages

13/22

Table 6. Dashboard data

Description Data Value

No action 0x01

Defroster turn on 0x02

Turn light turn on 0x03

Defroster and Turn light turn on 0x04

Table 7. PC - L9950 Diag. data

Data0 Data1 Data2 Data3 Data4

Bit Description Bit Description Bit Description Bit Description Bit Description

0VS Over Voltage

0Out 2 HS

Over Current0

Out 6 HS

Over Current0

Out 2 LS

Open Load0

Out 6 LS

Open Load

1VS Under Voltage

1Out 3 LS

Over Current1

Out 7 HS

Over Current1

Out 2 HS

Open Load1

Out 6 HS

Open Load

2Thermal Shutdown

2Out 3 HSOver Current

2Out 8 HSOver Current

2Out 3 LSOpen Load

2Out 7 HSOpen Load

3Temperature Warning

3Out 4 LSOver Current

3Out 9 HSOver Current

3Out 3 HSOpen Load

3Out 8 HSOpen Load

4 N.U. 4Out 4 HSOver Current

4Out 10 HSOver Current

4Out 4 LSOpen Load

4Out 9 HSOpen Load

5Out 1 LSOver Current

5Out 5 LSOver Current

5Out 11 HSOver Current

5Out 4 HSOpen Load

5Out 10 HSOpen Load

6Out 1 HSOver Current

6Out 5 HSOver Current

6Out 1 LS Open Load

6Out 5 LSOpen Load

6Out 11 HSOpen Load

7Out 2 LSOver Current

7Out 6 LSOver Current

7Out 1 HS Open Load

7Out 5 HSOpen Load

7 N.U.

Page 14: AN2334 Application Note - Home - STMicroelectronics 2013 Rev 2 1/22 AN2334 Application Note Complete car door module Introduction A car door module typically consists of a rubber-sealed

PC Keypad software AN2334

14/22

4 PC Keypad software

Before switching on the board, the PC “Keypad” software must be run, defining the parallel port base address (see Windows Device Manager) and the COM serial port to be used.

PC software has four different functions: Keyboard, dashboard, LIN analyzer, VNH2 and L9950 diagnostic view.

– Keyboard is connected to the microcontroller via a parallel port and provides to the microcontroller an 8-bit word that encodes all possible user actions as described in the following Table 8 and Table 9:

Table 8. Window and door lock coding

Window DoorParallel Port

Up Left Down Left Up Right Down Right Lock / Unlock

0 0 0 0 0 192

0 0 0 1 0 194

0 1 0 1 0 202

0 1 0 0 0 200

0 0 1 0 0 196

1 0 1 0 0 212

1 0 0 0 0 208

0 0 0 0 1 193

0 0 0 1 1 195

0 1 0 1 1 203

0 1 0 0 1 201

0 0 1 0 1 197

1 0 1 0 1 213

1 0 0 0 1 209

Page 15: AN2334 Application Note - Home - STMicroelectronics 2013 Rev 2 1/22 AN2334 Application Note Complete car door module Introduction A car door module typically consists of a rubber-sealed

AN2334 PC Keypad software

15/22

– Dashboard is a LIN slave node and is used to switch on or off the turn indicator light and the defroster.

– LIN Analyzer “sniffs” all LIN messages that flow through bus.

– VNH2 and L9950 diagnostic graphically shows the LIN messages addressing VNH2 and L9950 diagnostic nodes.

Figure 6 displays the program main window snapshot.

Table 9. Mirror and door lock coding

Mirror Door

Parallel PortOpen Close

Left / Right

Up Down Left RightLock / Unlock

0 0 0 0 0 0 0 0 0

1 0 0 0 0 0 0 0 128

0 1 0 0 0 0 0 0 64

1 0 1 0 0 0 0 0 160

0 1 1 0 0 0 0 0 96

0 0 0 1 0 0 0 0 16

0 0 0 0 1 0 0 0 8

0 0 0 0 0 1 0 0 4

0 0 0 0 0 0 1 0 2

0 0 1 1 0 0 0 0 48

0 0 1 0 1 0 0 0 40

0 0 1 0 0 1 0 0 36

0 0 1 0 0 0 1 0 34

0 0 0 0 0 0 0 1 1

1 0 0 0 0 0 0 1 129

0 1 0 0 0 0 0 1 65

1 0 1 0 0 0 0 1 161

0 1 1 0 0 0 0 1 97

0 0 0 1 0 0 0 1 17

0 0 0 0 1 0 0 1 9

0 0 0 0 0 1 0 1 5

0 0 0 0 0 0 1 1 3

0 0 1 1 0 0 0 1 49

0 0 1 0 1 0 0 1 41

0 0 1 0 0 1 0 1 37

0 0 1 0 0 0 1 1 35

Page 16: AN2334 Application Note - Home - STMicroelectronics 2013 Rev 2 1/22 AN2334 Application Note Complete car door module Introduction A car door module typically consists of a rubber-sealed

PC Keypad software AN2334

16/22

Figure 6. PC keypad screenshot

Keyboard

Dashboard

LIN analyzer

VNH2 and L9950 diagnostics

Keyboard

Dashboard

LIN analyzer

VNH2 and L9950 diagnostics

Page 17: AN2334 Application Note - Home - STMicroelectronics 2013 Rev 2 1/22 AN2334 Application Note Complete car door module Introduction A car door module typically consists of a rubber-sealed

AN2334 PC Keypad software

17/22

PC software can also change the thresholds for the window lift routine. Any threshold change modifies the motor torque in a pinch state. For further details, please refer to “AN2095 - VNH2 for window lift with antipinch routine”.

Figure 7. Adjust thresholds screenshot

Page 18: AN2334 Application Note - Home - STMicroelectronics 2013 Rev 2 1/22 AN2334 Application Note Complete car door module Introduction A car door module typically consists of a rubber-sealed

Hardware implementation AN2334

18/22

5 Hardware implementation

The voltage regulator, which provides the required 5V during normal mode, is enabled by the LIN transceiver through Inhibit Output pin INH. To reset the microcontroller with the watchdog timer in case of a missing pulse, a jumper must be installed in the Voltage Regulator Reset connector (#1 - Figure 8).

The jumper must be removed in case of microcontroller reprogramming; in fact, in this phase, the microcontroller cannot provide pulses to the voltage regulator that should provide a low level reset. Moreover, during the programming phase, to enable the Voltage regulator a jumper must be installed in the Voltage Regulator Enable connector (#2 - Figure 8) because in this case the LIN bus interface L9638 cannot provide the enabling voltage.

In summary, the microcontroller can be reprogrammed using the ICP connector (#10 - Figure 8) by removing the Reset jumper (#1 - Figure 8) and settling the Enable jumper (#2 - Figure 8). See the ST72F561 datasheet for more details.

A jumper on CB4 connector (#8 - Figure 8) allows using the board without using the LIN Interface as detailed in Section 3: Local Interconnect Network (LIN) messages.

The board connector locations are given in Figure 8.

Figure 8. Board connectors

1

1 Reset

2 Enable

3 L9950 Outputs 4 Down Key 5 Up Key 6 - CB5 / 7 – CB3 / 8 - CB4

9 - Window Up Switch

10 ICP Conn

11 Window Motor

16 LIN Conn.

15 Wake Up

2

3

4

5

6

7

8

9

10

12 Power Supply

13 L9950 Outputs 14 Parallel

Port11

12 14

13 15

16

1

1 Reset

2 Enable

3 L9950 Outputs 4 Down Key 5 Up Key 6 - CB5 / 7 – CB3 / 8 - CB4

9 - Window Up Switch

10 ICP Conn

11 Window Motor

16 LIN Conn.

15 Wake Up

2

3

4

5

6

7

8

9

10

12 Power Supply

13 L9950 Outputs 14 Parallel

Port11

12 14

13 15

16

Page 19: AN2334 Application Note - Home - STMicroelectronics 2013 Rev 2 1/22 AN2334 Application Note Complete car door module Introduction A car door module typically consists of a rubber-sealed

AN2334 Hardware implementation

19/22

The L9950 loads are shown in the following table:

The input signals INA and INB are directly interfaced with the microcontroller to select the motor direction and the brake condition. The DIAGA/ENA or DIAGB/ENB, connected to the I/O microcontroller and configured as input pull-up, enable the legs of the bridge. They also provide a digital diagnostic signal. The CS pin allows monitoring the motor current by delivering a current proportional to its value. The PWM, up to 20 KHz, allows control of the motor speed in all possible conditions.

The reverse polarity protection MOSFET needs a zener diode and a resistor between gate and source to protect against ISO pulses and for proper turn off in static reverse polarity.

In master node application, a LOW ohmic resistor must be connected externally between LIN and battery to allow the maximum transmission rate.

Finally, all outputs need a 10nF capacitor to protect the module against 8 kV ESD events.

Figure 9. Board Layout

Table 10. L9950 Loads

L9950 Outputs Load

OUT1 Common Mirror Motors

OUT2 X Mirror Motor

OUT3 Y Mirror Motor

OUT4 Lock Motor

OUT5 Lock Motor

OUT6 Mirror Fold Motor

OUT7 Exterior Light

OUT8 Footstep Light

OUT9 Safety Light

OUT10 Turn Indicator

OUT11 Defroster

+12

Gnd

Gnd

Out

7

Out

8

Out

9

Out

10

Out

11

Parallel Port Connector

Out

1

Ou

t6

Ou

t5

Ou

t3

Out

4

Ou

t3

Out

2

Out

1

Gnd

+12

Lin

ICP Connector

Window A

Window B

Up

Down

Wake Up

Reset

Enable

+12

Gnd

Gnd

Out

7

Out

8

Out

9

Out

10

Out

11

Parallel Port Connector

Out

1

Ou

t6

Ou

t5

Ou

t3

Out

4

Ou

t3

Out

2

Out

1

Gnd

+12

Lin

ICP Connector

Window A

Window B

Up

Down

Wake Up

Reset

Enable

Page 20: AN2334 Application Note - Home - STMicroelectronics 2013 Rev 2 1/22 AN2334 Application Note Complete car door module Introduction A car door module typically consists of a rubber-sealed

Schematic AN2334

20/22

Appendix A Schematic

Figure 10. Board Schematic

XT1

16 M

Hz

C21

1nF

C24 10

nF

C23

100u

F

+5V

C310

nF

C2 18pF

C1 18pF

R1 4.7kR2 10

k

R17

10K

R18

10K

R19

10K

R20

2.7K

R21

2.7K

VBA

T

R16

10 K

+5V

J5

MO

TOR

DC

J8

BATT

ERY

ICCC

LOC

K

VBA

T

PWM

7

CSen

s9

VCC

4

VCC

12

VCC

13

VCC

3

VCC

23

Out

A25

Out

B14

GN

DA

29

GN

DB

17

VCC

22

VCC

24

IN A

5

IN B

11

PWM

8

Dia

gA/E

nA6

Dia

gB/E

nB10

GN

DA

28

GN

DA

27

GN

DA

26

GN

DB

20

GN

DB

19

GN

DB

18

Out

A1

Out

A2

Out

A30

Out

B15

Out

B16

Out

B21

VNH

2SP3

0

Mul

ti Po

wer

SO

30

R22

2.2K

C510

0uF

R8 47K

+5V

Vpp/

ICCS

EL

VBA

T

ICCD

ATA

Ext W

dg

RESE

T

C22

47nF

J1

R30

10K

RESE

T

Ext W

dgVdd

PWM

1Sp

iClo

ck

Mas

ter i

n-Sl

ave

out

Mas

ter o

ut-S

lave

in

CSN

INH

ENRxD

TxD

CB5

Closed Door

R23

1K

CB3

PE6

CB4

PF1

1 2 3 4 5 6 7 8 9 10

J2 to P

C Pa

rall

el P

ort

U5

CP

M1

M2

PE4

21

PC3/

CAN

_RX

23

PC4/

CAN

_TX

24

PC6/

SPI_

MO

SI27

PC5/

SPI_

MIS

O26

PF2/

AIN

831

PD1/

linSC

L1_R

D1

32

T16_

EXTC

LK/(

HS)

/PC2

20

PE6/

AIN

525

ICCS

EL/V

pp22

Vdd2

16

T16_

OC

MP

2/A

IN3/

PB7

17

PWM

3/PA

35

T16_

ICA

P1/A

IN4/

PC0

18

T16_

ICA

P2/(H

S)/P

C119

PC7/

SPI_

SCK

28

PD0/

SPI_

ss/A

IN6

29

PF1/

AIN

730

Osc

11

PWM

0/PA

13

PWM

1/(H

S)P

A2

4

ART

IC2/

(HS)

PA6

8

T8_O

CMP1

/PB

19

T8_I

CAP1

/PB2

10

MCO

/PB3

11

ICCC

LK/A

IN0/

PB4

12IC

CDA

TA/A

IN1/

PB5

13

T16_

OC

MP

1/A

IN2/

PB6

14

Vss2

15

Osc

22

PWM

3/PA

46

ART

CLK

/(HS)

PA5

7

PD2/

linSC

L1_T

DO

33

PF5

34

PD3(

HS)

/linS

CL2_

SCK

35PD

4/lin

SCL2

_RD

l36

Vssa

37Vs

s_0

38

VddA

39Vd

d_0

40

PD5/

linSC

L2_T

DO

41

RESE

T42

PD6/

AIN

1043

PD7/

AIN

1144

ST72

F561

TQFP

44

R910

k

+5V

R28

10k

R151K

R61K

R71K

D1

R29

100K

C20 10

0uF

R31

100k

Vcw

5

Wi

6

Vo7

Vs8

En1

Gro

und

2

Res o

ut3

Vcr

4

L497

9D

SO8

C4 100n

F

CMR31K

R41K

R51K

R10

1KR1

41K

R11

1KR1

21K

R13

1K

GN

D1

Out

112

Out

13

Out

24

Out

35

Vs6

Vs7

Di

8CS

N10

DO

11

Vcc

12

Clk

13

Vs14

Vs15

Out

416

Out

417

GN

D18

GN

D19

Out

520

Out

521

Out

622

Vs23

Vs24

Vs25

CP26

PWM

127

Vs28

Vs29

Out

730

Out

831

Vs32

Out

933

Out

1034

Out

1135

GN

D36

CM/P

WM

29

Tab

Tab

L995

0

Pow

er S

O36

Comm

on M

irror

Mot

ors

Up-

Dow

n M

irro

r Mot

orLe

ft-Ri

ght M

irror

Mot

or

Lock

Mot

. A

Lock

Mot

. BM

irror

Ret

ract

Mot

orEx

terio

ur L

ight

Foot

step

Lig

htSa

fety

Ligh

tTu

rn In

dica

tor

Defr

oste

r

C25

10nF

+5V

VBA

T

PWM

1

SpiC

lock

Mas

ter i

n-Sl

ave

out

CSN

CP

R32

10k

R33

10k

R34

2.7k

CM

RxD

1

EN2

WU

P3

TxD

4G

ND

5

LIN

6

Vs7

INH

8L9

638D

SO8

R24

1k

VBA

TVB

AT

1 2 3

J6 CON

3

ENRxD

TxD

INH

C15

10nF

R26

1KO

hm

1 2 3 4 5 6 7 8 9 10

J4 ICC

Prog

ram

Vdd

RESE

T

Vpp/

ICCS

EL

ICCD

ATA

ICCC

LOC

K

Comm

on M

irror

Mot

ors

Up-

Dow

n M

irro

r Mot

orLe

ft-Ri

ght M

irror

Mot

or

Lock

Mot

. A

Lock

Mot

. BM

irror

Ret

ract

Mot

or

1 2 3 4 5 6 7 8

J3 CON

8

Comm

on M

irror

Mot

ors

Comm

on M

irror

Mot

ors

C610

nF

C710

nFC1

010

nFC9

10nF

C810

nFC1

210

nFC1

310

nFC1

410

nF

Exte

riour

Lig

htFo

otst

ep L

ight

Safet

y Li

ght

Turn

Indi

cato

rD

efros

ter

C11

10nF

C17

10nF

C16

10nF

C18

10nF

C19

10nF

1 2 3 4 5 6 7

J9 CON

7

D2

Osc

1

Osc

1

CB1

CB2

Window Up Switch

C26

10nF

C27

10nF

R35

10K

C28

33nF

C29

33nF

R36

50k

VBA

T123

J7 Wak

e Up

Mas

ter o

ut-S

lave

in

R27

100O

hm

R25

500

Ohm

Page 21: AN2334 Application Note - Home - STMicroelectronics 2013 Rev 2 1/22 AN2334 Application Note Complete car door module Introduction A car door module typically consists of a rubber-sealed

AN2334 Revision history

21/22

Revision history

Table 11. Document revision history

Date Revision Changes

07-Apr-2006 1 Initial release.

19-Sep-2013 2 Updated disclaimer.

Page 22: AN2334 Application Note - Home - STMicroelectronics 2013 Rev 2 1/22 AN2334 Application Note Complete car door module Introduction A car door module typically consists of a rubber-sealed

AN2334

22/22

Please Read Carefully:

Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries (“ST”) reserve theright to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at anytime, without notice.

All ST products are sold pursuant to ST’s terms and conditions of sale.

Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes noliability whatsoever relating to the choice, selection or use of the ST products and services described herein.

No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of thisdocument refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party productsor services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of suchthird party products or services or any intellectual property contained therein.

UNLESS OTHERWISE SET FORTH IN ST’S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.

ST PRODUCTS ARE NOT DESIGNED OR AUTHORIZED FOR USE IN: (A) SAFETY CRITICAL APPLICATIONS SUCH AS LIFE SUPPORTING, ACTIVE IMPLANTED DEVICES OR SYSTEMS WITH PRODUCT FUNCTIONAL SAFETY REQUIREMENTS; (B) AERONAUTIC APPLICATIONS; (C) AUTOMOTIVE APPLICATIONS OR ENVIRONMENTS, AND/OR (D) AEROSPACE APPLICATIONS OR ENVIRONMENTS. WHERE ST PRODUCTS ARE NOT DESIGNED FOR SUCH USE, THE PURCHASER SHALL USE PRODUCTS AT PURCHASER’S SOLE RISK, EVEN IF ST HAS BEEN INFORMED IN WRITING OF SUCH USAGE, UNLESS A PRODUCT IS EXPRESSLY DESIGNATED BY ST AS BEING INTENDED FOR “AUTOMOTIVE, AUTOMOTIVE SAFETY OR MEDICAL” INDUSTRY DOMAINS ACCORDING TO ST PRODUCT DESIGN SPECIFICATIONS. PRODUCTS FORMALLY ESCC, QML OR JAN QUALIFIED ARE DEEMED SUITABLE FOR USE IN AEROSPACE BY THE CORRESPONDING GOVERNMENTAL AGENCY.

Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately voidany warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, anyliability of ST.

ST and the ST logo are trademarks or registered trademarks of ST in various countries.Information in this document supersedes and replaces all information previously supplied.

The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners.

© 2013 STMicroelectronics - All rights reserved

STMicroelectronics group of companies

Australia - Belgium - Brazil - Canada - China - Czech Republic - Finland - France - Germany - Hong Kong - India - Israel - Italy - Japan - Malaysia - Malta - Morocco - Philippines - Singapore - Spain - Sweden - Switzerland - United Kingdom - United States of America

www.st.com