This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMAG3001: Calculating single axis BOP and BRP

Part Number: TMAG3001

Tool/software:

Hi,

Im still working on my previous issue - getting the TMAG3001 to trigger once when a button is pushed and released.  Its not obvious to me how to calculate the BOP and BRP values.  My current mode is Z axis.  Parameters are below.  I can make it trigger continuously while pushed, but not just once per press.  Raw values range from ~13000 when unpressed to ~25000 when pressed.


temp 24.31
X 0.00 Raw 0
Y 0.00 Raw 0
Z 29.52 Raw 12400
angle 0.00
Mag 00.00
Status 10
Press count: 62897
Int Config1 0x14
SensorConfig1 0x40
SensorConfig2 0x1
SensorConfig3 0x20
SensorConfig6 0x7F
Thr Config1 0x0
Thr Config2 0x0
Thr Config3 0x50

  • Hi Larry,

    Thank you for posting to the Sensors forum!

    BOP gets set in the THR_CONFIG_x registers as an 8-bit signed magnitude value for unipolar switch mode (7-bit unsigned for omnipolar switch mode).

    To calculate the BOP value from mT, the Equation 13 from the datasheet can be used:

    From the above, solving for Threshold (mT) you get the following equation:

    SENS, depending on your range the options would be:

      for the A1 variant

     for the A2 variant

    For unipolar switch mode, if setting a negative threshold, the most significant bit should be set to 1.

    To set BRP when THR_SEL = 2h, see the THR_HYST bits in Device_Config_2. BRP values when in switch mode are represented in 12-bit resolution, so to convert to a mT value, the THR_HYST value will need to be converted to 16-bit resolution.

    For example, if THR_HYST is set to 2h, the BRP would be 8LSB of threshold in 12-bit resolution. To convert to a mT value, please see the below example:

    1. Convert 8LSB from 12-bit resolution to 16-bit resolution by bit shifting 8LSB to the left 4-bits
      1. 8LSB << 4 = 128LSB
    2. Convert LSB to mT, assuming that the magnetic range is ±40mT SENS will be 885LSB/mT
      1. 128LSB / 885LSB/mT ≈ 0.145mT  

    Best,

    ~Alicia