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: Information needed on when to expect the data after transmitting the data on SPI

Part Number: TMAG5170

We have designed the SPI transmission something like this.

As per this design, we expect the data of read buffer to come in next write job. However, the data received is inconsistent. Sometimes, we receive the read request data in the same read receive buffer while some other time, we receive the data in write receive buffer.

In the below example: 

We are reading from testconfig register and writing to test config register in the same cycle (async transmit with 2 jobs, read first followed by a write)

First values obtained:

After a cpu reset, we obtain values like this

Could you please suggest what is going wrong in this situation?

  • Hello Sushma,

    Thank you for considering to use Texas Instruments.  I am not sure I am properly interpreting your SPI transmission diagram, can you confirm you are only attempting to write and read when CS is low?  Also have you looked at your communication lines with a scope?  Can you provide a scope or logic analyzer shot of your transmission?

  • Here is the shot of the scope. We are reading the angle data and writing to sensor config register. sometimes, MISO data gets flipped. We get the angle results in the write buffer. 

  • Hello Sushma,

    Thanks for providing that.  I am still processing the information you provided.  I will try to follow up before the close of business today.

  • Hello Sushma,

    Can you comment on whether this is the first communication after powering on the device or is this after writing and configuring other registers?

  • The oscilloscope shot is after writing and configuring the registers.

  • Hey Sushma,

    Assuming DATA_TYPE = 000b and you already wrote once to the sensor config register, what you have shown does not seem erroneous to me.  Per the initial read frame, your MOSI sets the address to Angle_Result and signals  to initiate another conversion when CS goes high. During that frame the MISO sends status bits 11-4 indicating no prior CRC error and that the channel data is current for X,Y, and T and ready to send.  Subsequently within the same frame, the angle result is shared, which is ok if you already enabled calculation in the sensor config register on a prior write.

    As for the write frame, I see you are writing to enable XY channel and their angle calculation.  If you have already sent such a write command with the same desired settings, that should not be necessary unless you just exited from deep-sleep mode.  As you are writing to the device, the MISO should show 0 for bits 9-24 (assuming once again DATA_TYPE=000b).  Status bit yet again do not  indicate an error with prior CRC.

  • Thanks for the clarification. We assumed that the angle data will come in the next frame and we did the design of our SPI that way. I changed it quickly and all good now.