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.

TCAN4550: No response to a read of Device ID register

Part Number: TCAN4550

When I try to read the TCAN4550 device ID in a loop, the first time, I get no response.

After this request I read the Status Register (0x000C), it gives me 0x0031000A as a response. This means the "SPI_end_error", "Invalid_command", "read_underflow", "Internal_access_active" and "SPI_error_interrupt" bit are set. I am not sure why these errors occur.

Here are some screenshots of the oscilloscope:
(just for clarity; CLK is yellow, nCS is pink, MISO is blue, MOSI is green)


This shows both requests; Device ID (the first block) and Status Register (the second block).


This shows the request of the Device ID register (at address 0x0000), but there is no data on the MISO.

These messages are in a loop. The next time the mcu enters this code, the TCAN does send a response:

Although the Status Register still is set to 0x0031000A (same as before).

What causes these error bits to be set? And how to fix these mistakes?

  • Hello Laura,

    I noticed in the second scope plot you shared that the SCLK is High when the nCS signal transitions Low at the beginning of the SPI Read.  This is not correct and may be the cause of the SPI Errors. 

    The TCAN4550 counts the clock cycles between the nCS transitioning Low and then High.  If the number of clock cycles is not correct (i.e. a multiple of 32, or the correct number based on the Length field) then a SPI Error will be flagged.  Therefore most SPI errors are the result of an incorrect number of clock cycles/edges or an incorrect Length Field. 

    This plot shows a Length field of 0x02, and that requires 96 clock cycles which is correct since it appears there are 16 clock cycles in each burst.  So this is correct, but the initial falling clock edge may be causing the problem.

    Your other plots that show data is returned on MISO, has the SCLK starting off as Low when nCS transitions Low.  Try to correct the SCLK value so that it has an initial Low value before starting your SPI sequence and see if this resolves the issue.

    Regards,

    Jonathan

  • Hello Jonathan,

    Thank you for your explanation! I added a software pull-down to the CLK, this way the initial state of the CLK is low.

    I now receive an answer upon my first read request! So this fixed my issue indeed!

    Thanks again!