SLYA092 June   2025 TMAG3001

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2Z-Axis Pressing Offset Issue in 3D Linear Hall Sensor
    1. 2.1 Root Cause of X, Y Offsets in Z-axis Pressing Action
  6. 3The Z-Axis Pressing Detection Method
    1. 3.1 General Introduction of Proposed Method
    2. 3.2 Software Slew Rate Detection
    3. 3.3 Hardware Threshold Detection and Interrupt
    4. 3.4 Latching Method
      1. 3.4.1 Implementation of Two-Level Detection Method
    5. 3.5 Test Result
  7. 4Summary
  8. 5References

Implementation of Two-Level Detection Method

The detailed implementation of two-level detection method is specified in the following, taking TMAG3001 as an example.

  1. Obtain the magnetic flux change in Z axis by pressing the joystick
    This step is used to set a correct threshold for hardware detection and a designed for step for software detection.
  2. Set a corresponding threshold on Z axis by using THR_Config_3 register in TMAG3001 or Z_THR_Confing in TMAG5173.
    Larger thresholds require more pressing distance in the Z axis which also allows for larger offset in X and Y. A lower threshold means a reduced pressing distance in Z-axis, but this can cause a false trigger if set to low.
  3. Set the interrupt signal in INT pin by writing 1h to INT_CONFIG_1 4-2 bits.
    The INT pin sends a signal to MCU to indicate that the magnetic flux has already crossed the threshold.
  4. During normal operation the 3D linear Hall-effect sensor works in continuous sample or trigger sample mode based on user setting. The MCU calculates the slew rate or absolute change value based on the conversion number to determine whether the threshold is exceeded.
  5. Once the hardware threshold or the slew rate exceeds the setting value the device enters iterrupt or latch mode. The previous X and Y axis are recorded into an array immediately and then MAG_CH_EN to 4h is set to 4H(Only convert Z-axis magnetic flux). After the interrupt is cleared, the main function returns to normal working mode and sets MAG_CH_EN to 7h(enable all three-axis conversions).

Figure 3-4 shows the flowchart of detailed implementation of proposed detection method.

 Flow Chart of Proposed MethodFigure 3-4 Flow Chart of Proposed Method