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.

TM4C123AH6PM: SPI error

Part Number: TM4C123AH6PM

Hi,

I have connected encoder to SPI.

Is there a way to check various failure for example:

  • Encoder not connected to ground, so data and clock are floating.
  • Encoder data not connected
  • Encoder clock not connected

in software? I have seen there is an error callback but I did not understand

if it could work in my context.

Thanks in advance.

Best Regards

  • Hi,

    Is there a way to check various failure for example:

    • Encoder not connected to ground, so data and clock are floating.
    • Encoder data not connected
    • Encoder clock not connected

    in software?

    Sorry, I don't think it is possible to fully check in software. I don't know what type of encoder you have. You will need to read the specs of it. I can image there are some registers such as a device ID register on the encoder. In every software bootup, you would first read the ID register. If you can't read successfully, then it means something is wrong on the connection whether it is the clock or data or the encoder is not connected to ground. If there is no such ID register then I hope there are some other registers you can interact with. For example, writing to a control register on the encoder and read back the register. If the read back is different than what is written then again, it gives an indication that something is wrong on the connection between the MCU and the encoder. 

  • Thank you very much,

    Can be a good solution even it requires to write register, read register and if ok read data.

    Hope do not break the connection when read data.

    Best