Ui 90365
Ui 90365
              U S E R IN T ER FA C E
                       90365
                   F O R PTC -0 4
                PRO G RA M M E R
Author: JCD
Contents:
Section 1 Overview
The Melexis PTC-04 software is a Windows application that provides a user interface to program Melexis'
family of PTC (Programmed Thru the Connector) programmable IC’s. The software is a 32 bit Windows
application program that uses a serial COM port or USB port to control a specified Melexis
Programmer/Tester.
System Architecture
The PTC-04 software consists of the following main components:
1) Melexis Programmable Toolbox. The MPT is the main executable portion of the program. It
   manages the main window and frame, File l/O, and preferences.
2) User Interface. The user interface is part of the device module. It contains the functions and features
   used in developing applications with Melexis PTC sensor ICs.
3) Product specific functions (PSF). This is an active-X DLL that manages the serial I/O and translates
   operation requests - typically between the Personality Module and the Programmer specific
   commands (firmware).
Important Note:
This document is written specifically for the MLX90365 Module. It provides an overview of the PTC-04 and
gives instructions for using the MLX90365 AAA & ABB device module.
The MLX90365 is based on the architecture of the MLX90316, and therefore the DB90316 and Firmware
90365 are used for the PTC-04.
•   PTC-04 datasheet
•   MLX90365 datasheet
•   PTC-04 Software Installation Notes: Get_Started_with_PTC04.pdf
System Architecture
Requirements
To install and use MPT for PTC04 on your system must have the following:
NT 4.0, 2000 or XP
A free serial port or a free USB port
50 Megabytes of free disk space
Screen must have minimal resolution of 1024 x 768 with 16 bit colour.
Software History
For revision information, please refer to the release notes located in the HIS090365AAMLX.txt file provide
with the software.
For more information, please check the Melexis programming toolbox documentation.
To open a previous session, choose Open from the profile menu. You may then browse and locate the
saved session. Once you select a file click open to begin the session.
When a Device session is loaded the software will then load any saved preference and presets from the
registry.
Description
The software was designed as a tool for rapid development of MLX90365 sensor applications. The
software provides a simple user interface for programming the MLX90365 and taking measurements. It
has one main solver interface screens. The solver gives the user control over a step by step programming
procedure of the sensor and will program the most important EERPOM settings. This auto-calibration
mode will optimize the programmable settings for the application. The software can be used for
engineering development, analysis, and small volume production.
Main Features
•   Main auto-calibration screen
•   EEPROM screen
•   Settings of PTC-04
•   Absolute Measurements
•   Advanced screen
•   RAM screen
NOTE: It is strongly recommended to read MLX90365 datasheet carefully before using this software.
Melexis would like to emphasize that without a basic understanding of the MLX90365 (or other Tri-axis
products) it can be difficult to use this interface.
5A The Menus
The MLX90365 device module has three menus on the tool bar
                                              Figure 3: Menus
MLX90365 User interface has three menus available on the tool bar
1. Profile
To open a previous session with defined solver settings:
Open-> Choose your *.ini file
To save your session solver settings:
Save-> Define your *.ini file
To close your session:
Close
2. Windows
The Windows menu enables to open special screens, like EEPROM screen, measurement screen,
settings of PTC-04, advanced functions and a RAM screen
5B Auto-Calibration Mode
     The EEPROM interface is an excellent tool for engineering development. However, for most applications,
     manually setting all the device parameters can be cumbersome and time consuming. The Auto-Calibration
     interface provides the user with a semi-automated method for programming the MLX90365. This interface
     makes use of specially developed algorithms to determine the best device parameters to meet the users'
     specifications. Given the proper information, the software will calculate the crucial device parameters.
     Step 1 is mandatory and needs to pass w/o error before continuing
                                                                                1. Press “New device” to clear cache memory,
                                                                                   check the presence and chipverion , read
                                                                                    eeprom and check CRC
     New device
     Before starting to (re)program the MLX90365, all calculating parameters must be reset in the cache of the
     PC and the EEPROM contents of the MLX90365 must be known. To do so click the “New device” button.
     All internal solver parameters will be reset to the default values, the complete EEPROM contents of the
     90365 will be read and copied in the cache, CRC of the received data is checked and the chip version is
     verified.
     Note : The “New device’ button executes multiple PSF90365 methods, like DeviceReplaced, NOPalive,
     Readchipversion ReadFullDevice and CheckCRC
     Solver settings
     To use auto-calibration the user must first define the parameters specific for the application. To do this,
     enter all parameters on the screen or use the profile menu to load a previously stored session.
                           Unchecked = 17 equidistant X points for which only the Y coordinates are defined.
                           Defines the angular working range when using the 16 points output calibration
     Working range         method. See calibration point’s description for more details.
      Clamp Low            Defines the low limit for the output value [ 0..100 %]
      Clamp High           Defines the high limit for the output value [ 0..100 %]
      PWM Freq             Define the PWM frequency from 100Hz to 1kHz
                           Define a fix angle value to adjust the DP or Discontinuity point as the new zero
           DP
                           degrees of the circle. [ α90365 = αmagnet - DP ]
                           Select if a pull-up resistor (5K6) to Vbat is required
         Pull up
                           Note: This option has no prog effect on the device but only on the PTC04/DB90316
                           Select if a pull-down resistor (10K) to Gnd is required
       Pull down
                           Note: This option has no prog. effect on the device but only on the PTC04/DB90316
Output DAC
In case the 12 bit radiometric analog output is selected, the behavior of the Digital – analog converter
needs to be characterized. The gain and offset parameters will be used to correct the errors from the DAC
and adjust all the programmed levels of the calibration points targeted in % Vdd and clamping levels. (In
case of PWM the D/A is not used and therefore default values of gain = 1 and offset =0 are used)
The DAC error is measured between 5 and 95%Vdd (on 2 points)
Note; EEPROM parameter defined in %Vdd are affected by the gain & offset values. See PSF
documentation for more information
Get Gain
Click “Get Gain” to read the current value for the analog gain and the current magnet position. In case the
result is <2 or >30, the magnetic field measured by the chip is most likely respectively too high or too low.
Improper gain settings will give corrupted angle results and lead to wrong calibration results.
Note: This function only shows the actual Virtual gain code from RAM
Define DP
The DP point is also programmable by angle reading in case of random or unknown magnet position.
Based on the actual magnet position and the requested target angle, the solver will calculate the new DP
value and overwrite the previous defined DP value from the solver settings.
Ex: Magnet position is 312 degrees Angle is defined by the user to be at 90degrees. The calculated DP
point will be 312-90 = 222 degrees.
MLX90365 enables to improve the output linearity through a piece-wise linear calibration.
2 options are available:
1. 4points calibration
Ay, By , Cy and Dy define the Output level in %Vdd between 0 and 100% with a16 bits accuracy
Note: The point 0 is only made to calculate the slope 0 but is not written in the EEPROM.
• 5 slopes
Slope0 is the slope before the A calibration point.
         Slope0=(Ay-0y)/(Ax-0x) In case slope 0 is negative, the rotation direction will be inverted
SlopeA is the slope after the A calibration point.
         SlopeA=(By-Ay)/(Bx-Ax)
SlopeB is the slope after the B calibration point.
         SlopeB=(Cy-By)/(Cx-Bx) equal to Slope A if point B is not measured
SlopeC is the slope after the C calibration point.
         SlopeC=(Dy-Cy)/(Dx-Cx) or equal to Slope B if point D is not measured
SlopeD is the slope after the D calibration point.
         SlopeD=(Ey-Dy)/(Ex-Dx) or equal to Slope C if point E is not measured
Note: In case a calibration point is not used, the default angle position is 360 deg and therefore disabled.
     Always start with calibration Point 0 and add additional points A,B..if required…
Procedure:
    1.   Move magnet to first position and define output value, example 10 %. Press “Set first point”
    2.   Move magnet to next position and define output value, example 30 %. Press “Set next point”
    3.   Repeat step 2 if required or remove previous step by pressing “Delete last point “
    4.   Select linear interpolation and press “Fit point”
             o The 17 point will be determined by linear interpolation / extrapolation based in the data
                  collected during step 1 & 2.
             o In case “Front end fit was selected, then a Least square linear fit will determine the best k-
                  dimension linear curve based on the typical Front-end errors fit ( Offset , SMM,..) and
                  recalculate the 17 points for the requested transfer curve.
NOTE : The angle readings from the sensor during step 2, need to correspond with a continuous linear
function and be in the range [0 – Working range] deg. The definition of DP and the clockwise bit are
important.
Tip For best accuracy at a certain position , for example first point, use “define DP” to set the angle
value at that point to one of the 17 calibration points * ∆ X .
Example : for working range = 360 deg application , set define DP @ first point = 0 or 22.5 or 45
Program device
To finalize the auto-calibration all necessary EEPROM parameters will be programmed.
NOTE : The “Self diagnostics ” are not enabled by default, so please check the solvers setting
“Enable diag” or the EEPROM contents to enable the diagnostic check of the sensor.
Note: Only the most relevant eerpom parameters are shown. For the complete list of EEPROM
parameters, please check PSF90365.
     EEPROM
                                                                 Description
     Parameter
     OSC TRIM           Digital trimmed code for the oscillator frequency [ 7 Bit ]
T +35 Digital trimmed code for internal temperature sensor 1 @ 35 deg [ 16 Bit ]
T -60 Min code for internal temperature sensor 1 @ -60 deg [ 8 Bit ]
T +170 Max code for internal temperature sensor 1 @ 170 deg [ 8 Bit ]
       I Trim           Digital trimmed code for Current source Hall plates[ 5 Bit ]
XOFFSETSLOPES
                        -40 to T35 and T35 to 125deg linear offset compensation slopes for X, Y and Z axis
YOFFSETSLOPES
                        [ 2x8 Bit ]
ZOFFSETSLOPES
    ID 1/2
    ID 3/4              Unique IC identification [ 3 x 16 bit]
    ID 5/6
       SMISM            X/Y sensitivity mismatch correction [ 16 bit ]
      ORTHXY
      ORTHZX            X/Y, Z/X and Y/Z Phase mismatch correction [ 3 x 8 bit ]
      ORTHYZ
        X0
        Y0              Offset compensation correction @ 35 Deg for X, Y and Z axis [ 3x 16 Bit ]
        Z0
The Melexis eeprom parameters are read only calibrated and traceability parameters.
They are the results of tests and calibration procedures at tree different temperatures.
     EEPROM
                                                                 Description
     Parameter
                        If enabled, A scaling factor is applied to LNR Y coordinate parameters
   Enable scaling       Default Range [ 0..100 ] -> [ -50 .. 150 ] % Vdd .
                        Note ; only needed in case of 4 x 90 deg saw tooth application
                        Selects the active output mode, in case no fault
                        0          = OFF / HiZ
    Output Mode
                        1, 2, 3, 4 = Analog modes
                        5, 6, 7 = Digital modes
                        Selects the diagnostic output mode, in case of a fault
                        0          = OFF/ HiZ
 Output DIAG Mode
                        1, 2, 3, 4 = Analog modes
                        5, 6, 7 = Digital modes
OsDiag.Diag Determines the reporting level (0= low, 1= high) during start-up or during a fault reporting
    CUST ID 1
    CUST ID 2        Free customer identification number [ 3 x 16 bit]
    CUST ID 3
                     B1/B2 sensitivity mismatch correction , if MAPXYZ <>0
                     MAPXYZ = 1, SelK = 1 -> Angle ( k* X / Z)
        K
                     MAPXYZ = 2, SelK = 0 -> Angle ( Z / k * Y)
       Sel K
                                                                         [ K 15 bit; SelK 1 bit ; k = K / 2^15 ]
                     Enable PWM H/W & S/W, but not the output stage. Use Outmode to switch the output
      PWM
                     stage to PWM.
                     PWMPOL defines the polarity of the output in PWM Mode.
                     0 = Period Start with rising edge
    PWMPOL
                     1 = Period Start with falling edge
                     Note : Keep PWMPOL parameter aligned with parameter OsDiag.Diag
     PWM SR          When enabled, doubles the rise and fall times in PWM modes
                     When enabled, the output is based on 4 LNR reference points and 5 LNR slopes.
     4 points
                     When disabled, output is based on 16 points linear points inside working range W
                     When enabled, Virtual gain is limited by GAINMIN / GAINMAX values
  Gain saturation    When disabled, Virtual gain range is [0 .. 41 ] and Gainmin/max are used as diagnostic
                     levels.
        W            Working range [ 65.5 … 360 ] deg for 16 points linear setup [ 4 bits]
                     The MAPXYZ parameter defines which fields are used to calculate the angle.
                     0 = Y/X mode
     MAPXYZ
                     1 = X/Z mode
                     2 = Z/Y mode
     GAINMIN         Defines the minimum virtual gain value or minimum threshold value for gain diagnostic
GAINMAX Defines the maximum virtual gain value or maximum threshold value for gain diagnostic
Clamp High Defines the High limit for the output value [ 0..100 %]
    EEPROM
                                                             Description
    Parameter
     LNR S0          Signed Slope if digital angle < Ax
Note: To avoid strange output behavior, keep LNR_A_X ≤ LNR_B_X ≤ LNR_C_X ≤ LNR_D_X
    EEPROM
                                                             Description
    Parameter
      Y0 [%]         Y coordinate at 0 deg point in % Vdd
5D MEASUREMENTS
  Measurement
                                                        Description
   Parameter
     Out1MUX         Enable output measurement (analog or PWM duty cycle)
5E Settings
This are the default recommended settings for PTC-04 / MLX90365.
      Settings
                                                                  Description
     Parameter
  Voltage settings      Default voltage settings (V) for normal and communications mode
                        Default timing settings when PTC-04 command is send ( uSec)
                        Tpor = Time power on reset= Time @ VddNorm
                        TSynchro = Time before sending synchronization pulses @ Vdd_Comm
   Timing settings
                        Baudrate = Communication Speed of modulated signal at output pin
                        B.R Sync Diff = Correction of baudrate ( baudrate + Sync diff) during synchronization
                        pulses for big capacitors.
                        Switch on/off pull up or pull down resistor. See datasheet DB_90316 for
      Resistor
                        more information.
5F Advanced
    Advanced
                                                             Description
    Parameter
                       Reads the contents (16 bit) of any address defined in Addr. Result = “Data in” and
     Memread
                       checks CRC
MemWriteWithCRC        Writes the contents ( 16 bit) of “Data out” to any address defined in Addr.
                       Checks the PTC-04 communication by sending “Hello” and expects a valid answer from
     NopAlive
                       the 90365
Reset Vdd: Reboot the sensor by switching off the supply for a short period and set Vdd=5V
5G RAM
The Melexis RAM parameters , displayed in Hex code, are used to check the status of 90365.
ERROR FLAGS Error status : See chart below for more details
DIAG FLAGS Diagnostic status : See chart below for more details
Error Flags
Enable
With the Enable function is used to enable or disable the automatic logging function. The function is
default enabled.
Log
The log function is used to manually log information. This is a specialized function similar to those
functions under the action menu.
Preferences
This command is used to access the log preferences window. In this the window the user can customize
and configure all the data log options.
The MPT is equipped with two logging systems: a Data Log and a
System Log. The Data logger, logs for each performed read back,
the device parameters (decoded ROM contends) and the software
parameters like targets of the Auto calibration , etc…
The system logger logs all performed functions including solver
loggings.
The change the logging filename and options, select the menu
“Tools → Options. See figure 11.
Important Note
The parameter headings and units of measurement are not recorded in the log file. Only the value of the
parameter is saved.
The PTC software has an effective automated calibration tool. This section describes the process used in
the automated calibration tool. Understanding the calibration process will help developers create new
products, diagnose problems, and improve performance. The following information provides a general
approach to programming the MLX90365. Upon request Melexis will provide any additional information or
specific technical support.
Programming Procedure
1. Read the MLX90365 datasheet. Using the datasheet try to estimate some of the parameters. Make
   sure the target specifications are within the limits of the devices.
3. Program the transfer function Vout = Slope x angle + offset, using the LNR parameters. Use the
   GetAngle() function to define the X coordinates of calibration point A,B and C
2) No Readback . Make sure the device is inserted in the socket correctly. Check the connections of
   Vdd, Gnd and output. This should be verified with measurements screen: VDD=5V, IDD = 5..10mA
   and Vout for new devices = 2.5 V
If the connection is OK and bigger capacitor values are used , try reducing the baudrate , increase Tpor
and Tsynchro
3) Writing to EEPROM failed. Writing to the EEPROM is only possible to the customer area.
4) Firmware is not recognized as MLX90365". To use the PTC-04 as programmer for MLX90365, the
   correct firmware must be loaded. Load MLX/90365 firmware with the PTC-04 UI.
5) Daughterboard not recognized or revision too low. To use the PTC-04 as a programmer for
   MLX90365, the correct daughterboard and firmware is needed. Check if the DB90316 is installed and
   the correct firmware is loaded. For more information: datasheet PTC-04, DB90316 and UI PTC04 /
   Configuration