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.

TMAG5170: Is it possible to reset the hall sensor?

Part Number: TMAG5170

Tool/software:

This query is linked with the query I posted before:

https://e2e.ti.com/support/sensors-group/sensors/f/sensors-forum/1391781/tmag5170-if-initialization-is-not-successful-during-the-micro-initialization-the-angle-data-comes-in-the-next-cycle/5325831#5325831

Sample source code:

Steps followed:

Flash the software (Lauterbach debugger).

Flashing the software will cause a system.up and some of the source code gets executed.

Start the debugging session (by pressing go). This will cause another system.up causing a micro reset.

However, during this time hall sensor is already initialized. And there will be no reset of  sensor.

During this scenario, we get a previously requested response in the current request. Hence, the current response comes in the next cycle.

Something like this:

If you notice in buffer [0][2], we are getting the angle response.

* Response buffer data is populated in SPI interrupt

So, we were wondering is there a way to reset the hall sensor?

Are there any register configurations that we are missing to perform?

  • Sushma,

    If you put the device into Deep Sleep Mode, it will not retain any key register settings or the last measurement data:

    Your configuration looks like it should be putting the device into active measure mode for XY channels at +/-100mT and XY angle enabled at 32x averaging.

    Thanks,

    Scott

  • Yes, we want to be in active measurement mode.

    Upon a micro reset, should we first set the device config register to enter deep sleep mode? Then follow it by active measurement mode?

    I did not understand how this can be implemented.

  • Sushma,

    That is right, since you need to be in active measurement mode, you could set the MCU to first program the device to enter deep sleep mode and then follow this by programming normally.  This will reset the register values of the device and then initialize it using your desired configuration.

    Thanks,

    Scott

  • Hi Scott,

    Thanks for the quick response.

    I implemented it as suggested. Even after those changes, I am getting the same issue.

    Code changes:

    Response:

  • I have attempted your setup:

    • Run Deep Sleep Command 
    • Disable CRC
    • Write 0x5026 to register 0x00
    • Write 0x1023 to register 0x02
    • Write 0x40CA to register 0x01
    • Read Angle result = 0x03A4
    • Run Deep Sleep Command
    • Read All Registers
      • 0x00 = 0x0000
      • 0x01 = 0x0000
      • 0x02 = 0x0000
      • 0x13 = 0x0000 (Angle result is reset)
    • Write 0x5026 to register 0x00
    • Write 0x1023 to register 0x02
    • Write 0x40CA to register 0x01
    • Read All Registers (without moving magnet)
      • 0x00 = 0x5026
      • 0x01 = 0x40CA
      • 0x02 = 0x1023
      • 0x13 = 0x0398

    From what I can tell, the deep sleep mode is working as expected for me.  I would recommend confirming with a logic analyzer or oscilloscope that you are capturing data on the data bits (D0-D15) as you send individual SPI transactions, and that there isn't an issue in the SPI buffer in code.

    Thanks,

    Scott

  • Hi Scott,

    Thanks for the detailed information. 

    One question: What is the recommended initialization procedure for this hall sensor? Do you suggest entering deep sleep mode before configuring the sensor? 

  • Sushma,

    It is normally not necessary to enter deep sleep to begin.  Your procedure looks fine.  The only reason for recommending the addition above was to ensure that the device has its registers fully reset.

    As a next step, I would step through the code in debug mode and monitor each SPI transaction to ensure that the data is being handled as expected.  You should see the registers reset after sending the deep sleep mode command.

    Thanks,

    Scott