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: Data format and CRC in special mode

Part Number: TMAG5170

Hello,

I have 2 questions regarding the special read mode of the TMAG5170. I am not sure what I’m doing wrong here, but these 2 behaviors seem to be different from what the datasheet says. I have implemented workarounds for both of them, but I need confirmation that this is how the sensor should behave.

 

First Problem: The order of the data that I get with special read.

This is a graphic from the data sheet that shows the meaning of the 32 bits in special read mode.

My problem is: If I interpret the data like this, the values don’t make any sense. But when interpret it as if the 4 STAT bits were the first ones, the values make sense again. Here are little drawings of how the data should be (first) and how it seems to be for my sensor (second):

Can anybody confirm that the data in special read mode is in the order that is shown second? It is easy to see that the first nibble is just the counter. I used YZ and XY as data type.

Second Problem: The CRC in special read mode

I implemented the CRC calculation as specified in the datasheet. It works when I write registers and it works when I read registers in standard mode. However, in special read mode, the last Bit is always wrong.

For example, the sensor returns E0 0F F1 A7

In this case I calculate the CRC for E0 0F F1 A0

And I get 6 instead of 7, which is the CRC that the sensor sends

The wrong last Bit is reliable and if I just change that at the end of the CRC calculation, it works perfectly. What am I doing wrong here?

 

Thanks in advance!

  • Andreas,

    Thank you for reaching out on E2E.  This is a known errata in the datasheet, and you are correct to assume that the status bits are at the beginning.  An updated figure is already set to be implemented soon.  The plot in the datasheet should appear as this:

    For the CRC please check your SDI CRC calculation.  In the event that the device receives an incorrect CRC code it will invert the last bit to signal to the MCU that there was a fault.  

    Thanks,

    Scott

  • Scott,

    Thank you for the very fast response. I'm glad to hear that I'm handling the data correctly and that it will stay this way. Regarding the CRC: Seems like I overread that part in the data sheet, but it's explained as you said. In special read mode, I didn't use an SDI CRC since I thought it didn't matter, the response would always be the same. Now that I'm using it, everything works as expected.

    Thank you very much! 

    Regards,

    Andreas