Function API description PSF 90316 PTC04 DownloadLink 5001

PTC04 - PSF - MLX90316
Product Specific Function description
M L X 9 03 16 PRO D U CT
SPE C I FI C FU N C T I ON S
S OFTWARE L IBRARY
Revision: PSF90316 Rev 1.72
Date : 7 January 2008
Author : SKO
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
-1-
PTC04 - PSF - MLX90316
Product Specific Function description
1 Contents
1
CONTENTS .............................................................................................................................................................. 2
2
INTRODUCTION .................................................................................................................................................... 4
3
SOFTWARE STRUCTURE .................................................................................................................................... 4
3.1
3.2
3.3
4
MLX90316PSFMANAGER OBJECT .................................................................................................................... 6
4.1
5
Background......................................................................................................................................................... 6
MLX90316PSFDEVICE OBJECT.......................................................................................................................... 7
5.1
5.2
5.3
5.4
5.5
5.6
5.7
5.8
5.9
5.10
5.11
5.12
5.13
5.14
5.15
5.16
5.17
5.18
5.19
5.20
5.21
5.22
6
Object Model ...................................................................................................................................................... 4
Object Structure and Hierarchy .......................................................................................................................... 4
Objects with Interfaces ....................................................................................................................................... 5
Background......................................................................................................................................................... 7
Scope of the MLX90316PSFDevice object ........................................................................................................ 8
SelectedDevice Property..................................................................................................................................... 8
PTC04 Property .................................................................................................................................................. 9
Solver Property ................................................................................................................................................. 10
Advanced Property ........................................................................................................................................... 11
ReadFullDevice Method ................................................................................................................................... 11
ProgramDevice Method .................................................................................................................................... 12
GetEEParameterCode Method.......................................................................................................................... 13
SetEEParameterCode Method .......................................................................................................................... 14
GetEEParameterValue Method......................................................................................................................... 15
SetEEParameterValue Method ......................................................................................................................... 15
GetVdd Method ................................................................................................................................................ 16
GetIdd Method.................................................................................................................................................. 17
Measure Method ............................................................................................................................................... 18
GetAngle Method ............................................................................................................................................. 19
DeviceReplaced Method................................................................................................................................... 20
GetEEParameter Method .................................................................................................................................. 20
SetEEParameter Method................................................................................................................................... 20
GetAngleSPI Method........................................................................................................................................ 21
GetAngleSPIDouble Method ............................................................................................................................ 22
GetRoughOffset Method................................................................................................................................... 23
MLX90316PSFSOLVER OBJECT....................................................................................................................... 24
6.1
6.2
6.3
6.4
6.5
6.6
6.7
6.8
6.9
6.10
6.11
6.12
6.13
6.14
6.15
6.16
6.17
Background....................................................................................................................................................... 24
Scope ................................................................................................................................................................ 24
Solver procedure flow....................................................................................................................................... 25
SetCoordinateA Method ................................................................................................................................... 26
SetCoordinateB Method.................................................................................................................................... 26
SetCoordinateC Method.................................................................................................................................... 27
SetCoordinateD Method ................................................................................................................................... 28
SetSlopeS0 Method........................................................................................................................................... 29
SetSlopeA Method ............................................................................................................................................ 29
SetSlopeB Method ............................................................................................................................................ 29
SetSlopeC Method ............................................................................................................................................ 29
SetClamping Method ........................................................................................................................................ 30
SetRoughGain Method ..................................................................................................................................... 30
CharacterizeOutputDAC Method ..................................................................................................................... 31
CopySolverSettingsToParameters Method ....................................................................................................... 32
Memlock Method.............................................................................................................................................. 33
Comlock Method .............................................................................................................................................. 34
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
-2-
PTC04 - PSF - MLX90316
Product Specific Function description
7
MLX90316PSFADVANCED OBJECT ................................................................................................................ 35
7.1
7.2
7.3
7.4
7.5
7.6
7.7
7.8
7.9
7.10
7.11
7.12
7.13
7.14
7.15
7.16
7.17
7.18
7.19
7.20
7.21
7.22
7.23
7.24
7.25
7.26
7.27
7.28
7.29
7.30
7.31
7.32
7.33
7.34
7.35
7.36
7.37
8
ENUMERATION CONSTANTS .......................................................................................................................... 65
8.1
8.2
8.3
8.4
8.5
8.6
9
Background....................................................................................................................................................... 35
Scope of the MLX90316PSFAdvanced object ................................................................................................. 35
SetVdd Method ................................................................................................................................................. 35
SetVBat Method ............................................................................................................................................... 36
SelectDevice Method ........................................................................................................................................ 36
GetSetting Method ............................................................................................................................................ 37
SetSetting Method............................................................................................................................................. 38
SettingInUse Property....................................................................................................................................... 39
GetSolverSetting Method.................................................................................................................................. 40
SetSolverSetting Method .................................................................................................................................. 41
SolverSettingInUse Property ............................................................................................................................ 41
OpenProfile Method ......................................................................................................................................... 42
SaveProfile Method .......................................................................................................................................... 43
SaveProfileAs Method ...................................................................................................................................... 44
ReadFullRAM Method ..................................................................................................................................... 44
ProgramRAM Method ...................................................................................................................................... 45
GetRAMParameter Method .............................................................................................................................. 46
SetRAMParameter Method............................................................................................................................... 47
GetRAMParameterDirect Method .................................................................................................................... 47
SetRAMParameterDirect Method..................................................................................................................... 48
MemWriteWithCRC Method............................................................................................................................ 49
MemWrite Method ........................................................................................................................................... 50
MemRead Method ............................................................................................................................................ 51
ReadData Method ............................................................................................................................................. 52
WriteData Method ............................................................................................................................................ 53
StartCom Method.............................................................................................................................................. 54
SetDBMux Method........................................................................................................................................... 55
HotReset Method .............................................................................................................................................. 55
NopAlive Method ............................................................................................................................................. 56
HamWrite Method ............................................................................................................................................ 57
DisconnectDevice Method................................................................................................................................ 57
Logging Property .............................................................................................................................................. 58
ChipVersion Property ....................................................................................................................................... 59
CheckCRC Method........................................................................................................................................... 60
SPIDisconnect Method ..................................................................................................................................... 61
SentGetData Method......................................................................................................................................... 62
ReadChipVersion Method ................................................................................................................................ 63
ParamCodesEEPROM enumeration ................................................................................................................. 65
ParamCodesRAM enumeration ........................................................................................................................ 68
MeasureParameters enumeration ...................................................................................................................... 69
MeasureTypes enumeration .............................................................................................................................. 69
SettingCodes enumeration ................................................................................................................................ 70
SolverSettingCodes enumeration...................................................................................................................... 71
DISCLAIMER ........................................................................................................................................................ 72
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
-3-
PTC04 - PSF - MLX90316
Product Specific Function description
2 Introduction
MLX90316 PSF is MS Windows software library, which meets the requirements for a Product Specific
Functions (PSF) module, defined in Melexis Programmable Toolbox (MPT) object model. The library
implements in-process COM objects for interaction with MLX90316 firmware for Melexis PTC04 programmers.
It is designed primarily to be used by MPT Framework application, but also can be loaded as a standalone inprocess COM server by other applications that need to communicate with the above-mentioned Melexis
products.
3 Software Structure
3.1
Object Model
MPT object model specifies that a PSF module must expose two COM objects which implement certain COM
interfaces. MLX90316 PSF implements these two objects and two additional objects for advanced operations.
3.2
•
MLX90316PSFManager object – implements IPSFManager standard MPT interface. This is a standard
PSFManager object. MPT Framework and other client applications create a temporary instance of that
object, just for device scanning procedure. After that this instance is released.
This is the first required object. Refer to MPT Developer Reference document for more information about
PSFManager object and IPSFManager interface.
•
MLX90316PSFDevice object – implements IMLX90316PSFDevice specific interface. However, this
interface derives from IMPTDevice standard MPT interface and therefore MLX90316PSFDevice also
implements the functionality of MPTDevice standard MPT object. In addition to standard IMPTDevice
methods, IMLX90316PSFDevice interface exposes methods, which are specific to this library. They are
described in this document.
This is the second required COM object. Refer to MPT Developer Reference document for more
information about MPTDevice object and IMPTDevice interface.
•
MLX90316PSFAdvanced object – implements IMLX90316PSFAdvanced library specific interface.
This object implements advanced functions that would be rarely used in order to perform specific
operations not available with the standard device functions. In general, most of the methods of that object
provide direct access to MLX90316 firmware commands implemented in PTC04 programmer.
•
MLX90316PSFSolver object - implements IMLX90316PSFSolver library specific interface. This object
provides methods to easy tune your product in your application
Object Structure and Hierarchy
MLX90316PSFManager
MLX90316PSFDevice
MLX90316 PSF Library Object Model
Rev.1.72
Solver
MLX90316PSFSolver
Advanced
MLX90316PSFAdvanced
PTC04
PTC04PSFDevice
7 Jan 2008
-4-
PTC04 - PSF - MLX90316
Product Specific Function description
3.3
Objects with Interfaces
IMLX90316PSFDevice
IPSFManager
IMPTDevice
IDispatch
IDispatch
MLX90316PSF
Device
MLX90316PSF
Manager
MLX90316PSF
Solver
ISpecifyPropertyPages
ISupportErrorInfo
IPersist
IMLX90316PSFSolver
IMLX90316PSFAdvanced
ISupportErrorInfo
IDispatch
IPTC04PSFDevice
ISupportErrorInfo
MLX90316PSF
Advanced
ISupportErrorInfo
IDispatch
IMPTDevice
IDispatch
PTC04PSF
Device
ISupportErrorInfo
ISpecifyPropertyPages
IPersist
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
-5-
PTC04 - PSF - MLX90316
Product Specific Function description
4 MLX90316
MLX90316PSFManager
316PSFManager Object
4.1
Background
This object is created only once and is destroyed when the library is unmapped from process address space. Each
subsequent request for this object returns the same instance.
MLX90316PSFManager object implements standard MPT category CATID_MLXMPTPSFSerialModule,
which is required for automatic device scanning. C++ standalone client applications can create an instance of
this object by using the standard COM API CoCreateInstance with class ID CLSID_MLX90316PSFManager,
or ProgID “MPT. MLX90316PSFManager”:
hRes = ::CoCreateInstance(CLSID_MLX90316PSFManager, NULL, CLSCTX_INPROC,
IID_IPSFManager, (void**) &pPSFMan);
Visual Basic applications should call CreateObject function to instantiate MLX90316PSFManager:
Set PSFMan = CreateObject(“MPT. MLX90316PSFManager”)
The primary objective of this instantiation is to call ScanStandalone method. C++:
hRes = pPSFMan->ScanStandalone(dtSerial, varDevices, &pDevArray);
Or in Visual Basic:
Set DevArray = PSFMan.ScanStandalone(dtSerial)
ScanStandalone function returns collection of MLX90316PSFDevice objects, one for each connected PTC-04
programmer. The collection is empty if there are no connected programmers.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
-6-
PTC04 - PSF - MLX90316
Product Specific Function description
5 MLX90316
MLX90316PSF
316PSFDevice
PSFDevice Object
5.1
Background
This object implements standard MPT category CATID_MLXMPTPSFSerialDevice as well as library specific
CATID_MLXMPT90316Device
category.
It
also
declares
required
specific
category
CATID_MLXMPT90316UIModule for identification of required user interface modules.
This object can be created directly with CoCreateInstance/CreateObject or by calling the device scanning
procedure ScanStandalone of MLX90316PSFManager object. The following Visual Basic subroutine shows how
to instantiate MLX90316PSFDevice object by performing device scan on the system:
Sub CreateDevice()
Dim PSFMan As MLX90316PSFManager, DevicesCol As ObjectCollection, I As Long
On Error GoTo lError
Set PSFMan = CreateObject("MPT.MLX90316PSFManager")
Set DevicesCol = PSFMan.ScanStandalone(dtSerial)
If DevicesCol.Count <= 0 Then
MsgBox ("No PTC-04 programmers found!")
Exit Sub
End If
' Dev is a global variable of type MLX90316PSFDevice
‘ Select first device from the collection
Set Dev = DevicesCol(0)
MsgBox (Dev.Name & " device found on " & Dev.Channel.Name)
If DevicesCol.Count > 1 Then
For I = 1 To DevicesCol.Count - 1
' We are responsible to call Destroy(True) on the device objects we do not need
Call DevicesCol(I).Destroy(True)
Next I
End If
Exit Sub
lError:
MsgBox Err.Description
Err.Clear
End Sub
Developers can also manually connect the device object to a serial channel object thus bypassing standard device
scanning procedure. The following Visual Basic subroutine allows manual connection along with standard
device scanning depending on input parameter bAutomatic:
Sub CreateDevice(bAutomatic As Boolean)
Dim PSFMan As MLX90316PSFManager, DevicesCol As ObjectCollection, I As Long
Dim CommMan As CommManager, Chan As MPTChannel
On Error GoTo lError
If bAutomatic Then
' Automatic device scanning begins here
Set PSFMan = CreateObject("MPT.MLX90316PSFManager")
Set DevicesCol = PSFMan.ScanStandalone(dtSerial)
If DevicesCol.Count <= 0 Then
MsgBox ("No PTC-04 programmers found!")
Exit Sub
End If
If DevicesCol.Count > 1 Then
For I = 1 To DevicesCol.Count - 1
'We are responsible to call Destroy(True) on device objects we do not need
Call DevicesCol(I).Destroy(True)
Next I
End If
Set MyDev = DevicesCol(0)
Else
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
-7-
PTC04 - PSF - MLX90316
Product Specific Function description
' Manual connection begins here
Set CommMan = CreateObject("MPT.CommManager")
Set MyDev = CreateObject("MPT.MLX90316PSFDevice")
I = ActiveWorkbook.Names("SerialPort").RefersToRange.Value2
Set Chan = CommMan.Channels.CreateChannel(CVar(I), ctSerial)
MyDev.Channel = Chan
' Check if a PTC04 programmer is connected to this channel
Call MyDev.CheckSetup(False)
End If
MsgBox (MyDev.Name & " programmer found on " & MyDev.Channel.Name)
Exit Sub
lError:
MsgBox Err.Description
Err.Clear
End Sub
MLX90316PSFDevice object implements IMPTDevice standard MPT interface. Please refer to MPT Developer
reference document for description of the properties and methods of this interface.
In addition MLX90316PSFDevice object implements IMLX90316PSFDevice library specific interface, which
derives from IMPTDevice. The following is a description of its properties and methods.
5.2
Scope of the MLX90316PSFDevice object
This object supports all needs for a standard user.
With these basic functions, you’re able to discover this Melexis Product.
5.3
Selected
SelectedDevice
edDevice Property
5.3.1
Description
Specifies what die to be used by subsequent operations: It’s a soft switch, meaning that there is not an immediate
action visible on hardware.
All functions implemented in the library use the SelectedDevice property to determine what die (A or B) you‘re
working with. It also concerns settings as for example SetParameter.
DEFAULT: when never used, die A is selected.
5.3.2
Syntax
Visual Basic:
Property SelectedDevice as Long
C++:
HRESULT get_SelectedDevice(/*[out,retval]*/ int* pValue);
HRESULT set_SelectedDevice(/*[in]*/ int Value);
5.3.3
Parameters
Value
A int specifying new value for the property. 1 selects die A and 2 selects die B.
pValue
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
-8-
PTC04 - PSF - MLX90316
Product Specific Function description
An address of int variable that receives current value of the property. 1 specifies that die A is currently
selected and 2 specifies that die B is currently selected.
5.3.4
Return value
Visual Basic:
1 if die A is currently selected or 2 if die B is currently selected.
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully. *pValue contains valid number.
Any other error code
The operation failed.
5.3.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
5.4
PTC04 Property
5.4.1
Description
This property holds a reference to PTC04PSFDevice co-object.
5.4.2
Syntax
Visual Basic:
Property PTC04 as Object
C++:
HRESULT get_PTC04(/*[out][retval]*/ LPDISPATCH* pVal);
HRESULT set_PTC04(/*[in]*/ LPDISPATCH Value);
5.4.3
Parameters
Value
An IDispatch* specifying new PTC04 object. Nothing happens if the object is the same instance as the
existing one. Otherwise MLX90316PSFDevice object releases its current PTC04 object and connects to
the new one. This also includes replacing of the communication Channel object with the one from the
new PTC04 object.
pVal
Address of IDispatch* pointer variable that receives the interface pointer to the PTC04 device object. If
the invocation succeeds, the caller is responsible for calling IUnknown::Release() on the pointer when it
is no longer needed.
5.4.4
Return value
Visual Basic:
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
-9-
PTC04 - PSF - MLX90316
Product Specific Function description
A reference to the PTC04 co-object.
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully. *pVal contains valid pointer.
Any other error code
The operation failed. *pVal contains NULL.
5.4.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.
5.5
Solver Property
5.5.1
Description
This is a read-only property which returns a reference to MLX90316PSFSolver co-object.
5.5.2
Syntax
Visual Basic:
Property Solver as Object
Read only
C++:
HRESULT get_Solver(/*[out][retval]*/ IMLX90316PSFSolver** pVal);
5.5.3
Parameters
pVal
Address of IMLX90316PSFSolver* pointer variable that receives the interface pointer to the Solver
object. If the invocation succeeds, the caller is responsible for calling IUnknown::Release() on the
pointer when it is no longer needed.
5.5.4
Return value
Visual Basic:
A reference to the Solver co-object.
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully. *pVal contains a valid pointer.
Any other error code
The operation failed. *pVal contains NULL.
5.5.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 10 -
PTC04 - PSF - MLX90316
Product Specific Function description
5.6
Advanced Property
5.6.1
Description
This is a read-only property which returns a reference to MLX90316PSFAdvanced co-object.
5.6.2
Syntax
Visual Basic:
Property Advanced as Object
Read only
C++:
HRESULT get_Advanced(/*[out][retval]*/ IMLX90316PSFAdvanced* pVal);
5.6.3
Parameters
pVal
Address of IMLX90316PSFAdvanced* pointer variable that receives the interface pointer to the
Advanced object. If the invocation succeeds, the caller is responsible for calling IUnknown::Release()
on the pointer when it is no longer needed.
5.6.4
Return value
Visual Basic:
A reference to the Advanced co-object.
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully. *pVal contains a valid pointer.
Any other error code
The operation failed. *pVal contains NULL.
5.6.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
5.7
ReadFullDevice Method
5.7.1
Description
Reads the whole EEPROM of MLX90316. Updates the internal EEPROM cache with values taken from the
chip. This method is provided to speed up the performance because it updates the whole cache with a single
command.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 11 -
PTC04 - PSF - MLX90316
Product Specific Function description
5.7.2
Syntax
Visual Basic:
Sub ReadFullDevice()
C++:
HRESULT ReadFullDevice();
5.7.3
Parameters
None
5.7.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
5.7.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
5.8
ProgramDevice Method
5.8.1
Description
Writes the whole EEPROM of MLX90316. Takes the values from the internal EEPROM cache.
Only the variables that are modified will be programmed.
5.8.2
Syntax
Visual Basic:
Sub ProgramDevice()
C++:
HRESULT ProgramDevice();
5.8.3
Parameters
None
5.8.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 12 -
PTC04 - PSF - MLX90316
Product Specific Function description
Return value
S_OK
Any other error code
5.8.5
Meaning
The operation completed successfully.
The operation failed.
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
5.9
GetEEParameterCode Method
5.9.1
Description
Returns the code of a particular EEPROM parameter as it is represented in EEPROM. It is optimized because it
uses the EEPROM cache maintained by the library. ReadFullDevice method could be called before calling
GetEEParameterCode to update the whole cache. However GetEEParameterCode works correctly even if
ReadFullDevice is not called.
5.9.2
Syntax
Visual Basic:
Function GetEEParameterCode(paramID as ParamCodesEEPROM)
C++:
HRESULT GetEEParameterCode(/*[in]*/ ParamCodesEEPROM paramID, /*[out,retval]*/
TVariant* pVal);
5.9.3
Parameters
paramID
A ParamCodesEEPROM constant specifying the ID of the EEPROM parameter.
pVal
An address of VARIANT variable that will receive the return value of the method. The caller is
responsible to call VariantClear on that variable when it is no longer needed. The values are represented
as bytes or unsigned integers depending on the parameter.
5.9.4
Return value
Visual Basic:
A Variant containing the code of an EEPROM parameter.
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully. *pVal contains a valid value.
Any other error code
The operation failed. *pVal is Empty.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 13 -
PTC04 - PSF - MLX90316
Product Specific Function description
5.9.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
5.10
SetEEParameterCode Method
5.10.1
Description
Changes the code of a particular EEPROM parameter. The method works with the EEPROM cache maintained
by the library.
ProgramDevice method must be called in order to update the EEPROM of the chip with the codes from the
cache.
5.10.2
Syntax
Visual Basic:
Sub SetEEParameterCode(paramID as ParamCodesEEPROM, Value)
C++:
HRESULT SetEEParameterCode(/*[in]*/ ParamCodesEEPROM paramID, /*[in]*/
TVariantInParam Value);
5.10.3
Parameters
paramID
A ParamCodesEEPROM constant specifying the ID of the EEPROM parameter.
Value
A VARIANT containing new code for the parameter.
5.10.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
5.10.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 14 -
PTC04 - PSF - MLX90316
Product Specific Function description
5.11
GetEEParameterV
GetEEParameterValue Method
5.11.1
Description
Returns the translated value of a particular EEPROM parameter. It first calls GetEEParameterCode method
and then translates the code of the parameter into a suitable value. For example, the parameter EE_LNR_A_X is
translated into a floating point number which represents degrees.
Translation is not defined for all parameters and this method returns an error if it receives paramID which is not
supported.
5.11.2
Syntax
Visual Basic:
Function GetEEParameterValue(paramID as ParamCodesEEPROM)
C++:
HRESULT GetEEParameterValue(/*[in]*/ ParamCodesEEPROM paramID, /*[out,retval]*/
TVariant* pVal);
5.11.3
Parameters
paramID
A ParamCodesEEPROM constant specifying the ID of the EEPROM parameter.
pVal
An address of VARIANT variable that will receive the return value of the method. The caller is
responsible to call VariantClear on that variable when it is no longer needed.
5.11.4
Return value
Visual Basic:
A Variant containing the translated value of an EEPROM parameter.
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully. *pVal contains a valid value.
Any other error code
The operation failed. *pVal is Empty.
5.11.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
5.12
SetEEParameterValue
SetEEParameterValue Method
5.12.1
Description
Changes the value of a particular EEPROM parameter. It first translates the value to a corresponding code and
then calls SetEEParameterCode method to modify the parameter in the cache. For example, this method
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 15 -
PTC04 - PSF - MLX90316
Product Specific Function description
expects the parameter EE_LNR_A_X to be a floating point number which will be translated into a 2-byte code
which can be stored into the EEPROM.
Translation is not defined for all parameters and this method returns an error if it receives paramID which is not
supported.
ProgramDevice method must be called in order to update the EEPROM of the chip with the codes from the
cache.
5.12.2
Syntax
Visual Basic:
Sub SetEEParameter(paramID as ParamCodesEEPROM, Value)
C++:
HRESULT SetEEParameter(/*[in]*/ ParamCodesEEPROM paramID, /*[in]*/
TVariantInParam Value);
5.12.3
Parameters
paramID
A ParamCodesEEPROM constant specifying the ID of the EEPROM parameter.
Value
A VARIANT containing new value for the parameter.
5.12.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
5.12.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
5.13
GetVdd Method
5.13.1
Description
Measures the VDD value of the selected device. Returns the value in a calibrated Voltage signal.
5.13.2
Syntax
Visual Basic:
Function GetVdd() as Single
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 16 -
PTC04 - PSF - MLX90316
Product Specific Function description
C++:
HRESULT GetVdd(/*[out,retval]*/ float* pVal);
5.13.3
Parameters
pVal
An address of float variable that will receive the return value of the method.
5.13.4
Return value
Visual Basic:
A Single containing the VDD value of the selected device.
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully. *pVal contains a valid value.
Any other error code
The operation failed. *pVal is zero.
5.13.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
5.14
GetIdd Method
5.14.1
Description
Measures the IDD value of the selected device.
5.14.2
Syntax
Visual Basic:
Function GetIdd() as Single
C++:
HRESULT GetIdd(/*[out,retval]*/ float* pVal);
5.14.3
Parameters
pVal
An address of float variable that will receive the return value of the method.
5.14.4
Return value
Visual Basic:
A Single containing the IDD value of the selected device.
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully. *pVal contains a valid value.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 17 -
PTC04 - PSF - MLX90316
Product Specific Function description
Any other error code
5.14.5
The operation failed. *pVal is zero.
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
5.15
Measure Method
5.15.1
Description
Measures the resp. signal on the selected device and returns the value in %VDD or Absolute value or PWM. It is
important the relays controlling PWM or Voltage measurements (bits 2 and 3 of DB-IO byte accordingly for
DieA and DieB; PWM is on when the bit=1) to be properly set in advance. This can be done by the following
code fragments:
Visual Basic:
btDBIO = PTC.GetDBIO
If bPWM Then
btDBIO = btDBIO Or 4 Or 8
Else
btDBIO = btDBIO And (Not (4 Or 8))
End If
Call PTC.SetDBIO(btDBIO)
C++:
pPTC->GetDBIO(&btDBIO);
if (bPWM)
btDBIO |= (1 << 2) | (1 << 3);
else
btDBIO &= ~((1 << 2) | (1 << 3));
pPTC->SetDBIO(btDBIO);
5.15.2
Syntax
Visual Basic:
Function Measure(paramOut as MeasureParameters, paramType as MeasureTypes) as Single
C++:
HRESULT Measure(/*[in]*/ MeasureParameters paramOut, /*[in]*/ MeasureTypes
paramType, /*[out,retval]*/ float* pVal);
5.15.3
Parameters
paramID
A MeasureParameters constant specifying the output to measure.
paramID
A MeasureTypes constant specifying the type of measurement.
pVal
An address of float variable that will receive the return value of the method.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 18 -
PTC04 - PSF - MLX90316
Product Specific Function description
5.15.4
Return value
Visual Basic:
A Single containing the result of measurement.
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully. *pVal contains a valid value.
Any other error code
The operation failed. *pVal is zero.
5.15.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
5.16
GetAngle
GetAngle Method
5.16.1
Description
Looks into the RAM, gets the measured angle (RAM address 18h) and converts it into Degrees – 0 till
359.999999.
5.16.2
Syntax
Visual Basic:
Function GetAngle() as Single
C++:
HRESULT GetAngle(/*[out,retval]*/ float* pfAngle);
5.16.3
Parameters
pfAngle
An address of float variable that will receive the return value of the method in Degrees.
5.16.4
Return value
Visual Basic:
A Single containing the modified angle in Degrees.
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully. *pfAngle contains a valid value.
Any other error code
The operation failed. *pfAngle is zero.
5.16.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 19 -
PTC04 - PSF - MLX90316
Product Specific Function description
5.17
DeviceReplaced Method
5.17.1
Description
Informs the object that the sensor is replaced and the EEPROM cache and some internal variables should be
invalidated. Only the selected device is taken into account.
5.17.2
Syntax
Visual Basic:
Sub DeviceReplaced()
C++:
HRESULT DeviceReplaced();
5.17.3
Parameters
None
5.17.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
5.17.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
5.18
GetEEParameter Method
5.18.1
Description
This function is obsolete and should not be used. It is superseded by GetEEParameterCode method.
5.18.2
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
5.19
SetEEParameter Method
5.19.1
Description
This function is obsolete and should not be used. It is superseded by SetEEParameterCode method.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 20 -
PTC04 - PSF - MLX90316
Product Specific Function description
5.19.2
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
5.20
GetAngleSPI Method
5.20.1
Description
Reads the current angle code from the current die of the sensor trough the SPI interface, and converts it into
Degrees – 0 till 359.999999.
5.20.2
Syntax
Visual Basic:
Function GetAngleSPI(Optional Cfg as Byte = 0, Optional ByRef pError as Integer) as Single
C++:
HRESULT GetAngleSPI(/*[in,opt,default(0)]*/ unsigned char Cfg, /*[out,opt]*/ short* pError,
/*[out,retval]*/ float* pfAngle);
5.20.3
Parameters
Cfg
A Byte, specifying the actions before reading SPI data.
- CFG = 0 : no POR; No Sync (Default). If the sensor has been reseted, the software will automatically
do POR+Sync.
- CFG =1 : Run POR + Sync
- CFG =2 : only Sync
pError
An address of Integer(short) variable that will receive the error flags from the sensor. In case the address
is NULL, the value is not returned.
pfAngle
An address of float variable that will receive the return value of the method in Degrees.
5.20.4
Return value
Visual Basic:
A Single containing the angle in Degrees.
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully. *pfAngle contains a valid value.
Any other error code
The operation failed. *pfAngle is zero.
5.20.5
Quick Info
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 21 -
PTC04 - PSF - MLX90316
Product Specific Function description
Header: Declared in MLX90316PSFModule_TLB.h.
5.21
GetAngleSPIDouble Method
Method
5.21.1
Description
Reads the current angle codes from both dies of a double die sensor through the SPI interface, and converts them
into Degrees – 0 till 359.999999. This method is accessible only if appropriate key is set in the PSF.
5.21.2
Syntax
Visual Basic:
Sub GetAngleSPIDouble(Optional Cfg as Byte = 0, Optional ByRef pError1 as Integer,
Optional ByRef pError2 as Integer, ByRef pAngle1 as Single, ByRef pAngle2 as Single)
C++:
HRESULT GetAngleSPIDouble(/*[in,opt,default(0)]*/ unsigned char Cfg, /*[out,opt]*/ short*
pError1, /*[out,opt]*/ short* pError2, /*[out]*/ float* pAngle1, /*[out]*/ float*
pAngle2);
5.21.3
Parameters
Cfg
A Byte, specifying the actions before reading SPI data.
- CFG = 0 : no POR; No Sync (Default). If the sensor has been reseted, the software will automatically
do POR+Sync.
- CFG =1 : Run POR + Sync
- CFG =2 : only Sync
pError1
An address of Integer(short) variable that will receive the error flags from the die1 of the sensor. In case
the address is NULL, the value is not returned.
pError2
An address of Integer(short) variable that will receive the error flags from the die2 of the sensor. In case
the address is NULL, the value is not returned.
pAngle1
An address of float variable that will receive the angle of die1 in Degrees.
pAngle2
An address of float variable that will receive the angle of die2 in Degrees.
5.21.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully. *pAngle1 and *pAngle2 contains a
valid value.
Any other error code
The operation failed. *pAngle1 and *pAngle2 are zeroes.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 22 -
PTC04 - PSF - MLX90316
Product Specific Function description
5.21.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
5.22
GetRoughOffset Method
5.22.1
Description
This method returns rough offset code. For MLX90316BF and earlier it reads the code directly from RAM of the
device. For MLX90316CxL it has special implementation for getting the code.
5.22.2
Syntax
Visual Basic:
Function GetRoughOffset() As Long
C++:
HRESULT GetRoughOffset(/*[out,retval]*/ long* Code);
5.22.3
Parameters
Code
An address of long variable that will receive the return code of the method. ROUGHOFFSETX is in bits
(7-0) and ROUGHOFFSETY is in bits (15-8).
5.22.4
Return value
Visual Basic:
A Long containing the return code. ROUGHOFFSETX is in bits (7-0) and ROUGHOFFSETY is in
bits (15-8).
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully. *Code contains a valid value.
Any other error code
The operation failed. *Code is zero.
5.22.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 23 -
PTC04 - PSF - MLX90316
Product Specific Function description
6 MLX90316PSFSolver
MLX90316PSFSolver Object
6.1
Background
This object cannot be created directly; it is only accessible as “Solver” property of MLX90316PSFDevice object.
MLX90316PSFSolver object implements IMLX90316PSFSolver library specific interface. The following is a
description of its methods.
6.2
Scope
This object provides services to easy tune your product in your application.
When these functions are not fully serving your needs, you can check with your application contact into Melexis
how to get support.
Note: By using the MLX90316PSFDevice object, you’re always able to do everything what you want.
The methods below are based on following calibration principle:
Idea is that point A is the first point that is mechanical positioned.
Figure 6-1
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 24 -
PTC04 - PSF - MLX90316
Product Specific Function description
6.3
Solver procedure flow
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 25 -
PTC04 - PSF - MLX90316
Product Specific Function description
6.4
SetCoo
SetCoordinateA Method
6.4.1
Description
When the mechanical position is set to position A, this function will make the INITIALISATION for solving this
device.
Actions:
* This function will use the Angle parameter to calculate the DP point
* It will store the X and Y coordinates of point A to the device
* It will clear (means FFFF) the coordinates for point B, C, D
* It will clear (means 0) all the slopes S0, SA, SB and SC
NOTE: Also for all solver functions, only the selected device is taken into account!
6.4.2
Syntax
Visual Basic:
Sub SetCoordinateA(Level as Single, Angle as Single)
C++:
HRESULT SetCoordinateA(/*[in]*/ float Level, /*[in]*/ float Angle);
6.4.3
Parameters
Level
A Single specifying Y coordinate of point A in %VDD (from 0.0 to 100.0).
Angle
A Single specifying X position of point A in degrees.
6.4.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
6.4.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
6.5
SetCo
SetCoordinateB Method
6.5.1
Description
This method is called when the mechanical position is set to position B. It will treat next action:
* This gets the current angle by asking the device for it
* It will store the X and Y coordinates of point B to the device
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 26 -
PTC04 - PSF - MLX90316
Product Specific Function description
* It will calculate the Slope for A and copy it to the slope for B and C
NOTE: Also for all solver functions, only the selected device is taken in account!
6.5.2
Syntax
Visual Basic:
Sub SetCoordinateB(Level as Single)
C++:
HRESULT SetCoordinateB(/*[in]*/ float Level);
6.5.3
Parameters
Level
A Single specifying Y coordinate of point B in %VDD (from 0.0 to 100.0).
6.5.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
6.5.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
6.6
SetCo
SetCoordinateC Method
6.6.1
Description
This method is called when the mechanical position is set to position C. It will treat next action:
* This gets the current angle by asking the device for it
* It will store the X and Y coordinates of point C to the device
* It will calculate the Slope for B and copy it to the slope C
NOTE: Also for all solver functions, only the selected device is taken in account!
NOTE: If this step is not executed, no problem will appear. This can happen in the case of a two points solver.
6.6.2
Syntax
Visual Basic:
Sub SetCoordinateC(Level as Single)
C++:
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 27 -
PTC04 - PSF - MLX90316
Product Specific Function description
HRESULT SetCoordinateC(/*[in]*/ float Level);
6.6.3
Parameters
Level
A Single specifying Y coordinate of point C in %VDD (from 0.0 to 100.0).
6.6.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
6.6.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
6.7
SetCoo
SetCoordinateD Method
6.7.1
Description
This method is called when the mechanical position is set to position D. It will treat next action:
* This gets the current angle by asking the device for it
* It will calculate the Slope for C
NOTE: Also for all solver functions, only the selected device is taken in account!
NOTE: If this step is not executed, no problem will appear. This can happen in the case of a two points solver.
NOTE: This point also can be a fictive point, overwriting the slope for C can be done with the function
SetSlopeC.
6.7.2
Syntax
Visual Basic:
Sub SetCoordinateD(Level as Single)
C++:
HRESULT SetCoordinateD(/*[in]*/ float Level);
6.7.3
Parameters
Level
A Single specifying Y coordinate of point D in %VDD (from 0.0 to 100.0).
6.7.4
Return value
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 28 -
PTC04 - PSF - MLX90316
Product Specific Function description
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
6.7.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
6.8
SetSlopeS0 Method
6.9
SetSlopeA Method
Method
6.10
SetSlopeB
SetSlopeB Method
6.11
SetSlopeC Method
6.11.1
Description
When you need a specific or fixed slope for resp A, B, C or S0, you can overwrite an eventual calculated slope
with this function.
6.11.2
Syntax
Visual Basic:
Sub SetSlopeA(Slope as Single)
C++:
HRESULT SetSlopeA(/*[in]*/ float Slope);
6.11.3
Parameters
Slope
A Single specifying slope to overwrite default or calculated slope in [%VDD / DEG].
6.11.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 29 -
PTC04 - PSF - MLX90316
Product Specific Function description
6.11.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
6.12
SetClamping
SetClamping Method
6.12.1
Description
With this method, you can fix the levels for Clamping High \ Low. Usually this is the last step of the solver
procedure.
NOTE: Also for all solver functions, only the selected device is taken in account!
6.12.2
Syntax
Visual Basic:
Sub SetClamping(LowLevel as Single, HighLevel as Single)
C++:
HRESULT SetClamping(/*[in]*/ float LowLevel, /*[in]*/ float HighLevel);
6.12.3
Parameters
LowLevel
A Single specifying low clamping level in %VDD (from 0.0 to 100.0).
HighLevel
A Single specifying high clamping level in %VDD (from 0.0 to 100.0).
6.12.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
6.12.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
6.13
SetRoughGain Method
6.13.1
Description
Iterates over all available rough gain values (0->15) and then selects the best one for which FG=50%. Usually
this method is called just before SetCoordinateA method.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 30 -
PTC04 - PSF - MLX90316
Product Specific Function description
6.13.2
Syntax
Visual Basic:
Sub SetRoughGain()
C++:
HRESULT SetRoughGain();
6.13.3
Parameters
None
6.13.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
6.13.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
6.14
CharacterizeOutputDAC Method
6.14.1
Description
With this method, you can measure and calculate coefficients (OutputDacGain;OutputDacOffset) for level
correction. The following is a detailed description of the steps:
1.
2.
3.
4.
Set Clamp Low\High to 5% and measure point1
Set Clamp Low\High to 95% and measure point2
Calculate to get OutputDacGain and OutputDacOffset
Set Clamp low = 0% and Clamp high = 100%
All subsequent calls to SetEEParameterValue method will calculate the level value to store in the EEPROM by
using the following formula:
DAC_Value_EEPROM [%VDD] = Requested_DAC_Value [%VDD] * Gain + Offset
All subsequent calls to GetEEParameterValue method will calculate the level value from that in the EEPROM
by using the following formula:
Returned_DAC_Value [%VDD] = (DAC_Value_EEPROM [%VDD] – Offset) / Gain
NOTE: Also for all solver functions, only the selected die is taken in account!
NOTE: Gain and Offset coefficients can be read or write directly with GetSolverSetting and SetSolverSetting
functions, setting codes SolverSettingOutputDACGain and SolverSettingOutputDACOffset
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 31 -
PTC04 - PSF - MLX90316
Product Specific Function description
NOTE: Gain and Offset coefficients can be set to 1.0 and 0.0 respectively with a call to DeviceReplaced
method
6.14.2
Syntax
Visual Basic:
Sub CharacterizeOutputDAC()
C++:
HRESULT CharacterizeOutputDAC();
6.14.3
Parameters
None
6.14.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
6.14.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
6.15
CopySolverSettingsToParameters Method
6.15.1
Description
Copies all Solver settings (without Solver targets) to corresponding parameters in the EEPROM cache. Thus, a
client application could use just a profile to read the settings, optionally modify some of them and then do
CopySolverSettingsToParameters to set them in the EEPROM cache. This method should be called before
CharacterizeOutputDAC and SetRoughGain methods.
6.15.2
Syntax
Visual Basic:
Sub CopySolverSettingsToParameters()
C++:
HRESULT CopySolverSettingsToParameters();
6.15.3
Parameters
None
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 32 -
PTC04 - PSF - MLX90316
Product Specific Function description
6.15.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
6.15.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
6.16
Memlock Method
6.16.1
Description
Locks the EEPROM of the selected die. Such EEPROM cannot be modified anymore but can be read. Usually
this is the last step of the calibration procedure.
6.16.2
Syntax
Visual Basic:
Sub Memlock()
C++:
HRESULT Memlock();
6.16.3
Parameters
None
6.16.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
6.16.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 33 -
PTC04 - PSF - MLX90316
Product Specific Function description
6.17
Comlock Method
6.17.1
Description
This method disables further communication with the device.
6.17.2
Syntax
Visual Basic:
Sub Comlock()
C++:
HRESULT Comlock();
6.17.3
Parameters
None
6.17.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
6.17.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 34 -
PTC04 - PSF - MLX90316
Product Specific Function description
7 MLX90316PSFAdvanced
MLX90316PSFAdvanced Object
7.1
Background
This object cannot be created directly; it is only accessible as “Advanced” property of MLX90316PSFDevice
object.
MLX90316PSFAdvanced object implements IMLX90316PSFAdvanced library specific interface. The following
is a description of its methods.
7.2
Scope of the MLX90316PSFAdvanced object
This object implements advanced functions that would be rarely used in order to perform specific operations not
available with the standard device functions. In general, most of the methods of that object provide direct access
to MLX90316 firmware commands, implemented in PTC04 programmer.
7.3
SetVdd Method
7.3.1
Description
Changes the VDD of MLX90316. This applies only to the selected die.
NOTE: Most of the PTC04 firmware commands manipulate VDD, thus the voltage set by this method is valid
until the next command is sent to the programmer. SetSetting method must be used if persistent voltage is
needed.
7.3.2
Syntax
Visual Basic:
Sub SetVdd(fVdd as Single)
C++:
HRESULT SetVdd(/*[in]*/ float fVdd);
7.3.3
Parameters
fVdd
A Single specifying new VDD in voltages.
7.3.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 35 -
PTC04 - PSF - MLX90316
Product Specific Function description
7.3.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.4
SetVBat Method
7.4.1
Description
Changes the VBat voltage of MLX90316 (PPS3 of PTC04). This applies to both dies.
NOTE: Many of the PTC04 firmware commands manipulate VBat, thus the voltage set by this method must be
considered valid until the next command is sent to the programmer. SetSetting method must be used if persistent
voltage is needed.
7.4.2
Syntax
Visual Basic:
Sub SetVBat(fVBat as Single)
C++:
HRESULT SetVBat(/*[in]*/ float fVBat);
7.4.3
Parameters
fVBat
A Single specifying new VBat in voltages.
7.4.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
7.4.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.5
SelectDevice Method
7.5.1
Description
Immediately sends the SelectDevice command to PTC04 programmer.
7.5.2
Syntax
Visual Basic:
Sub SelectDevice(nDev as Long)
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 36 -
PTC04 - PSF - MLX90316
Product Specific Function description
C++:
HRESULT SelectDevice(/*[in]*/ int nDev);
7.5.3
Parameters
nDev
A Long specifying die A (1) or B (2).
7.5.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
7.5.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.6
GetSetting Method
7.6.1
Description
Returns the value of a particular setting.
7.6.2
Syntax
Visual Basic:
Function GetSetting(settingID as SettingCodes)
C++:
HRESULT GetSetting(/*[in]*/ SettingCodes settingID, /*[out,retval]*/ TVariant* pVal);
7.6.3
Parameters
settingID
A SettingCodes constant specifying the ID of the setting.
pVal
An address of VARIANT variable that will receive the return value of the method. The caller is
responsible to call VariantClear on that variable when it is no longer needed.
7.6.4
Return value
Visual Basic:
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 37 -
PTC04 - PSF - MLX90316
Product Specific Function description
A Variant containing the value of a setting.
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully. *pVal contains valid value.
Any other error code
The operation failed. *pVal is Empty.
7.6.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.7
SetSetting
SetSetting Method
7.7.1
Description
Changes the value of a particular setting. Sets an associated internal variable. The setting is also sent
immediately to PTC04 programmer.
NOTE: If necessary, the changes can be saved in the profile with a subsequent call to SaveProfile or
SaveProfileAs methods.
7.7.2
Syntax
Visual Basic:
Sub SetSetting(settingID as SettingCodes, Value)
C++:
HRESULT SetSetting(/*[in]*/ SettingCodes settingID, /*[in]*/ TVariantInParam Value);
7.7.3
Parameters
settingID
A SettingCodes constant specifying the ID of the setting to modify.
Value
A VARIANT containing new value for the setting.
7.7.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 38 -
PTC04 - PSF - MLX90316
Product Specific Function description
7.7.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.8
SettingInUse Property
7.8.1
Description
Specifies if the setting will be stored in the profile when SaveProfile or SaveProfileAs methods are called.
These usage flags are also updated by OpenProfile method – a certain setting is marked as “used” if it exists in
the profile being opened, otherwise it is marked as unused and a default value is assigned to the setting itself.
7.8.2
Syntax
Visual Basic:
Property SettingInUse(settingID as SettingCodes) as Boolean
C++:
HRESULT get_SettingInUse(/*[in]*/ SettingCodes settingID, /*[out,retval]*/
VARIANT_BOOL* pValue);
HRESULT set_SettingInUse(/*[in]*/ SettingCodes settingID, /*[in]*/ VARIANT_BOOL Value);
7.8.3
Parameters
settingID
A SettingCodes constant specifying the ID of the setting to get or modify its usage.
pValue
An address of VARIANT_BOOL variable that receives current value of the property.
VARIANT_TRUE means that the associated setting is used, VARIANT_FALSE means unused.
Value
A VARIANT_BOOL specifying new value for the property. VARIANT_TRUE marks the associated
setting as used, VARIANT_FALSE – as unused.
7.8.4
Return value
Visual Basic:
True if the associated setting is in use, False otherwise.
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully. *pValue contains valid value.
Any other error code
The operation failed.
7.8.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 39 -
PTC04 - PSF - MLX90316
Product Specific Function description
7.9
GetSolverSetting Method
7.9.1
Description
Returns the value of a particular solver setting.
NOTE: The module is just a container for the solver settings and completely ignores them. This method provides
an interface for higher layers to access the contents of the profile. The higher layers are responsible to read these
settings when necessary and put them at the right places (usually the EEPROM of the selected die) as part of
their solver sequence.
NOTE: The solver targets, kept in the profile, are also accessible with this method.
7.9.2
Syntax
Visual Basic:
Function GetSolverSetting(settingID as SolverSettingCodes)
C++:
HRESULT GetSolverSetting(/*[in]*/ SolverSettingCodes settingID, /*[out,retval]*/ TVariant*
pVal);
7.9.3
Parameters
settingID
A SolverSettingCodes constant specifying the ID of the solver setting.
pVal
An address of VARIANT variable that will receive the return value of the method. The caller is
responsible to call VariantClear on that variable when it is no longer needed.
7.9.4
Return value
Visual Basic:
A Variant containing the value of a solver setting.
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully. *pVal contains valid value.
Any other error code
The operation failed. *pVal is Empty.
7.9.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 40 -
PTC04 - PSF - MLX90316
Product Specific Function description
7.10
SetSolver
SetSolverSetting
SolverSetting Method
7.10.1
Description
Changes the value of a particular solver setting.
NOTE: If necessary, the changes can be saved in the profile with a subsequent call to SaveProfile or
SaveProfileAs methods.
NOTE: The module is just a container for the solver settings and completely ignores them. This method provides
an interface for higher layers to change the contents of the profile. The higher layers are responsible to read these
settings when necessary and put them at the right places (usually the EEPROM of the selected die) as part of
their solver sequence.
NOTE: The solver targets, kept in the profile, are also accessible with this method.
7.10.2
Syntax
Visual Basic:
Sub SetSolverSetting(settingID as SolverSettingCodes, Value)
C++:
HRESULT SetSolverSetting(/*[in]*/ SolverSettingCodes settingID, /*[in]*/ TVariantInParam
Value);
7.10.3
Parameters
settingID
A SolverSettingCodes constant specifying the ID of the solver setting to modify.
Value
A VARIANT containing new value for the solver setting.
7.10.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
7.10.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.11
SolverSettingInUse
SolverSettingInUse Property
7.11.1
Description
Specifies if the solver setting will be stored in the profile when SaveProfile or SaveProfileAs methods are
called. These usage flags are also updated by OpenProfile method – a certain solver setting is marked as “used”
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 41 -
PTC04 - PSF - MLX90316
Product Specific Function description
if it exists in the profile being opened, otherwise it is marked as unused and a default value is assigned to the
setting itself.
NOTE: The usage of the solver targets, kept in the profile, is also accessible with this method.
7.11.2
Syntax
Visual Basic:
Property SolverSettingInUse(settingID as SolverSettingCodes) as Boolean
C++:
HRESULT get_SolverSettingInUse(/*[in]*/ SolverSettingCodes settingID, /*[out,retval]*/
VARIANT_BOOL* pValue);
HRESULT set_SolverSettingInUse(/*[in]*/ SolverSettingCodes settingID, /*[in]*/
VARIANT_BOOL Value);
7.11.3
Parameters
settingID
A SolverSettingCodes constant specifying the ID of the solver setting to get or modify its usage.
pValue
An address of VARIANT_BOOL variable that receives current value of the property.
VARIANT_TRUE means that the associated solver setting is used, VARIANT_FALSE means unused.
Value
A VARIANT_BOOL specifying new value for the property. VARIANT_TRUE marks the associated
solver setting as used, VARIANT_FALSE – as unused.
7.11.4
Return value
Visual Basic:
True if the associated solver setting is in use, False otherwise.
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully. *pValue contains valid value.
Any other error code
The operation failed.
7.11.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.12
OpenProfile Method
7.12.1
Description
Opens the specified file and updates the settings.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 42 -
PTC04 - PSF - MLX90316
Product Specific Function description
7.12.2
Syntax
Visual Basic:
Sub OpenProfile(FileName as String)
C++:
HRESULT OpenProfile(/*[in]*/ BSTR FileName);
7.12.3
Parameters
FileName
A String specifying the path of the file to open.
7.12.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
7.12.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.13
SaveProfile Method
7.13.1
Description
Saves the settings into a previously opened profile. This function fails if there is not a profile in use.
7.13.2
Syntax
Visual Basic:
Sub SaveProfile()
C++:
HRESULT SaveProfile();
7.13.3
Parameters
None
7.13.4
Return value
C++:
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 43 -
PTC04 - PSF - MLX90316
Product Specific Function description
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
7.13.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.14
SaveProfileAs Method
7.14.1
Description
Saves the settings into the specified file.
7.14.2
Syntax
Visual Basic:
Sub SaveProfileAs(FileName as String)
C++:
HRESULT SaveProfileAs(/*[in]*/ BSTR FileName);
7.14.3
Parameters
FileName
A String specifying the path of the file.
7.14.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
7.14.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.15
ReadFullRAM Method
7.15.1
Description
Reads the whole RAM of MLX90316. Updates the internal RAM cache with values taken from the chip. This
method is provided to speed up the performance because it updates the whole cache with a single command.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 44 -
PTC04 - PSF - MLX90316
Product Specific Function description
7.15.2
Syntax
Visual Basic:
Sub ReadFullRAM()
C++:
HRESULT ReadFullRAM();
7.15.3
Parameters
None
7.15.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
7.15.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.16
ProgramRAM Method
7.16.1
Description
Writes the whole RAM of MLX90316. Takes the values from the internal RAM cache.
Only the variables that are modified will be programmed.
7.16.2
Syntax
Visual Basic:
Sub ProgramRAM()
C++:
HRESULT ProgramRAM();
7.16.3
Parameters
None
7.16.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 45 -
PTC04 - PSF - MLX90316
Product Specific Function description
Return value
S_OK
Any other error code
7.16.5
Meaning
The operation completed successfully.
The operation failed.
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.17
GetRAMParameter Method
7.17.1
Description
Returns the code of a particular RAM parameter. It is optimized because it uses the RAM cache maintained by
the library. ReadFullRAM method could be called before calling GetRAMParameter to update the whole
cache. However GetRAMParameter works correctly even if ReadFullRAM is not called.
7.17.2
Syntax
Visual Basic:
Function GetRAMParameter(paramID as ParamCodesRAM)
C++:
HRESULT GetRAMParameter(/*[in]*/ ParamCodesRAM paramID, /*[out,retval]*/ TVariant*
pVal);
7.17.3
Parameters
paramID
A ParamCodesRAM constant specifying the ID of the RAM parameter.
pVal
An address of VARIANT variable that will receive the return value of the method. The caller is
responsible to call VariantClear on that variable when it is no longer needed.
7.17.4
Return value
Visual Basic:
A Variant containing the value of a RAM parameter.
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully. *pVal contains a valid value.
Any other error code
The operation failed. *pVal is Empty.
7.17.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 46 -
PTC04 - PSF - MLX90316
Product Specific Function description
7.18
SetRAMParameter Method
7.18.1
Description
Changes the code of a particular RAM parameter. The method works with the RAM cache maintained by the
library.
ProgramRAM method must be called in order to update the RAM of the chip with the codes from the cache.
7.18.2
Syntax
Visual Basic:
Sub SetRAMParameter(paramID as ParamCodesRAM, Value)
C++:
HRESULT SetRAMParameter(/*[in]*/ ParamCodesRAM paramID, /*[in]*/ TVariantInParam
Value);
7.18.3
Parameters
paramID
A ParamCodesRAM constant specifying the ID of the RAM parameter to modify.
Value
A VARIANT containing new value for the RAM parameter.
7.18.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
7.18.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.19
GetRAMParameterDirect Method
7.19.1
Description
Returns the code of a particular RAM parameter. In contrast to GetRAMParameter, this method directly reads
data from the device’s RAM.
7.19.2
Syntax
Visual Basic:
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 47 -
PTC04 - PSF - MLX90316
Product Specific Function description
Function GetRAMParameterDirect(paramID as ParamCodesRAM)
C++:
HRESULT GetRAMParameterDirect(/*[in]*/ ParamCodesRAM paramID, /*[out,retval]*/
TVariant* pVal);
7.19.3
Parameters
paramID
A ParamCodesRAM constant specifying the ID of the RAM parameter.
pVal
An address of VARIANT variable that will receive the return value of the method. The caller is
responsible to call VariantClear on that variable when it is no longer needed.
7.19.4
Return value
Visual Basic:
A Variant containing the value of a RAM parameter.
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully. *pVal contains a valid value.
Any other error code
The operation failed. *pVal is Empty.
7.19.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.20
SetRAMParameterDirect Method
7.20.1
Description
Changes the code of a particular RAM parameter. In contrast to SetRAMParameter, this method directly writes
data to the device’s RAM.
7.20.2
Syntax
Visual Basic:
Sub SetRAMParameterDirect(paramID as ParamCodesRAM, Value)
C++:
HRESULT SetRAMParameterDirect(/*[in]*/ ParamCodesRAM paramID, /*[in]*/
TVariantInParam Value);
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 48 -
PTC04 - PSF - MLX90316
Product Specific Function description
7.20.3
Parameters
paramID
A ParamCodesRAM constant specifying the ID of the RAM parameter to modify.
Value
A VARIANT containing new value for the RAM parameter.
7.20.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
7.20.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.21
MemWriteWithCRC
MemWriteWithCRC Method
7.21.1
Description
Sends MemWriteWithCRC command to PTC04 programmer. Writes 2 bytes into chip’s memory.
7.21.2
Syntax
Visual Basic:
Sub MemWriteWithCRC(Addr as Long, Data as Long, Ack as Long, Tim as Long, T1 as Long,
T2 as Long, T3 as Long, T4 as Long)
C++:
HRESULT MemWriteWithCRC(/*[in]*/ long Addr, /*[in]*/ long Data, /*[out]*/ int* Ack,
/*[out]*/ int* Tim, /*[out]*/ int* T1, /*[out]*/ int* T2, /*[out]*/ int* T3, /*[out]*/
int* T4);
7.21.3
Parameters
Addr
A Long specifying memory address to modify in the chip. Only the lowest 16 bits are used.
Data
A Long containing new value to write in the chip. Only the lowest 16 bits are used.
Ack
An address of int variable that will receive the acknowledge data returned from the chip during the
communication. This pointer could be NULL if this value is not needed.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 49 -
PTC04 - PSF - MLX90316
Product Specific Function description
Tim
An address of int variable that will receive the Tim timing measured during the communication with the
chip. This pointer could be NULL if this value is not needed.
T1
An address of int variable that will receive the T1 timing measured during the communication with the
chip. This pointer could be NULL if this value is not needed.
T2
An address of int variable that will receive the T2 timing measured during the communication with the
chip. This pointer could be NULL if this value is not needed.
T3
An address of int variable that will receive the T3 timing measured during the communication with the
chip. This pointer could be NULL if this value is not needed.
T4
An address of int variable that will receive the T4 timing measured during the communication with the
chip. This pointer could be NULL if this value is not needed.
7.21.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
7.21.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.22
MemWrite Method
7.22.1
Description
Sends MemWrite command to PTC04 programmer. Writes 2 bytes into chip’s memory.
7.22.2
Syntax
Visual Basic:
Sub MemWrite(Addr as Long, Data as Long, Ack as Long, Tim as Long, T1 as Long, T2 as
Long)
C++:
HRESULT MemWrite(/*[in]*/ long Addr, /*[in]*/ long Data, /*[out]*/ int* Ack, /*[out]*/ int*
Tim, /*[out]*/ int* T1, /*[out]*/ int* T2);
7.22.3
Parameters
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 50 -
PTC04 - PSF - MLX90316
Product Specific Function description
Addr
A Long specifying memory address to modify in the chip. Only the lowest 16 bits are used.
Data
A Long containing new value to write in the chip. Only the lowest 16 bits are used.
Ack
An address of int variable that will receive the acknowledge data returned from the chip during the
communication. This pointer could be NULL if this value is not needed.
Tim
An address of int variable that will receive the Tim timing measured during the communication with the
chip. This pointer could be NULL if this value is not needed.
T1
An address of int variable that will receive the T1 timing measured during the communication with the
chip. This pointer could be NULL if this value is not needed.
T2
An address of int variable that will receive the T2 timing measured during the communication with the
chip. This pointer could be NULL if this value is not needed.
7.22.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
7.22.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.23
MemRead Method
7.23.1
Description
Sends MemRead command to PTC04 programmer. Reads 2 bytes from chip’s memory.
7.23.2
Syntax
Visual Basic:
Function MemRead(Addr as Long, CRCrec as Long) as Long
C++:
HRESULT MemRead(/*[in]*/ long Addr, /*[out]*/ int* CRCrec, /*[out,retval]*/ long* pData);
7.23.3
Parameters
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 51 -
PTC04 - PSF - MLX90316
Product Specific Function description
Addr
A Long specifying memory address to read from the chip. Only the lowest 16 bits are used.
CRCrec
An address of int variable that will receive the CRC data returned from the chip during the
communication. This pointer could be NULL if this value is not needed.
pData
An address of long variable that will receive the return value of the method. Only the lowest 16 bits are
valid, the highest 16 bits are always zero.
7.23.4
Return value
Visual Basic:
A Long containing the value that is read from the chip’s memory.
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully. *pData contains valid value.
Any other error code
The operation failed. *pData is zero.
7.23.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.24
ReadData Method
7.24.1
Description
Sends ReadData command to PTC04 programmer. Reads a certain number of words from the chip’s memory.
7.24.2
Syntax
Visual Basic:
Function ReadData(Addr as Long, N as Long, Format as Long)
C++:
HRESULT ReadData(/*[in]*/ long Addr, /*[in]*/ long N, /*[in]*/ long Format, /*[out,retval]*/
TVariant* varData);
7.24.3
Parameters
Addr
A Long specifying memory address to start reading from the chip. Only the lowest 16 bits are used.
N
A Long specifying a number of words to be read (up to 125).
Format
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 52 -
PTC04 - PSF - MLX90316
Product Specific Function description
A Long specifying the format of the returned data in varData. Possible values are:
Value
Format
1
Return value is an array of bytes
2
Return value is an ANSI string packed in bstrVal member of *varData. This is the
preferred format for C++ applications because of the best performance. It is a binary
data so the string can contain zeroes and may not be zero terminated. Callers can get its
real length by calling SysStringByteLen API on bstrVal member
4
Return value is an array of words (Integers). This is the preferred format for Visual
Basic applications
varData
An address of VARIANT variable that will receive the return value of the method. The caller is
responsible to call VariantClear on that variable when it is no longer needed.
7.24.4
Return value
Visual Basic:
A Variant containing the data read from the chip.
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully. *varData contains valid value.
Any other error code
The operation failed. *varData is Empty.
7.24.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.25
WriteData Method
7.25.1
Description
Sends WriteData command to PTC04 programmer. Writes a certain number of words into the chip’s memory.
7.25.2
Syntax
Visual Basic:
Sub WriteData(Format as Long, arr)
C++:
HRESULT WriteData(/*[in]*/ long Format, /*[in]*/ TVariantInParam arr);
7.25.3
Parameters
Format
A Long specifying the format of the data in arr. Possible values are:
Value
Format
1
arr is an array of words (Integers) in the following format:
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 53 -
PTC04 - PSF - MLX90316
Product Specific Function description
Add0
Word0
Add1
Word1
…
Word 0 H
…
or an array of bytes in the following format:
Add0 L
Add0 H
Word 0 L
where Add0 is the first memory address to change and Word0 is the new value for that
memory cell, Add1 is the second memory address and Word1 is the corresponding new
value and so on.
2
arr is an ANSI string packed in bstrVal member. This is the preferred format for C++
applications because of the best performance. It is a binary data so the string can contain
zeroes and may not be zero terminated.
arr
A VARIANT containing the data to be written.
7.25.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
7.25.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.26
StartCom
StartCom Method
7.26.1
Description
Sends StartCom command to PTC04 programmer.
7.26.2
Syntax
Visual Basic:
Sub StartCom()
C++:
HRESULT StartCom();
7.26.3
Parameters
None
7.26.4
Return value
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 54 -
PTC04 - PSF - MLX90316
Product Specific Function description
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
7.26.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.27
SetDBMux Method
7.27.1
Description
Sends SetDBMux command to PTC04 programmer.
7.27.2
Syntax
Visual Basic:
Sub SetDBMux(MUXChanNr as Byte)
C++:
HRESULT SetDBMux(/*[in]*/ unsigned char MUXChanNr);
7.27.3
Parameters
MUXChanNr
A Byte specifying new channel for the mux.
7.27.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
7.27.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.28
HotReset Method
7.28.1
Description
Sends HotReset command to PTC04 programmer.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 55 -
PTC04 - PSF - MLX90316
Product Specific Function description
7.28.2
Syntax
Visual Basic:
Function HotReset() As Long
C++:
HRESULT HotReset(/*[out,retval]*/ int* Ack);
7.28.3
Parameters
Ack
An address of int variable that will receive the acknowledge data returned from the chip during the
communication.
7.28.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully. *Ack contains valid value.
Any other error code
The operation failed. *Ack is zero.
7.28.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.29
NopAlive
NopAlive Method
7.29.1
Description
Sends NopAlive command to PTC04 programmer.
7.29.2
Syntax
Visual Basic:
Function NopAlive() As Long
C++:
HRESULT NopAlive(/*[out,retval]*/ int* Ack);
7.29.3
Parameters
Ack
An address of int variable that will receive the acknowledge data returned from the chip during the
communication.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 56 -
PTC04 - PSF - MLX90316
Product Specific Function description
7.29.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully. *Ack contains valid value.
Any other error code
The operation failed. *Ack is zero.
7.29.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.30
HamWrite Method
7.30.1
Description
Sends HamWrite command to PTC04 programmer.
7.30.2
Syntax
Visual Basic:
Sub HamWrite()
C++:
HRESULT HamWrite();
7.30.3
Parameters
None
7.30.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
7.30.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.31
DisconnectDevice
DisconnectDevice Method
7.31.1
Description
Sends DisconnectUart command to PTC04 programmer. It disconnects the output of the chip from the Uart line
on the daughter board. Such disconnected output can be measured with external equipment.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 57 -
PTC04 - PSF - MLX90316
Product Specific Function description
There is no ConnectUart command. The firmware connects the output automatically when necessary.
7.31.2
Syntax
Visual Basic:
Sub DisconnectDevice()
C++:
HRESULT DisconnectDevice();
7.31.3
Parameters
None
7.31.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
7.31.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.32
Logging Property
7.32.1
Description
Specifies whether the objects (MLX90316PSFDevice, MLX90316PSFSolver and MLX90316PSFAdvanced)
perform logging of their activity.
7.32.2
Syntax
Visual Basic:
Property Logging as Boolean
C++:
HRESULT get_Logging(/*[out,retval]*/ VARIANT_BOOL* pValue);
HRESULT set_Logging(/*[in]*/ VARIANT_BOOL Value);
7.32.3
Parameters
pValue
An address of VARIANT_BOOL variable that receives current value of the property.
VARIANT_TRUE means that logging is active, VARIANT_FALSE means inactive.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 58 -
PTC04 - PSF - MLX90316
Product Specific Function description
Value
A VARIANT_BOOL specifying new value for the property. VARIANT_TRUE activates the logging,
VARIANT_FALSE deactivates it.
7.32.4
Return value
Visual Basic:
True if logging is active, False otherwise.
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully. *pValue contains valid value.
Any other error code
The operation failed.
7.32.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.33
ChipVersion Property
7.33.1
Description
Specifies the version of the connected MLX90316 chip. This value determines the EEPROM map in use and
some settings, specific for each different version of the chip.
7.33.2
Syntax
Visual Basic:
Property ChipVersion as Long
C++:
HRESULT get_ChipVersion(/*[out,retval]*/ long* pValue);
HRESULT set_ChipVersion(/*[in]*/ long Value);
7.33.3
Parameters
pValue
An address of Long variable that receives current value of the property.
Value
A Long specifying new value for the property.
7.33.4
Remarks
Meaning of this property:
1
2
3
Chip is MLX90316ABB or MLX90316BAA
Chip is MLX90316BAC
Chip is MLX90316BAD
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 59 -
PTC04 - PSF - MLX90316
Product Specific Function description
4
5
6
7
8
9
Chip is MLX90316BF
Chip is MLX90316CAL
Chip is MLX90316BCG
Chip is MLX90316CCM
Chip is MLX90316CCN
Chip is MLX90316BCI
Normally this property is set once as part of the initialization of the software.
7.33.5
Return value
Visual Basic:
1
2
3
4
5
6
7
8
9
Chip is MLX90316ABB or MLX90316BAA
Chip is MLX90316BAC
Chip is MLX90316BAD
Chip is MLX90316BF
Chip is MLX90316CAL
Chip is MLX90316BCG
Chip is MLX90316CCM
Chip is MLX90316CCN
Chip is MLX90316BCI
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully. *pValue contains valid value.
Any other error code
The operation failed.
7.33.6
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.34
CheckCRC Method
7.34.1
Description
Checks validity of the EEPROM. It calculates CRC of the EEPROM cells and compares it with corresponding
data in EEPROM.
7.34.2
Syntax
Visual Basic:
Function CheckCRC(pCRC As Long) As Boolean
C++:
HRESULT CheckCRC(/*[out]*/ long* pCRC, /*[out,retval]*/ VARIANT_BOOL pbValue);
7.34.3
Parameters
pCRC
An address of long variable that will receive the CRC calculated by the method.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 60 -
PTC04 - PSF - MLX90316
Product Specific Function description
pbValue
An address of Boolean variable that will receive the return value of the method. True means that CRC is
OK, False – CRC is different.
7.34.4
Return value
Visual Basic:
A Boolean containing the return value of the method. True means that CRC is OK, False – CRC is
different..
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully. *pCRC and *pbValue contain
valid values.
Any other error code
The operation failed. *pCRC and *pbValue are zero.
7.34.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.35
SPIDisconnect Method
7.35.1
Description
Sends CMD_SPIDisconnect command to PTC04 programmer.
7.35.2
Syntax
Visual Basic:
Sub SPIDisconnect()
C++:
HRESULT SPIDisconnect();
7.35.3
Parameters
None
7.35.4
Return value
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 61 -
PTC04 - PSF - MLX90316
Product Specific Function description
7.35.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.36
SentGetData Method
7.36.1
Description
Reads a data frame in SENT protocol. ASIC must be programmed in this mode in order to get valid data.
7.36.2
Syntax
Visual Basic:
Function SentGetData(Byref pBitTime as Single, Byref pStatus as Byte,
Byref pSignal as Integer, Byref pCounter as Byte,
IsStatusInCrc as Boolean) as Long
C++:
HRESULT SentGetData(/*[out]*/float* pBitTime, /*[out]*/unsigned_char* pStatus,
/*[out]*/short* pSignal, /*[out]*/unsigned_char* pCounter,
/*[in,defaultvalue=0]*/VARIANT_BOOL IsStatusInCrc,
/*[out,retval]*/long* pResult)
7.36.3
Parameters
pBitTime
An address of Single variable that will receive the period of a bit in [µS].
pStatus
An address of Byte variable that will receive the status nibble.
pSignal
An address of Integer variable that will receive the sampled data. Only the 12 LSB are meaningful.
pCounter
An address of Byte variable that will receive the number of the frame.
pCounter
A Boolean specifying whether Status nibble in included in the CRC (True) or not (False). By default this
parameter is False.
pResult
An address of Long variable that will receive a result of method execution. It is a bit-masked value which
is 0 if the read data frame is correct. Otherwise the meaning of the bits is:
Bit nr
Description
0
incorrect inverted nibble
1
incorrect CRC
2
no signal on the output
other
N/A
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 62 -
PTC04 - PSF - MLX90316
Product Specific Function description
7.36.4
Return value
Visual Basic:
A Boolean containing the result of method execution. See description of parameter pResult.
C++:
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
7.36.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
7.37
ReadChipVersion Method
7.37.1
Description
This method recognizes the version of the connected chip.
7.37.2
Syntax
Visual Basic:
Function ReadChipVersion as Long
C++:
HRESULT ReadChipVersion(/*[out,retval]*/long* pValue);
7.37.3
Parameters
pValue
An address of Long variable that will receive a code corresponding to the specific chip version. Here is
the list of the possible codes:
0
Chip is not recognized or not connected properly
2
Chip is MLX90316BAC
3
Chip is MLX90316BAD
4
Chip is MLX90316BF
5
Chip is MLX90316CAL
6
Chip is MLX90316BCG
7
Chip is MLX90316CCM
8
Chip is MLX90316CCN
9
Chip is MLX90316BCI
7.37.4
Return value
Visual Basic:
A Long containing a code corresponding to the specific chip version. See description of pValue above
for the list of the possible codes.
C++:
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 63 -
PTC04 - PSF - MLX90316
Product Specific Function description
The return value obtained from the returned HRESULT is one of the following:
Return value
Meaning
S_OK
The operation completed successfully.
Any other error code
The operation failed.
7.37.5
Quick Info
Header: Declared in MLX90316PSFModule_TLB.h.
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 64 -
PTC04 - PSF - MLX90316
Product Specific Function description
8 Enumeration constants
8.1
ParamCodesEEPROM enumeration
1
2
3
4
5
6
7
8
CodeSlopeXm40
9
CodeSlopeYm40
10
CodeSlopeX125
11
CodeSlopeY125
12
CodeMLXID1
CodeMLXID2
CodeMLXID3
CodeCALIBMODE
CodeX0
CodeY0
13
14
15
16
17
18
CodeOSMOD
19
CodeDEADZONEBYTE
20
CodeFilter
21
CodeCUSTID1
CodeCUSTID2
CodeCUSTID3
CodeDP16
22
23
24
25
CodeLNRS0
26
CodeLNRAX
CodeLNRAY
27
28
CodeLNRAS
29
CodeLNRBX
CodeLNRBY
CodeLNRBS
30
31
32
MLX90316 PSF Library Object Model
Rev.1.72
Bits
CodeMLXLOCK
CodeTCITRIM
CodeOSC
CodeSMISM16
CodeT25
CodeRATIO2OFS
CodeORTH
CodeORTH2
Constant
R/W
Value
The following constants refer to parameters in EEPROM. They are used by GetEEParameterCode,
SetEEParameterCode, GetEEParameterValue and SetEEParameterValue methods.
Parameters with translation value ‘-‘ are not supported by GetEEParameterValue and
SetEEParameterValue methods.
Translation
value
R/
R/
R/
R/
R/
R/
R/
R/
R/
8
8
16
16
8
1
16
16
-
2
-
2
-
2
-
2
-
16
16
16
16
8
8
-
16
-
8
8
(4)
8
16
16
16
float [deg]
R/
R/
R/
R/
R/
R/
R/
R/
R/
R/
R/W
R/W
R/W
R/W
R/W
R
R/W
R/W
R/W
R/W
R/W
R/W
R/W
16
16
16
16
16
16
16
float
[%Vdd/deg]
float [deg]
float [%Vdd]
float
[%Vdd/deg]
float [deg]
float [%Vdd]
float
Description
EE_MLXLOCK EEPROM cell
Analog TC + Current trimming
Oscillator frequencies
Sensitivity Mismatch (whole cell)
Temp. Sensor Output at 25°
RATIO2 OFFSET
Orth Error (Radians)
Orth Error (2nd order factor)
ReservedFine offset drift from -40° to 25°
(MLX90316ABB)
ReservedFine offset drift from -40° to 25°
(MLX90316ABB)
ReservedFine offset drift from 25° to 125°
(MLX90316ABB)
ReservedFine offset drift from 25° to 125°
(MLX90316ABB)
EE_MLX_ID1 EEPROM cell
EE_MLX_ID2 EEPROM cell
EE_MLX_ID3 EEPROM cell
Enables calib and debug modes
X Residual Offset at 25°, B =0
Y Residual Offset at 25°, B =0
Output stages analog / PWM mode
Use CodeOUT1EN, CodeOUT1MODE to set
output stage
EE_DEADZONEBYTE EEPROM cell
Select Filter type (in MLX90316 CCM it is 4 bit
wide)
EE_CUST_ID1 EEPROM cell
EE_CUST_ID2 EEPROM cell
EE_CUST_ID3 EEPROM cell
Discontinuity point (whole cell)
Initial slope (slope before point A)
X coordinate of point A
Y coordinate of point A
Slope after point A
X coordinate of point B
Y coordinate of point B
Slope after point B
7 Jan 2008
- 65 -
PTC04 - PSF - MLX90316
Value
R/W
Bits
Product Specific Function description
CodeLNRCX
CodeLNRCY
33
34
16
16
CodeLNRCS
35
R/W
R/W
R/W
CodeCLAMPLOW
CodeCLAMPHIGH
CodeFILTERA1
CodeFILTERA2
CodeKD16
CodeUSERCFG0
CodeROUGHGAIN
CodeFHYST
CodeMONITHRESLO
CodeMONITHRESHI
CodeKDHYST
CodeLOCK
CodeCRC16
CodeDPTCTIMEOUTX
CodeEAIMCSENS
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
CodeDSMISMOEC
51
CodeDRESONFAULT
52
CodeD3PPWLT
53
CodeDFINEGAIN
CodeECOVOUT2
54
55
CodeDCROA
56
CodeDPTCTIMEOUT
57
CodeFORCECRA75
58
CodeEANALOGEMUL
CodeDROMCHECK
CodeEANALOGTM
CodeERGAOFGC
CodeOUT1MODE
CodeOUT1EN
59
60
61
62
63
64
CodeOUT1PWM
65
CodeOUT2MODE
CodeOUT2EN
CodeOUT2PWM
66
67
68
CodeRotationDirection
69
CodeHS
70
CodeDISORTH2
CodeARGC
CodePWMF
71
72
73
CodeSPI
74
CodeOSCHIGH
75
Constant
MLX90316 PSF Library Object Model
Rev.1.72
R/W
R/W
R/W
R/W
R/
R/W
R/W
R/W
R/W
R/W
R/
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/
R/W
R/
Translation
value
16
16
16
16
2
16
8
8
8
8
1
8
16
1
1
[%Vdd/deg]
float [deg]
float [%Vdd]
float
[%Vdd/deg]
float [%Vdd]
float [%Vdd]
float [deg]
float [deg]
-
1
-
1
-
1
-
1
1
-
1
-
1
-
1
-
1
1
1
1
3
1
-
1
-
1
1
1
-
1
-
1
-
1
1
1
-
4
-
8
-
16
Description
X coordinate of point C
Y coordinate of point C
Slope after point C; can be negative for
MLX90316CxL
Low clamping value
High clamping value
IIR filter A1 coefficient
EE_FILTER_A2 EEPROM cell
Reserved Kick-down position (whole cell)
EE_USERCFG0 EEPROM cell
EE_ROUGHGAIN EEPROM cell
EE_FHYST EEPROM cell
EE_MONITHRESLO EEPROM cell
EE_MONITHRESHI EEPROM cell
Reserved EE_KDHYST EEPROM cell
EE_LOCK EEPROM cell
Cyclic Red. Check
Disable PTC Timeout in byte XChange
Enable Assymetrical IMC Sensivity
Reserved Disable S.Mism and Orth Error
Correction (MLX90316ABB)
Disable Reset on Fault
Reserved Disable 3 points piece-wise linear
transform (MLX90316ABB)
Disable fine gain control
Enable constant output value on OUT1
Disable Cont. Rough Offset Adj and Take a
cal’ed Rough Offset instead
Disable PTC Timeout
Force circle radius adjustment to 75% (instead
of 90%)
Enable Analog Emulation (port 2020..23)
Disable ROM Check
Enable Analog Test Modes
Rough Gain Adjustment On Fine Gain Clip
Pin OUT1 mode
Pin OUT1 enable
Pin OUT1 enable PWM( also check CodePWM
and CodePWMPOL1)
Pin OUT2 mode
Pin OUT2 enable
Pin OUT2 enable PWM
Rotation direction (0= counter clock-wise or 1
= clock-wise)
Low-Power (Pedal) mode or High-Speed
(Throttle) mode
Disable orthogonality error of the 2nd order
Automatic Rough Gain Control @ startup
Defines the PWM Frequency (MLX90316ABB)
Enable SPI protocol ( out 1 = MISO, out2=
Clock and out3 = /SS)
High Speed Mode Oscillator Frequency
7 Jan 2008
- 66 -
PTC04 - PSF - MLX90316
Bits
Translation
value
R/
R/
8
-
3
-
3
8
8
15
2
1
float [deg]
float [deg]
-
1
-
1
-
1
16
-
16
-
8
-
8
-
16
-
8
-
8
-
16
-
8
-
16
16
1
-
1
-
1
-
1
1
-
4
-
4
-
1
-
1
-
1
-
108
1
-
CodeRATIO2SCOLD
109
1
-
CodeGAINMIN
CodeGAINMAX
110
111
1
1
-
Value
R/W
Product Specific Function description
CodeSMISM
76
CodeTC
77
CodeITRIM
CodeOSCLOW
CodeSXGTSY
CodeDP
CodeKD
CodeKD0
78
79
80
81
82
83
CodeINVSRGOC
84
CodeRATIO2SLOPE
85
CodeDACTHRES
CodePWMT
86
87
CodeXOFSSLOPE
88
CodeXOFSSLOPEHOT
89
CodeXOFSSLOPECOLD
90
CodeYOFSSLOPE
91
CodeYOFSSLOPEHOT
92
CodeYOFSSLOPECOLD
93
CodeUSERCFG1
94
CodeRGTHRES
95
CodeEEFREE2
CodeEEHAMHOLE
CodePWM
96
97
98
CodePWMPOL1
99
CodePWMPOL2
100
CodeADCXOR0
CodeADCXOR1
101
102
CodeRGTHRESLOW
103
CodeRGTHRESHIGH
104
CodeDADCDACMON
105
CodeDOUTINNFAULT
106
CodeNOFGARGC
107
CodeRATIO2SHOT
Constant
MLX90316 PSF Library Object Model
Rev.1.72
R/
R/
R/
R/W
R/W
R/
R/
R/
R/
R/
R/
R/
R/
R/
R/
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
Description
Sensitivity mismatch correction factor
Reserved Analog Chain Temperature
Coefficient Rough Trimming
Current sources trimming
Low Power Mode Oscillator Frequency
SxGTSy bit in SMISM16 cell (SMISM[8])
Discontinuity point (0°..360°)
Kick-down position
Kick-down position LSB (KD0)
Invert sign of Rough Offset compensation
(MLX90316ABB)
EE_RATIO2SLOPE EEPROM cell
(MLX90316BAC)
EE_DACTHRES EEPROM cell (MLX90316BAC)
EE_PWMT EEPROM cell (MLX90316BAC)
EE_XOFSSLOPE EEPROM cell (whole cell)
(MLX90316BAC)
EE_XOFSSLOPEHOT EEPROM cell
(MLX90316BAC)
EE_XOFSSLOPECOLD EEPROM cell
(MLX90316BAC)
EE_YOFSSLOPE EEPROM cell (whole cell)
(MLX90316BAC)
EE_YOFSSLOPEHOT EEPROM cell
(MLX90316BAC)
EE_YOFSSLOPECOLD EEPROM cell
(MLX90316BAC)
EE_USERCFG1 EEPROM cell (MLX90316BAC)
EE_RGTHRES EEPROM cell (MLX90316BAC)
use RGTHRESLOW/ CodeRGTHRESHIGH to set
value
EE_FREE2 EEPROM cell (MLX90316BAC)
EE_HAMHOLE EEPROM cell
Enable PWM H/W and S/W (MLX90316BAC)
Invert polarity of OUT1 in PWM mode
(MLX90316BAC)
Invert polarity of OUT2 in PWM mode
(MLX90316BAC)
ADCXOR0 bit in EE_USERCFG1 (MLX90316BAC)
ADCXOR1 bit in EE_USERCFG1 (MLX90316BAC)
RGTHRESLOW bits in EE_RGTHRES
(MLX90316BAC)
RGTHRESHIGH bits in EE_RGTHRES
(MLX90316BAC)
Disable ADC and DAC monitor (MLX90316BAC)
Disable out in fault when chip in fault
(MLX90316BAC)
No fine gain during ARGC (MLX90316BAC)
EE_RATIO2S_HOT EEPROM cell
(MLX90316BAD/BF)
EE_RATIO2S_COLD EEPROM cell
(MLX90316BAD/BF)
(MLX90316BF/CxL)
(MLX90316BF/CxL)
7 Jan 2008
- 67 -
PTC04 - PSF - MLX90316
112
113
114
CodeAGC
115
CodeD
116
CodeM0
CodeM1
117
118
CodeEANALOGEMUL2
119
CodeOSCMID
CodeESTATCRC
CodeMS
CodeHYS360
CodeROLLCNT
CodeOUT2DERIV
CodeDERIVGAIN
CodeOUT1DIAG
CodePWMLATCH
CodeFSWAP
CodeOUT2DIAG
CodeOUT1DHIGH
CodeOUT2DHIGH
CodeASSYM
CodeKDONOUT2
CodeFilter8
CodeRORDEBALG
CodeRORDEBTHRES
CodeDIAGDEBALG
CodeDIAGDEBTHRES
CodeADCTHRES
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
8.2
Bits
CodeSENT
CodeS0
CodeS1
Constant
R/W
Value
Product Specific Function description
Translation
value
R/W
R/W
R/W
R/W
1
1
1
-
1
-
1
-
1
1
-
1
-
6
1
1
1
1
1
8
1
1
1
1
1
1
1
1
1
1
1
1
1
1
-
R/W
R/W
R/W
R/
R/
R/
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
Description
Enable SENT interface (MLX90316BF/CxL)
Enable SENT and SPI interfaces - both bits
must be 1 (MLX90316BF/CxL)
Enable automatic gain control
(MLX90316BF/CxL)
Double the output sample and hold period
(MLX90316BF/CxL)
ADC resolution mode (MLX90316BF/CxL)
Enable analog emulation - 201Bh.b3
(MLX90316BF/CxL)
(MLX90316CxL)
(MLX90316CxL)
(MLX90316CxL)
(MLX90316CxL)
(MLX90316CxL)
(MLX90316CxL)
(MLX90316CxL)
(MLX90316BCG)
(MLX90316BCG)
(MLX90316BCG)
(MLX90316BCG)
(MLX90316CCM)
(MLX90316CCM)
(MLX90316CCM)
(MLX90316CCM)
(MLX90316CCM
(MLX90316BCI)
(MLX90316BCI)
(MLX90316BCI)
(MLX90316BCI)
(MLX90316BCI)
ParamCodesRAM enumeration
Value
Location
in
memory
Bytes
The following constants refer to parameters in RAM. They are used by GetRAMParameter and
SetRAMParameter methods
CodeERRORFLAGS
CodeROUGHGAINRam
CodeFINEGAIN
1
2
3
6h
8h
9h
2
1
1
CodeCOS
4
0Ah
2
CodeSIN
5
0Ch
2
CodeROUGHOFFSETX
6
0Eh in
MLX90316ABB
1
Constant
MLX90316 PSF Library Object Model
Rev.1.72
Description
Error flags
Rough gain
Fine gain
Magnetic field amplitude on the
X-axis
Magnetic field amplitude on the
Y-axis
Rough offset in X
7 Jan 2008
- 68 -
PTC04 - PSF - MLX90316
8.3
CodeROUGHOFFSETY
7
CodeCHOPPEROFFSETX
CodeCHOPPEROFFSETY
CodeTHETAR2P
CodeTHETAOUT
CodeFieldMagnitude
CodeXPHI
CodeXPHIBAR
CodeYPHI
CodeYPHIBAR
CodeTEMPERATURE
CodeTEMPBYTELOW
CodeMONITOR
CodeTEMPBYTE
8
9
10
11
12
13
14
15
16
17
25
18
26
CodeXOFSCORRBYTE
Bytes
Value
Constant
Location
in
memory
Product Specific Function description
40h in
MLX90316BAC
0Dh in
MLX90316ABB
41h in
MLX90316BAC
14h
16h
18h
1Ah
1Ch
24h
26h
28h
2Ah
Description
1
Rough offset in Y
2
2
2
2
2
2
2
2
2
Chopper offset in X
Chopper offset in Y
Angle before post corrections
Angle after all corrections
Field magnitude (square value)
XPHI ADC output
XPHIBAR ADC output
YPHI ADC output
YPHIBAR ADC output
Temperature of the device after
trimming
8 LSB of the temperature sensor
value
Fine offset correction factor in X
(MLX90316BAC)
Fine offset correction factor in Y
(MLX90316BAC)
Magnetic field amplitude on the
X-axis (MLX90316BAC)
Magnetic field amplitude on the
X-axis (MLX90316BAC)
8 msbits of DAC sensor value
(MLX90316BAC)
8 msbits of ADC value when
output is shorted
(MLX90316BAC)
Virtual Gain Code; valid codes
between 0 and 41.
(MLX90316CAL)
3Ah
1
3Bh
1
19
10h
1
CodeYOFSCORRBYTE
20
11h
1
CodeFILTCOS
21
2Eh
2
CodeFILTSIN
22
30h
2
CodeDACMONIBYTE
23
56h
1
CodeADCMONIBYTE
24
57h
1
CodeVIRTUALGAIN
27
40h
1
MeasureParameters enumeration
Constant
MeasOUT1
MeasOUT2
MeasOUT3
MeasVDD
8.4
Value
The following constants specify different outputs of MLX90316. They are used by Measure method
1
2
3
4
Description
Measure
Measure
Measure
Measure
OUT1
OUT2 ( N/A)
OUT3 (N/A)
VDD
MeasureTypes enumeration
The following constants specify different types of measurement. They are used by Measure method
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 69 -
PTC04 - PSF - MLX90316
Value
Product Specific Function description
Constant
MeasPercentVDD
MeasVolt
MeasPWM
MeasPWMPeriod
8.5
1
2
3
4
Description
Return result in %VDD
Return result in absolute value (measure voltage)
Measure PWM
Measure PWM period
SettingCodes enumeration
Value
Default
value
In use by
default
The following constants specify different settings. They are used by GetSetting and SetSetting methods
and SettingInUse property
Type
SettingVDDLow
SettingVDDNorm
SettingVDDComm
SettingVBatLow
SettingVBatNorm
SettingTpor
SettingTsynchro
SettingTpulsMin
SettingTpulsMax
SettingSynchroDelay
SettingBaudrate
1
2
3
4
5
6
7
8
9
10
11
float (Single)
float (Single)
float (Single)
float (Single)
float (Single)
long (Long)
long (Long)
long (Long)
long (Long)
long (Long)
long (Long)
0.0 [V]
5.0 [V]
7.5 [V]
0.0 [V]
6.0 [V]
20000 [µs]
1000 [µs]
4000 [µs]
20000 [µs]
200 [µs]
9600
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
SettingDBLoad
12
byte (Byte)
0
Yes
SettingMeasureDelay
SettingSampleDelay
13
14
1000 [µs]
10 [µs]
Yes
Yes
SettingMeasureFilter
15
100
Yes
Measure filter
SettingSPIT1
SettingSPIT2
SettingSPIT3
SettingSPIT4
SettingSPIT6
SettingTupdate
16
17
18
19
20
21
long (Long)
long (Long)
short
(Integer)
float (Single)
float (Single)
float (Single)
float (Single)
float (Single)
long (Long)
PPS1+2 Level 0
PPS1+2 Level 1
PPS1+2 Level 2
PPS3 Level 0
PPS3 Level 1
Timing 0
Timing 1
Timing 2
Timing 3
Timing 4
Communication baudrate
Get/set the load on the
outputs on the daughter
board. Possible values are:
0 – no load
1 – Resistors 5K6 to PPS3
and 1K47 to VDD (pull-ups
selected)
2 – Resistors 10K to GND
(pull-downs selected)
3 – Both pull-ups and pulldowns selected
Delay before measurement
Sample delay
10.0 [µs]
40.0 [µs]
12.0 [µs]
0.6 [µs]
10.0 [µs]
10000 [µs]
Yes
Yes
Yes
Yes
Yes
Yes
SettingUseOptTimings
22
Boolean
False
Yes
SPI T1
SPI T2
SPI T3
SPI T4
SPI T6
Timing 10
Enables utilization of
optimized timings
Constant
MLX90316 PSF Library Object Model
Rev.1.72
Description
7 Jan 2008
- 70 -
PTC04 - PSF - MLX90316
Product Specific Function description
8.6
SolverSettingCodes enumeration
Value
In use by
default
The following constants specify different settings. They are used by GetSolverSetting and
SetSolverSetting methods and SolverSettingInUse property
Type
SolverSettingDeadZone
SolverSettingClampingLow
SolverSettingClampingHigh
1
2
3
float (Single)
float (Single)
float (Single)
SolverSettingRotationDirection
4
Boolean
SolverSettingOutputDACGain
5
float (Single)
1.0
No*
SolverSettingOutputDACOffset
6
float (Single)
0.0 [%VDD]
No*
SolverSettingOutputType
7
byte (Byte)
0 (analog
output)
Yes
SolverSettingOutputMode
8
byte (Byte)
SolverSettingApplicationSpeed
9
Boolean
SolverSettingFilter
10
byte (Byte)
SolverSettingSlope
11
Boolean
SolverSettingPWMFreq
SolverTargetAnglePointA
SolverTargetLevelPointA
SolverTargetLevelPointB
SolverTargetLevelPointC
SolverTargetLevelPointD
12
100
101
102
103
104
float
float
float
float
float
float
SolverTargetSlopeS0
105
float (Single)
SolverTargetSlopeSA
106
float (Single)
SolverTargetSlopeSB
107
float (Single)
SolverTargetSlopeSC
108
float (Single)
Constant
(Single)
(Single)
(Single)
(Single)
(Single)
(Single)
Default
value
0.0 [deg]
0.0 [%VDD]
100.0 [%VDD]
False (counterclockwise)
4
False (lowpower mode)
5
False (positive
slope)
100.0 [Hz]
0.0 [deg]
0.0 [%VDD]
0.0 [%VDD]
0.0 [%VDD]
0.0 [%VDD]
0.0
[%VDD/deg]
0.0
[%VDD/deg]
0.0
[%VDD/deg]
0.0
[%VDD/deg]
Description
Yes
Yes
Yes
Dead zone
Clamping low
Clamping high
Yes
Rotation direction
Yes
OutputDACGain
coefficient
OutputDACOffset
coefficient
Output type –
0 - analog
1 – PWM
2 - SPI
Output mode
Yes
Power mode
Yes
Filter setting
The sign of the
slope:
False – positive
slope (default
application)
True – negative
slope
PWM frequency
X-axis point A
Y-axis point A
Y-axis point B
Y-axis point C
Y-axis point D
Slope before point A
(S0)
Slope after point A
(SA)
Slope after point B
(SB)
Slope after point C
(SC)
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
No
* These settings are never saved to or read from the profile, thus they are constantly marked as unused
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 71 -
PTC04 - PSF - MLX90316
Product Specific Function description
9 Disclaimer
Devices sold by Melexis are covered by the warranty and patent indemnification provisions appearing in its
Term of Sale. Melexis makes no warranty, express, statutory, implied, or by description regarding the
information set forth herein or regarding the freedom of the described devices from patent infringement.
Melexis reserves the right to change specifications and prices at any time and without notice. Therefore,
prior to designing this product into a system, it is necessary to check with Melexis for current information.
This product is intended for use in normal commercial applications. Applications requiring extended
temperature range, unusual environmental requirements, or high reliability applications, such as military,
medical life-support or life-sustaining equipment are specifically not recommended without additional
processing by Melexis for each application.
The information furnished by Melexis is believed to be correct and accurate. However, Melexis shall not be
liable to recipient or any third party for any damages, including but not limited to personal injury, property
damage, loss of profits, loss of use, interrupt of business or indirect, special incidental or consequential
damages, of any kind, in connection with or arising out of the furnishing, performance or use of the technical
data herein. No obligation or liability to recipient or any third party shall arise or flow out of Melexis’ rendering
of technical or other services.
© 2004 Melexis NV. All rights reserved.
website at:
www.melexis.com
Or for additional information contact Melexis Direct:
Europe and Japan:
Phone: +32 13 67 04 95
E-mail: [email protected]
All other locations:
Phone: +1 603 223 2362
E-mail: [email protected]
QS9000, VDA6.1 and ISO14001 Certified
MLX90316 PSF Library Object Model
Rev.1.72
7 Jan 2008
- 72 -