0% found this document useful (0 votes)
25 views18 pages

P Ex Valve Controller Pug

This document provides a user guide for programming an NXP valve controller. It describes the component API for the MC34ValveController embedded software component, including initialization, register access, status checking, and driver control methods. It also lists properties and typical usage for configuring and interacting with the valve controller device.

Uploaded by

miki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views18 pages

P Ex Valve Controller Pug

This document provides a user guide for programming an NXP valve controller. It describes the component API for the MC34ValveController embedded software component, including initialization, register access, status checking, and driver control methods. It also lists properties and typical usage for configuring and interacting with the valve controller device.

Uploaded by

miki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

NXP Semiconductors Document Number: PEXVALVECONTROLLERPUG

User’s guide Rev. 1.0, 2/2016

Valve Controller Programming Guide

Contents
1 General Info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2 Embedded Component Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.1 Component API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.2 Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.3 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.4 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3 Typical Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4 User Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

© 2016 NXP B.V.


General Info

1
1 General Info 2
2.1
This documentation introduces Processor Expert component named MC34ValveController. This
component supports and provides flexible software solution for these analog parts:

NXP MC34SB0410: Quad Valve Controller System On Chip


NXP MC34SB0800: Octal Valve Controller System On Chip

NXP offers tower board solutions based on these chips, namely TWR-MC34SB0410 and
TWR-MC34SB0800 boards. Detailed description can be found in related hardware user guides and
datasheets.

2 Embedded Component Description


2.1 Component API
MC34ValveController component provides API, which can be used for dynamic real-time configuration
of device in user code. Available methods and events are listed under component selection Some of
those methods/events are marked with ticks and other ones with crosses, it distinguishes which
methods/events are supposed to be generated or not. You can change this setting in Processor Expert
Inspector. Note that methods with grey text are always generated because they are needed for proper
functionality. This forced behavior depends on various combinations of settings of component
properties. For summarization of available API methods and events and their descriptions, see Table 1
MC34ValveController Component API

Table 1

Method Description
Init Initializes the device with predefined values.
Deinit Deinitializes the device. It sets reset pin (RSTB) to LOW. Valve
controller consequently clears all registers of valve controller de-
vice.
WriteRegister This method writes a value to selected SI register. It allocates
SPI bus and calls internal function VC write register.
ReadRegister This method reads a value from selected SO register. It allo-
cates SPI bus and calls internal function VC read register.
GetControllerStatus Gets selected status information. It reads content of two se-
lected device registers and returns them. Then you can check
possible faults.
ClearDriverFault Clears selected fault flags. This method handles only faults re-
lated to driver modules (all lowside drivers, highside driver,
pump motor predriver). It is not intended to clear faults of
supervision module (i.e. RST WD, RST ALU, RST EXT,
RST CLK, VINT UV, VCC5 UV, DOSV UV, OT, GND LOSS,
VPWR UV, VPWR OV).
SetDriverState This method sets selected driver output value. It handles driver
either by SPI bit (SPI control mode) or directly by output
of the MCU (Direct control mode). In case of PWM control,
”dsON” stands for predefined PWM duty, ”dsOFF” means 0
percent duty.
SetPDPWMDuty This method sets PWM duty cycle for pump motor predriver. It
is available only when property ”Input Control” of pump motor
predriver is set to ”PWM”.
SetLSDPWMDuty This method sets PWM duty cycle for selected lowside driver
(LSD) for inductive loads. An error is returned when the se-
lected LSD is not in PWM mode. It also reports an error when
the PWM duty converted to target current is above limit (see
property ”Maximum Current”).

Valve Controller Programming Guide, Rev. 1.0


2 NXP Semiconductors
Embedded Component Description

2.2
2.3
SetLSDPWMFrequency This method sets PWM frequency for selected lowside driver
(LSD) for inductive loads.
SetLSDCurrent This method sets current target for selected lowside driver for
inductive loads (LSD). This method is blocking. When the low-
side driver is in PWM mode the software PI regulation is uti-
lized to reach current target. An error is returned when the cur-
rent target is above limit (see property ”Maximum Current”).
SetPIRegulator This method sets parameters of PI regulator.
GetLSDPWMDuty This method returns PWM duty cycle for selected lowside driver
for inductive loads (LSD). It can be used only when selected
LSD is in current regulation mode.
GetLSDCurrent This method returns current value for selected lowside driver
for inductive loads. It can be used only when selected LSD is in
PWMed mode.
GetADCValue This method gets and interprets selected ADC value from a
valve controller register.
FeedWatchdog This method handles watchdog of valve controller. It sends
MCU monitoring result computed for LFSR output received
from the device.
GetLSDMode This method returns mode for selected lowside driver for induc-
tive loads (LSD).
GetResetPinVal This method returns value of reset pin. When the pin is LOW
the valve controller is in fault state. You can use method Init
for recovery.
FlutterCurrent This method checks whether to adjust the current of lowside
driver and sets new current target to create sinusiodal current
curve. Call this method as often as possible.

2.2 Events
There are no Events in this component

2.3 Methods
Init -Initializes the device with predefined values.
ANSIC prototype: TError Init(void)
Return value:TError - error code ERR OK - success ERR RST EXT - RST pin level is low errors
related to WriteRegister
Deinit -Deinitializes the device. It sets reset pin (RSTB) to LOW. Valve controller consequently clears
all registers of valve controller device.

ANSIC prototype: void Deinit(void)

WriteRegister -This method writes a value to selected SI register. It allocates SPI bus and calls
internal function VC write register.
ANSIC prototype: TError WriteRegister(uint8 t RegNum,uint16 t RegVal)
uint8 t :RegNum- Identifier of register to be written. It corresponds to message ID (MSG ID)
defined in valve controller datasheet. You can use macros defined in MC34SB0410.h or
MC34SB0800.h according to valve controller model. Possible values for MC34SB0410 are in range
[0 - 16] except reserved registers [2]. Possible values for MC34SB0800 are in range [0 - 26] except
reserved registers [2, 19-23].
uint16 t :RegVal - New value of selected register.
Return value:TError - error code ERR OK - success ERR PARAM VALUE - invalid parameter
value ERR BUS OFF - SPI bus not available ERR PARITY - wrong parity of send or received
data errors related to internal functions responsible for SPI communication (for more details see
PE Error.h)

Valve Controller Programming Guide, Rev. 1.0


NXP Semiconductors 3
Embedded Component Description

ReadRegister -This method reads a value from selected SO register. It allocates SPI bus and calls
internal function VC read register.
ANSIC prototype: TError ReadRegister(uint8 t RegNum,uint16 t *RegValPtr)
uint8 t :RegNum- Identifier of register to be written. It corresponds to message ID (MSG ID)
defined in valve controller datasheet. You can use macros defined in MC34SB0410.h or
MC34SB0800.h according to valve controller model. Possible values for MC34SB0410 are in range
[0 - 16] except reserved registers [2]. Possible values for MC34SB0800 are in range [0 - 26] except
reserved registers [2, 19-23].
uint16 t : Pointer to RegValPtr - pointer to memory where content of selected 16 bit register is
stored.
Return value:TError - error code ERR OK - success ERR PARAM VALUE - invalid parameter
value ERR PARAM ADDRESS - invalid parameter address (null pointer) ERR BUS OFF - SPI
bus not available ERR PARITY - wrong parity of send or received data errors related to internal
functions responsible for SPI communication (for more details see PE Error.h)

GetControllerStatus -Gets selected status information. It reads content of two selected device
registers and returns them. Then you can check possible faults.
ANSIC prototype: TError GetControllerStatus(TControllerStatus StatusSelection,uint16 t
*StatusDataPtr)
TControllerStatus :StatusSelection- Type of status information to be read (fault status, version of
device, etc.). Common inputs csDEVICE INFO [M0R] version, [M1R] manufacturing data Specific
inputs for MC34SB0410 - csSUPERVISION [M0R] RST EXT, RST CLK, VINT UV, VCC5 UV,
DOSV UV, [M3R] OTW, GND LOSS, VPWR UV, VPWR OV csPD [M3R] PD OT [M4R]
PD OC csLS12 [M6R] VDS LD1, LD1 OT, LD1 OP, LD1 OC [M7R] VDS LD2, LD2 OT,
LD2 OP, LD2 OC csLSD CRERR [M5R] LSD1-4 CRER csLSD12 [M10-13R] VDS LSD1-4,
LSD1-4 OT, LSD1-4 OP, LSD1-4 OC csLSD34 Specific inputs for MC34SB0800 -
csSUPERVISION [M0R] RST WD, RST ALU, RST EXT, RST CLK, VINT UV, VCC5 UV,
DOSV UV, [M3R] OT, GND LOSS, VPWR UV, VPWR OV csPD HD [M5R] PD OC, HD OC
[M18R] HD LKG csLS [M6R] VDS LD, LD OT, LD OP, LD OC csLSD CRERR [M8R]
LSD1-4 CRER csLSD12 [M10-17R] VDS LSD1-8, LSD1-8 OT, LSD1-8 OP, LSD1-8 OC csLSD34
csLSD56 csLSD78 csHS [M24R] VDS HS, HS OT, HS OP, HS OC
uint16 t : Pointer to StatusDataPtr - Two element array to store selected status information (i.e.
Content of two selected device registers)
Return value:TError - error code ERR OK - success ERR PARAM VALUE - invalid parameter
value ERR PARAM ADDRESS - invalid parameter address (null pointer) errors related to
ReadRegister
ClearDriverFault -Clears selected fault flags. This method handles only faults related to driver
modules (all low-side drivers, high-side driver, pump motor pre-driver). It is not intended to clear faults
of supervision module (i.e. RST WD, RST ALU, RST EXT, RST CLK, VINT UV, VCC5 UV,
DOSV UV, OT, GND LOSS, VPWR UV, VPWR OV).
ANSIC prototype: TError ClearDriverFault(TFaultSelection FaultSelection)
TFaultSelection :FaultSelection- Selection of fault to be cleared. It is not allowed to combine faults.
If you want clear all faults, pass fsALL value. Common inputs - fsLSD, fsPD, fsALL Specific
inputs for MC34SB0410 - fsLD1, fsLD2 Specific inputs for MC34SB0800 - fsLD, fsHD, fsHS
Return value:TError - error code ERR OK - success ERR PARAM VALUE - invalid parameter
value errors related to WriteRegister
SetDriverState -This method sets selected driver output value. It handles driver either by SPI bit
(SPI control mode) or directly by output of the MCU (Direct control mode). In case of PWM control,
”dsON” stands for predefined PWM duty, ”dsOFF” means 0 percent duty.
ANSIC prototype: TError SetDriverState(TDriverSelection Driver,TDriverState State)
TDriverSelection :Driver - Selection of valve controller driver. Common inputs - dsPD Specific
inputs for MC34SB0410 - dsLD1, dsLD2 Specific inputs for MC34SB0800 - dsHD, dsHS, dsLD
TDriverState :State- New output value of the selected driver. Possible values are dsON and
dsOFF.

Valve Controller Programming Guide, Rev. 1.0


4 NXP Semiconductors
Embedded Component Description

Return value:TError - error code ERR OK - success ERR PARAM VALUE - invalid parameter
value ERR PARAM ADDRESS - invalid parameter address (null pointer) ERR PD DIS - PD
disabled in properties errors related to WriteRegister

SetPDPWMDuty -This method sets PWM duty cycle for pump motor pre-driver. It is available only
when property ”Input Control” of pump motor pre-driver is set to ”PWM”.

ANSIC prototype: TError SetPDPWMDuty(uint8 t Duty)


uint8 t :Duty- PWM duty cycle. Zero value stands for 0 percent and value 255 represents 100
percent duty cycle.
Return value:TError - error code ERR OK - success errors related to SetRatio16 of PWM LDD
component
SetLSDPWMDuty -This method sets PWM duty cycle for selected low-side driver (LSD) for
inductive loads. An error is returned when the selected LSD is not in PWM mode. It also reports an
error when the PWM duty converted to target current is above limit (see property ”Maximum
Current”).

ANSIC prototype: TError SetLSDPWMDuty(uint8 t LSD,uint8 t Duty)


uint8 t :LSD- Selection of low-side driver for inductive loads. Possible values are in range [1 - 4] for
MC34SB0410 and in range [1 - 8] for MC34SB0800.
uint8 t :Duty- PWM duty cycle. Zero value stands for 0 percent and value 255 represents 100
percent duty cycle.
Return value:TError - error code ERR OK - success ERR PARAM VALUE - invalid parameter
value ERR PARAM RANGE - invalid parameter range ERR LSD MODE - invalid LSD mode
errors related to WriteRegister
SetLSDPWMFrequency -This method sets PWM frequency for selected low-side driver (LSD) for
inductive loads.

ANSIC prototype: TError SetLSDPWMFrequency(TLSDSelection LSDGroup,TLSDFrequency


PWMFreq)
TLSDSelection :LSDGroup- Select LSD group to apply PWM frequency change. Always four LSD
have common PWM frequency setting. Common inputs - lsLSD14 Specific inputs for MC34SB0800
- lsLSD58
TLSDFrequency :PWMFreq- PWM frequency. For possible values see definition of TLSDFrequency
enumeration.
Return value:TError - error code ERR OK - success ERR PARAM VALUE - invalid parameter
value errors related to WriteRegister

SetLSDCurrent -This method sets current target for selected low-side driver for inductive loads
(LSD). This method is blocking. When the low-side driver is in PWM mode the software PI regulation
is utilized to reach current target. An error is returned when the current target is above limit (see
property ”Maximum Current”).

ANSIC prototype: TError SetLSDCurrent(uint8 t LSD,uint16 t Current)


uint8 t :LSD- Selection of low-side driver for inductive loads. For example if you want to control
LSD 1, put value 1.
uint16 t :Current- Current target in mili amps. Minimum is 0, maximum 2250 and step is 2.2 mili
amps. This value is scaled to 10 bits and stored into register (rounding to the nearest available
value).
Return value:TError - error code ERR OK - success ERR PARAM VALUE - invalid parameter
value ERR PARAM RANGE - invalid parameter range ERR MAX CURRENT - the current
target is above limit (see property ”Maximum Current”) ERR LSD MODE - invalid LSD mode
errors related to WriteRegister

SetPIRegulator -This method sets parameters of PI regulator.

ANSIC prototype: TError SetPIRegulator(TPCharacteristic PChar,TICharacteristic


IChar,TIntegratorLimit Limit)

Valve Controller Programming Guide, Rev. 1.0


NXP Semiconductors 5
Embedded Component Description

TPCharacteristic :PChar - Proportional characteristic of the PI regulator. For possible values see
definition of TPCharacteristic enumeration.
TICharacteristic :IChar - Integration characteristic of the PI regulator. For possible values see
definition of TICharacteristic enumeration.
TIntegratorLimit :Limit- Limit of the integrator. Possible values are ilLOW (0x03FF) and ilHIGH
(0x07FF).
Return value:TError - error code ERR OK - success ERR PARAM VALUE - invalid parameter
value errors related to WriteRegister

GetLSDPWMDuty -This method returns PWM duty cycle for selected low-side driver for inductive
loads (LSD). It can be used only when selected LSD is in current regulation mode.

ANSIC prototype: TError GetLSDPWMDuty(uint8 t LSD,uint8 t *DutyPtr)


uint8 t :LSD- Selection of low-side driver for inductive loads. Possible values are in range [1 - 4].
uint8 t : Pointer to DutyPtr - Pointer to memory where PWM duty value of selected driver is
stored. Note that resulting value is in range [0 - 255] for minimum respective maximum duty.
Return value:TError - error code ERR OK - success ERR PARAM VALUE - invalid parameter
value ERR PARAM ADDRESS - invalid parameter address (null pointer) ERR LSD MODE -
invalid LSD mode errors related to ReadRegister
GetLSDCurrent -This method returns current value for selected low-side driver for inductive loads. It
can be used only when selected LSD is in PWMed mode.

ANSIC prototype: TError GetLSDCurrent(uint8 t LSD,uint16 t *CurrentPtr)


uint8 t :LSD- Selection of low-side driver for inductive loads. Possible values are in range [1 - 4].
uint16 t : Pointer to CurrentPtr - Pointer to memory where current value of selected driver is
stored. Only lower 10 bits are used. Note that returned value is in range 0 - 4500 [mili Amps].
Return value:TError - error code ERR OK - success ERR PARAM RANGE - invalid parameter
range ERR PARAM ADDRESS - invalid parameter address (null pointer) ERR LSD MODE -
invalid LSD mode errors related to ReadRegister
GetADCValue -This method gets and interprets selected ADC value from a valve controller register.

ANSIC prototype: TError GetADCValue(TADCSelection Selection,uint16 t *Result)


TADCSelection :Selection- Selection of measured value. Common inputs - asDIE TEMP,
asVINT A, asVINT D, asVPRE10, asVPRE12, asADIN1, asADIN2, asADIN3 Specific inputs for
MC34SB0410 - asVGS PD (voltage gate-source on PD) Specific inputs for MC34SB0800 -
asVCP VPWR (difference between Vcp and Vpwr)
uint16 t : Pointer to Result- Result of ADC measurement. (temperature [deg. of C.] or voltage
[mV] scaled to internal reference VCC5)
Return value:TError - error code ERR OK - success ERR PARAM VALUE - invalid parameter
value errors related to ReadRegister

FeedWatchdog -This method handles watchdog of valve controller. It sends MCU monitoring result
computed for LFSR output received from the device.

ANSIC prototype: TError FeedWatchdog(void)


Return value:TError - error code ERR OK - success errors related to WriteRegister
GetLSDMode -This method returns mode for selected low-side driver for inductive loads (LSD).

ANSIC prototype: TLSDMode GetLSDMode(uint8 t LSD)


uint8 t :LSD- Selection of low-side driver for inductive loads. Possible values are in range [1 - 4].
Return value:TLSDMode - lsd mode Possible values lmPWM - driver is in PWM mode lmCR -
driver is in current regulation mode

GetResetPinVal -This method returns value of reset pin. When the pin is LOW the valve controller
is in fault state. You can use method Init for recovery.

ANSIC prototype: bool GetResetPinVal(void)

Valve Controller Programming Guide, Rev. 1.0


6 NXP Semiconductors
Embedded Component Description

2.4
Return value:bool - level of RST pin (TRUE - high, FALSE - LOW)

FlutterCurrent -This method checks whether to adjust the current of low-side driver and sets new
current target to create sinusiodal current curve. Call this method as often as possible.

ANSIC prototype: TError FlutterCurrent(void)


Return value:TError - error code ERR OK - success errors related to WriteRegister

2.4 Properties
Component Name - Name of the component.

Valve Controller Model - Select valve controller model. Model selection affects which properties are
available or hidden, enabled or disabled.
General Settings - Settings of valve controller.
SPI Link - Linked SPI Device component.
Reset Pin Link - Link to a BitIO LDD component.
Reset Pin - Select pin for RSTB. The pin is used for device reset and detection of fault state.
Discharge Slew Rate - Select slew rate used by pump motor pre-driver and high-side driver
modules. When the power FET is switched off, the gate capacitance of the FET is discharged
by a constant current, which is controlled fast or slow.
There are 2 options:
Slow: Slow slew rate (typ. 100 microA)
Fast: Fast slew rate (typ. 2 mA)
Clock Frequency - Select frequency of clock modules, i.e. the main supply clock CLK1 and
auxiliary clock CLK2. Clock frequency is 14 MHz when ”Fixed” option is selected. In other
cases the frequency modulation is used. Two deviation frequencies are available to spread the
oscillators energy over a wide frequency band.
There are 3 options:
Fixed
Modulated with 350 kHz: Deviation frequency is 350 kHz
Modulated with 700 kHz: Deviation frequency is 700 kHz
Internal Clock Monitoring - Set internal clock monitoring function. If disabled, it has no
effect on functionality except clock monitoring function, because auxiliary clock CLK2 is
deactivated. The main clock CLK1 remains active.
There are 2 options:
Enabled
Disabled
HS for Fail-safe Switch - Select initial state of high-side driver intended to control the fail-safe
switch for the overall solenoid path.
There are 2 options:
On: Feature is on
Off: Feature is off
LSD for Inductive Loads - Settings of low-side drivers that control inductive loads.
Rise Time and Fall Time - Set rise time and fall time of low-side drivers.
There are 2 options:
Long: Long rise time (typ. 1.7 micro sec) and fall time (1.35 micro sec)
Short: Short rise time (typ. 0.5 micro sec) and fall time (1.0 micro sec)
Open Load Detection - Set low-side driver’s sink current for open load detection.
There are 2 options:
Enabled
Disabled
PWM Frequency - Settings of output PWM frequency for low-side drivers.
Frequency of LSD 1 - 4 - Select output PWM frequency for low-side drivers 1 - 4.

Valve Controller Programming Guide, Rev. 1.0


NXP Semiconductors 7
Embedded Component Description

There are 8 options:


3.0 kHz
3.2 kHz
3.4 kHz
3.6 kHz
3.9 kHz
4.2 kHz
4.5 kHz
5.0 kHz
Frequency of LSD 5 - 8 - Select output PWM frequency for low-side drivers 5 - 8
There are 8 options:
3.0 kHz
3.2 kHz
3.4 kHz
3.6 kHz
3.9 kHz
4.2 kHz
4.5 kHz
5.0 kHz
Current Regulation Mode - Settings of current regulation mode of low-side drivers. The
load current is sensed by an internal low-side sense FET and digitized by an internal A/D
converter. A digital current regulation circuitry compares the actual load current with the
target current value and steers the duty cycle of the low-side power switch. The PI regulator is
used.
PI Regulator - Settings of PI regulator used in current regulation mode.
P - Characteristic - Proportional characteristic of the PI regulator.
There are 15 options:
0.7812
0.8125
0.8438
0.875
0.9062
0.9375
0.9688
1
1.0312
1.0625
1.0938
1.125
1.1562
1.1875
1.2188
I - Characteristic - Integral characteristic of the PI regulator. Regulator stays idle
until non-zero value is applied.
There are 8 options:
0.0312
0.0625
0.0938
0.125
0.1562
0.1875
0.25
0.3125

Valve Controller Programming Guide, Rev. 1.0


8 NXP Semiconductors
Embedded Component Description

Integrator Limit - Set integrator limit. Possible values are 1023 (0x03FF) and 2047
(0x07FF).
There are 2 options:
1023: Limit is 1023 (0x03FF)
2047: Limit is 2047 (0x07FF)
Minimum PWM Duty - Select the minimum duty cycle of the low-side drivers 1 - 4
PWM outputs. This option affects time when the current meassurement occurs. Note that
maximum duty cycle is 100%.
There are 4 options:
10%: Minimum PWM duty is 10%
3.12%: Minimum PWM duty is 3.12%
3.12% and 1.56%: Minimum PWM duty is 3.12% and duty 1.56% is forced every two
cycles
3.12% and Skipping: Minimum PWM duty is 3.12% and skipping every two cycles
First PWM Duty - Select the first duty cycle of the low-side drivers 1 - 4 PWM
outputs. The first duty cycle is either controlled by current or limited to a fixed duty cycle
which a target current is transformed in.
There are 2 options:
Controlled by Current
Fixed Duty Cycle
Flutter Frequency Timer - Settings of a timer used by Flutter Frequency function.
The following items are available only if the group is enabled (the value is ”Enabled”):
TimerInt LDD Link - Link to a TimerInt LDD component.
Timing Device - Name of a timing device used by TimerInt LDD component.
LSD - Low-side driver for current regulated or PWMed valves.
Maximum Current - Select current limitation value in mA. This value is applied in
component methods.
Control Mode - Set low-side driver mode. Either current regulation or PWM mode can
be enabled in time. Current Regulation means that a digital current regulation circuitry
compares the actual load current with the target current value and steers the duty cycle of
the low-side power switch.
Target Current - Select target current in mA. Minimum value is 0 mA, maximum
2250.6 mA and step is 2.2 mA. Value is rounded to the nearest available value. In
column ”Details” you can see final value that is put into valve controller register.
Flutter Frequency - Flutter frequency settings.
The following items are available only if the group is enabled (the value is ”Enabled”):
Frequency - Frequency of sinusoidal current curve. When the Flutter Frequency
function is utilized by two or more LSDs the frequency value is corrected. This
corrections is needed, because all LSDs use one interrupt where the current is
adjusted. So frequency of the interrupt must fit to all LSDs.
Points per Period - Number of points per period. One point correspond to a value
of current.
There are 11 options:
8
12
16
20
24
28
32
36
40
44
48
Amplitude - Amplitude of sinusoidal curve in mili Amps.

Valve Controller Programming Guide, Rev. 1.0


NXP Semiconductors 9
Embedded Component Description

PWM Duty - Select desired PWM duty cycle. Zero value stands for 0% and value 255
represents 100% duty cycle.
LSD - Low-side driver for current regulated or PWMed valves.

LSD - Low-side driver for current regulated or PWMed valves.

LSD - Low-side driver for current regulated or PWMed valves.

LSD - Low-side driver for current regulated or PWMed valves.


Maximum Current - Select current limitation value in mA. This value is applied in
component methods.
PWM Duty - Select desired PWM duty cycle. Zero value stands for 0% and value 255
represents 100% duty cycle.
LSD - Low-side driver for current regulated or PWMed valves.

LSD - Low-side driver for current regulated or PWMed valves.

LSD - Low-side driver for current regulated or PWMed valves.

Pump Motor Pre-driver - Settings of DC motor pump module. Registers related to pump
motor pre-driver are initialized to default values defined in datasheet when you select ”Disabled”.
The following items are available only if the group is enabled (the value is ”Enabled”):
Overcurrent Masking Time - Select masking time from direct input turn-on against
malfunction on transient time. This masking time is used by overcurrent detection logic. T2 is
typically 293 micro sec (see datasheet).
There are 2 options:
T2: Overcurrent masking time is equal to T2 (typ. 293 micro sec)
No Masking Time: No masking time
Overcurrent Masking Time - Select masking time from PDI turn-on against malfunction
on transient time. This masking time is used by overcurrent detection logic. T1 is typically
18.2 micro sec (see datasheet).
There are 2 options:
Half of T1: Overcurrent masking time is equal to half of T2 (T1 is typ. 18.2 micro sec)
No Masking Time: No masking time
Overcurrent Filter Time - Select overcurrent filter timer of pump driver. The drain-source
voltage of the FET on PD G is checked if the high-side predriver is switched on. If the
measured drain-source voltage exceeds the overcurrent voltage threshold, the output of the
overcurrent comparator is enabled. If the output of the comparator is active longer than the
defined filter time, the output PD G is switched off. T1 is typically 18.2 micro sec and T2 is
293 micro sec (see datasheet).
There are 2 options:
T2: Overcurrent filter time is T2 (typ. 293 micro sec)
4 x T1: Overcurrent filter time is 4 x T1 (T1 is typ. 18.2 micro sec)
ControlMode - Select control mode. It is driven either directly by MCU pin (”Direct” mode)
or through SPI interface (”SPI” mode). It is not possible to change the mode later when you
select SPI mode due to selection of control pin.
Initial State - Select initial state of driver output.
There are 2 options:
On: Feature is on
Off: Feature is off
Input Control - Select control mode of driver input. Pump motor input pin can be
controlled by GPIO or PWM port.
Control Pin Link - Link to a BitIO LDD component.
Control Pin Link - Link to a PWM LDD component.

Valve Controller Programming Guide, Rev. 1.0


10 NXP Semiconductors
Typical Usage

3
Control Pin - Select pin to directly control the driver. This is the PDI pin when
MC34SB0410 model is used or ADIN1 pin for MC34SB0800.
PWM Frequency - Select PWM frequency.
PWM Duty - Select PWM duty cycle. Zero value stands for 0 percent and value 255
represents 100 percent duty cycle.
Initial State - Select initial state of driver output.
There are 2 options:
On: Feature is on
Off: Feature is off
LD 1 for Resistive Charge - Settings of low-side driver 1 for general purpose.
There are 2 options:
On: Feature is on
Off: Feature is off
LD 2 for Resistive Charge - Settings of low-side driver 2 for general purpose. This driver is
available only on MC34SB0410 device.
There are 2 options:
On: Feature is on
Off: Feature is off
HS for General Purpose - Select initial state of high-side driver for general purpose. It allows
connecting and disconnecting loads like voltage dividers from the supply line, to reach low
quiescent current of the total ECU or to driver small size relay driver.
There are 2 options:
On: Feature is on
Off: Feature is off
Auto Initialization - Automated initialization of the component. The component Init method is
automatically called from CPU component initialization function PE low level init().
There are 2 options:

yes
no

3 Typical Usage
Examples of typical settings and usage of MC34ValveController component

Initialization of VAPS component.


Feeding watchdog.
Processing of VAPS status information.
Setting of driver state.
Setting of LSD current.
Setting of LSD PWM duty.
Setting of PD PWM duty.
Clearing of driver faults.
Measuring of die temperature and internal/external voltages.

Initialization of VAPS component.


This example shows how to handle device initialization when auto-initialization is disabled.
Required component setup and dependencies:

Properties: Auto initialization: Disabled


Methods: Init

Valve Controller Programming Guide, Rev. 1.0


NXP Semiconductors 11
Typical Usage

Content of main.c:

Listing 1: Source code


v o i d main ( v o i d )
{
VC TError E r r o r ;

/∗ C a l l i n g I n i t method more then once i n u s e r code w i l l r e s t o r e i n i t i a l


P r o c e s s o r Expert s e t t i n g . ∗/

E r r o r = VC Init ( ) ;
i f ( E r r o r != ERR OK) {
/∗ I n i t i a l i z a t i o n was s u c c e s s f u l . ∗/
} else {
/∗ I n i t i a l i z a t i o n was not s u c c e s s f u l . ∗/
}
}

Feeding watchdog.
This example shows how to feed watchdog to preserve communication between MCU and VAPS.
Note that this applies only for MC34SB0800 model.
Required component setup and dependencies:

Properties: None
Methods: FeedWatchdog

Content of main.c:

Listing 2: Source code


v o i d main ( v o i d )
{
VC TError E r r o r ;

/∗ Note t h a t watchdog has t o be c a l l e d e v e r y 50ms . So u s e r code has t o


count with t h a t l i m i t a t i o n . ∗/

while (1) {
E r r o r = VC1 FeedWatchdog ( ) ;
i f ( E r r o r != ERR OK) {
/∗ Something went wrong . ∗/
}
}
}

Processing of VAPS status information.


This example shows how to get and interpret VAPS status information.
Required component setup and dependencies:

Properties: None
Methods: GetControllerStatus

Content of main.c:

Listing 3: Source code


v o i d main ( v o i d )
{
VC TError E r r o r ;
u i n t 1 6 t StatusData [ 2 ] ; /∗ Note t h a t StatusData i s a r r a y o f s i z e 2 . Every
c a l l o f G e t C o n t r o l l e r S t a t u s r e a d s 2 r e l a t e d s t a t u s r e g i s t e r s . ∗/

Valve Controller Programming Guide, Rev. 1.0


12 NXP Semiconductors
Typical Usage

/∗ Reads s u p e r v i s i o n data . ∗/
E r r o r = V C 1 G e t C o n t r o l l e r S t a t u s ( csSUPERVISION , StatusData ) ;
i f ( E r r o r != ERR OK) {
/∗ Something went wrong . ∗/
}
e l s e { /∗ I n t e r p r e t a t i o n o f s t a t u s data . ∗/
i f ( StatusData [ 0 ] & VC M0R RST WD MASK) { /∗ WD RST ( v a l i d MR was not
updated w i t h i n t wd ) ∗/
/∗ Take some a c t i o n . ∗/
}

i f ( StatusData [ 0 ] & VC M0R RST ALU MASK) { /∗ WD ALU ( r e s e t from


m o n i t o r i n g module , ERR CNT >= 1 0 1 ) ∗/
/∗ Take some a c t i o n . ∗/
}

i f ( StatusData [ 0 ] & VC M0R RST EXT MASK) { /∗ RST EXT ( r e s e t from


e x t e r n a l p i n (RSTB p i n ) ∗/
/∗ Take some a c t i o n . ∗/
}

i f ( StatusData [ 0 ] & VC M0R RST CLK MASK) { /∗ RST CLK ( SB0800 i n t e r n a l


c l o c k f a u l t was d e t e c t e d ) ∗/
/∗ Take some a c t i o n . ∗/
}

...

/∗ The same p r o c e d u r e can be a p p l i e d f o r t h e r e s t o f s t a t u s data . See


G e t C o n t r o l l e r S t a t u s d e s c r i p t i o n and MC34SB [ 0 4 1 0 / 0 8 0 0 ] . h f o r o t h e r b i t
masks . ∗/
}

Setting of driver state.


This example shows how to set selected driver state.
Required component setup and dependencies:

Properties: None
Methods: SetDriverState

Content of main.c:

Listing 4: Source code


v o i d main ( v o i d )
{
VC TError E r r o r ;

/∗ S e t s PD ON. ∗/
/∗ Note t h a t d r i v e r s which can be c o n t r o l l e d by SPI o r d i r e c t l y a r e
handled t h e same way . ∗/
E r r o r = V C 1 S e t D r i v e r S t a t e ( dsPD , dsON) ;
i f ( E r r o r != ERR OK) {
/∗ Something went wrong . ∗/
}

...

Valve Controller Programming Guide, Rev. 1.0


NXP Semiconductors 13
Typical Usage

/∗ S e t s PD OFF. ∗/
E r r o r = V C 1 S e t D r i v e r S t a t e ( dsPD , dsOFF ) ;
i f ( E r r o r != ERR OK) {
/∗ Something went wrong . ∗/
}

/∗ The same p r o c e d u r e can be a p p l i e d f o r t h e r e s t o f d r i v e r s ( dsPD , dsLD


[ 1 , 2 ] , dsHS , dsHD) , depends on t h e s e l e c t e d VAPS model . ∗/
}

Setting of LSD current.


This example shows how to set LSD current.
Required component setup and dependencies:

Properties: None
Methods: SetLSDCurrent

Content of main.c:

Listing 5: Source code


v o i d main ( v o i d )
{
VC TError E r r o r ;
u i n t 8 t Duty ;

i f ( VC1 GetLSDMode ( 1 ) != lmCR) {


/∗ LSD i s i n PWM mode ∗/
}
else {
/∗ S e t s c u r r e n t 500mA on LSD 1 . ∗/
/∗ Note t h a t t h i s method r e t u r n s e r r o r i f LSD i s i n wrong mode o r i f
d e s i r e d c u r r e n t i s above maximum c u r r e n t o f s e l e c t e d LSD . ∗/
E r r o r = VC1 SetLSDCurrent ( 1 , 5 0 0 ) ;
i f ( E r r o r != ERR OK) {
/∗ Something went wrong . ∗/
}

/∗ Waits u n t i l new c u r r e n t v a l u e i s s t a b i l i z e d . ∗/

/∗ Reads c o r r e s p o n d i n g duty v a l u e . ∗/
E r r o r = VC1 GetLSDPWMDuty( 1 , &Duty ) ;
i f ( E r r o r != ERR OK) {
/∗ Something went wrong . ∗/
}
}

/∗ The same p r o c e d u r e can be a p p l i e d f o r t h e r e s t o f LSD . ∗/


/∗ Note t h a t o n l y LSD 1−4 o f both VAPS models a r e c a p a b l e t o work i n lmCR
( c u r r e n t r e g u l a t i o n ) mode . ∗/
}

Setting of LSD PWM duty.


This example shows how to set LSD PWM duty.
Required component setup and dependencies:

Properties: None
Methods: SetLSDPWMDuty

Content of main.c:

Valve Controller Programming Guide, Rev. 1.0


14 NXP Semiconductors
Typical Usage

Listing 6: Source code


v o i d main ( v o i d )
{
VC TError E r r o r ;
u i n t 1 6 t Current ;

i f ( VC1 GetLSDMode ( 1 ) != lmPWM) {


/∗ LSD i s i n CR mode ∗/
}
else {
/∗ S e t s duty t o 128 on LSD 1 . ∗/
/∗ Note t h a t t h i s method r e t u r n s e r r o r i f LSD i s i n wrong mode o r i f
duty i s above maximum v a l u e . ∗/
E r r o r = VC1 SetLSDPWMDuty ( 1 , 1 2 8 ) ;
i f ( E r r o r != ERR OK) {
/∗ Something went wrong . ∗/
}

/∗ Waits u n t i l new c u r r e n t v a l u e i s s t a b i l i z e d . ∗/

/∗ Reads c o r r e s p o n d i n g c u r r e n t v a l u e . ∗/
E r r o r = VC1 GetLSDCurrent ( 1 , &Current ) ;
i f ( E r r o r != ERR OK) {
/∗ Something went wrong . ∗/
}
}

/∗ The same p r o c e d u r e can be a p p l i e d f o r t h e r e s t o f LSD . ∗/


}

Setting of PD PWM duty.


This example shows how to set PD PWM duty.
Required component setup and dependencies:

Properties: None
Methods: SetPDPWMDuty

Content of main.c:

Listing 7: Source code


v o i d main ( v o i d )
{
VC TError E r r o r ;

/∗ S e t s PD on . ∗/
E r r o r = V C 1 S e t D r i v e r S t a t e ( dsPD , dsON) ;
i f ( E r r o r != ERR OK) {
/∗ Something went wrong . ∗/
}

...

/∗ Changes PD PWM duty . ∗/


E r r o r = VC1 SetPDPWMDuty( 1 2 8 ) ;
i f ( E r r o r != ERR OK) {
/∗ Something went wrong . ∗/
}

...

Valve Controller Programming Guide, Rev. 1.0


NXP Semiconductors 15
Typical Usage

/∗ S e t s PD OFF. ∗/
E r r o r = V C 1 S e t D r i v e r S t a t e ( dsPD , dsOFF ) ;
i f ( E r r o r != ERR OK) {
/∗ Something went wrong . ∗/
}
}

Clearing of driver faults.


This example shows how to clear faults of selected driver.
Required component setup and dependencies:

Properties: None
Methods: ClearDriverFault

Content of main.c:

Listing 8: Source code


v o i d main ( v o i d )
{
VC TError E r r o r ;

/∗ C l e a r s f a u l t s o f LSD d r i v e r s . ∗/
E r r o r = V C 1 C l e a r D r i v e r F a u l t ( fsLSD ) ;
i f ( E r r o r != ERR OK) {
/∗ Something went wrong . ∗/
}

...

/∗ C l e a r s f a u l t s o f a l l d r i v e r s . ∗/
E r r o r = V C 1 C l e a r D r i v e r F a u l t ( fsALL ) ;
i f ( E r r o r != ERR OK) {
/∗ Something went wrong . ∗/
}

/∗ Note t h a t t h i s c a n t be used t o c l e a r f a u l t s o f s u p e r v i s i o n module .


Those a r e c l e a r e d on r e a d ( s e e G e t C o n t r o l l e r S t a t u s ) . ∗/

Measuring of die temperature and internal/external voltages.


This example shows how to read measured values of VAPS.
Required component setup and dependencies:

Properties: None
Methods: GetADCValue

Content of main.c:

Listing 9: Source code


v o i d main ( v o i d )
{
VC TError E r r o r ;
uint16 t Result ;

/∗ Reads d i e t e m p e r a t u r e i n d e g r e e s o f C e l s i u s . ∗/
E r r o r = VC1 GetADCValue ( asDIE TEMP , &R e s u l t ) ;
i f ( E r r o r != ERR OK) {
return Error ;

Valve Controller Programming Guide, Rev. 1.0


16 NXP Semiconductors
User Types

4
}

...

/∗ Reads i n t e r n a l v o l t a g e i n mV. See d e s c r i p t i o n o f GetADCValue t o g e t


l i s t o f p o s s i b l e measured v a l u e s . ∗/
E r r o r = VC1 GetADCValue ( asVINT A , &R e s u l t ) ;
i f ( E r r o r != ERR OK) {
return Error ;
}

...

/∗ Reads e x t e r n a l v o l t a g e i n mV. ∗/
/∗ Note t h a t ADIN1−3 i n p u t can be used t o measure e x t e r n a l v o l t a g e , but
a l s o t h o s e p i n s can be used t o d i r e c t l y c o n t r o l some o f d r i v e r s . ∗/
E r r o r = VC1 GetADCValue ( asADIN1 , &R e s u l t ) ;
i f ( E r r o r != ERR OK) {
return Error ;
}
}

4 User Types
ComponentName TLSDMode = enum { lmCR, lmPWM, lmUNDEFINED} Mode of low-side
driver for inductive loads.
ComponentName TADCSelection = enum { asVINT A, asVINT D, asVPRE10, asVPRE12,
asVGS PD, asDIE TEMP, asADIN1, asADIN2, asADIN3, asVCP VPWR} Selection of measured
value from a valve controller register.
ComponentName TIntegratorLimit = enum { ilLOW, ilHIGH} Limit of the integrator used by
LSD current regulator.
ComponentName TPCharacteristic = enum { pch 1 0, pch 1 0312, pch 1 0625, pch 1 0938,
pch 1 125, pch 1 1562, pch 1 1875, pch 1 2188, pch 0 9688, pch 0 9375, pch 0 9062, pch 0 875,
pch 0 8438, pch 0 8125, pch 0 7812} Proportional characteristic of the PI regulator for LSD.
ComponentName TICharacteristic = enum { ich 0 125, ich 0 25, ich 0 1875, ich 0 1562,
ich 0 3125, ich 0 0938, ich 0 0625, ich 0 0312} Integration characteristic of the PI regulator for
LSD.
ComponentName TLSDFrequency = enum { lf 3 9 KHZ, lf 4 5 KHZ, lf 5 0 KHZ, lf 4 2 KHZ,
lf 3 6 KHZ, lf 3 4 KHZ, lf 3 2 KHZ, lf 3 0 KHZ} PWM Frequency values used for LSD.
ComponentName TLSDSelection = enum { lsLSD14, lsLSD58} LSD group selection. Always
four LSDs have common PWM frequency setting.
ComponentName TControllerStatus = enum { csSUPERVISION, csDEVICE, csPD, csLS,
csLSD, csHS} Type of status information to be read (fault status, version of device, etc.).
ComponentName TDriverState = enum { dsOFF, dsON} State of valve controller driver.
ComponentName TDriverSelection = enum { dsPD, dsLD1, dsLD2, dsHD, dsHS, dsLD}
Selection of valve controller driver.
ComponentName TFaultSelection = enum { fsLSD, fsPD, fsLD1, fsLD2, fsLD, fsHD, fsHS,
fsALL} Selection of driver fault. It is intended to clear faults.

Valve Controller Programming Guide, Rev. 1.0


NXP Semiconductors 17
How to Reach Us: Information in this document is provided solely to enable system and software implementers to use NXP
products. There are no expressed or implied copyright licenses granted hereunder to design or fabricate any
Home Page:
NXP.com integrated circuits based on the information in this document. NXP reserves the right to make changes without

Web Support: further notice to any products herein.


http://www.nxp.com/support NXP makes no warranty, representation, or guarantee regarding the suitability of its products for any particular
purpose, nor does NXP assume any liability arising out of the application or use of any product or circuit, and
specifically disclaims any and all liability, including without limitation, consequential or incidental damages.
"Typical" parameters that may be provided in NXP data sheets and/or specifications can and do vary in different
applications, and actual performance may vary over time. All operating parameters, including "typicals," must be
validated for each customer application by the customer's technical experts. NXP does not convey any license
under its patent rights nor the rights of others. NXP sells products pursuant to standard terms and conditions of
sale, which can be found at the following address:
http://www.nxp.com/terms-of-use.html.

NXP, the NXP logo, Freescale and the Freescale logo are trademarks of NXP B.V. All other product or service
names are the property of their respective owners. All rights reserved.
© 2016 NXP B.V.

Document Number: PEXVALVECONTROLLERPUG


Rev. 1.0
2/2016

You might also like