SLYA092 June 2025 TMAG3001
Once the software or hardware threshold has been triggered, TMAG3001 creates an output flag as an indicator. In practical applications, once the joystick has been pressed, the system does not require any X and Y information as long as the Z-axis press is maintained. Until the button press is released, any new X or Y output data from the Hall-effect sensor can ignored while focusing solely on the Z-axis conversion result.
In this example, The MAG_CH_EN function in the register of the TI Hall sensor was used to enable only the conversion of the Z-axis during the press event. This allows the 3D linear Hall sensor to update only the Z-axis information to the MCU. Since each additional axis conversion adds to the total conversation time for the sensor, sampling only on Z during this time can improve the system response time to restore X and Y tracking.
To make sure of robust tracking of the X and Y positions prior to the button press, an array is used to create a buffer to save the X and Y information immediately when the program enters the interrupt function. The number in the buffer was used as the X and Y conversion numbers to further decrease the offset value.