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: Can Communication Via SPI

Part Number: TCAN4550

I am trying to send CAN frame but i observed an unusual behavior as mentioned below.

1. I am able to read and write registers but sometime device response with some unusual data.

2. I am trying to send device in normal mode but sometime it is going in Normal mode and Sometime not. 

3. I am able to see canframe without configured data( Data Always zero) some time on slave slave side . But Frames are not consistent,

Could you please guide me to resolve the above mentioned issue. Please let me know if you need any other information.

  • Hi Kumar,

    I think first we should make sure that SPI communication is working reliably.  Are you able to write to any register and read back correct values consistently?  If not can we please see the analog waveforms of your SPI communication lines so that we can verify they have the proper levels and timing for this device?

    Once SPI communication is verified we could then make sure that your configuration sequence makes sense.  For this it would be good if you could describe to us the sequence of writes/reads you are performing.

    Thank you,
    Max

  • Hi Max,

      Thankyou for your response . Below mentioned is the sequence of command we are sending for read and write. I observed that read functionality is working as expected but write is not consistent.

      To send the Command  i took reference from the sample code provides by ti for TCAN4550.

    Read Sequence:-   

    1. Pull the CS PIN LOW.

    2. Send the Read command (0x41).

    3. Send the Address(ID0 and ID1).

    4. Send the Word Length( 0x1).

    5 Read the response data.

    6.  Pull the CS PIN HIGH

    Write Sequence :- 

    1. Pull the CS PIN LOW.

    2. Send the Write command (0x61).

    3. Send the Address(ID0 and ID1).

    4. Send the Word Length( 0x1).

    5 . Send the data to be written

    6.  Pull the CS PIN HIGH

    Note:- The above mentioned Sequence has been sent without delay.

     Attached is the Raad and Write Waveform details as requested by you.

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/138/Write_5F00_waveform.7zread_waveform.zip

  • Hi Kumar,

    I've checked over both waveform folders you shared. It does indeed look like the read functionality is working properly. This will be helpful to diagnose the problem by reading device status registers. 

    During any SPI transaction, TCAN4550 will send the first byte of its status register when nCS toggles low. In the images of SDO during the write operation, it appears that TCAN4550 is reporting that there has been a SPI error. The details of this error can be seen by reading the SPI status register 16'h000C[30:16]. My initial thought is that this may be because a non-exact multiple of 32 bits has been shifted into the device during a SPI transaction. This appears to be the case in the imamages, but I cannot tell if there are frames following what is shown.

    Please check the contents of the SPI status register for details on this error. Also be sure that an exact multiple of 32 bits is sent while nCS is low (see section 8.5.1.3 of the datasheet). 

    Regards,
    Eric