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-Q1: do`n read Device ID

Part Number: TCAN4550-Q1
Other Parts Discussed in Thread: AWR2544, TCAN4550, , AWR2944

Hi

we use AWR2544 work with TCAN4550, But now I don`t read TCAN Device ID (The register 0x0000-0x000C don`t read) .

I use code example from TI (C:\ti\mmwave_mcuplus_sdk_04_06_00_01\mcu_plus_sdk_awr2544_09_01_00_05\examples\drivers\mibspi\mibspi_loopback), 

and TCAN4550_DEMO. we use mibspi connected TCAN. The hardware schematic diagram are as follows:

AWR2544 example Demo mibspi_loopback config are as follows:

2544 init reset TCAN RST pin,
void freertos_main(void *args)
{
    Drivers_open();
    Board_driversOpen();
   
    uint32_t baseAddr = (uint32_t)AddrTranslateP_getLocalAddr(CONFIG_GPIO0_TCAN4550_RST_BASE_ADDR);
    GPIO_pinWriteHigh(baseAddr, CONFIG_GPIO0_TCAN4550_RST_PIN);
    ClockP_sleep(1);
    GPIO_pinWriteLow(baseAddr, CONFIG_GPIO0_TCAN4550_RST_PIN);
    ClockP_usleep(5000);
    //mibspi_loopback_main(NULL);

    Test_Com();
    vTaskDelete(NULL);
}
void Test_Com(void)
{
    int32_t status = SystemP_SUCCESS;
    uint32_t i;
    int32_t transferOK;
    MIBSPI_Transaction spiTransaction;



    DebugP_log("[MIBSPI] Digital Test example started ...\r\n");

    int len = 0;
    gMibspiTxBuffer[len++] = 0x41;
    gMibspiTxBuffer[len++] = 0x00;
    gMibspiTxBuffer[len++] = 0x00;
    gMibspiTxBuffer[len++] = 0x01;
    gMibspiTxBuffer[len++] = 0x00;
    gMibspiTxBuffer[len++] = 0x00;
    gMibspiTxBuffer[len++] = 0x00;
    gMibspiTxBuffer[len++] = 0x00;
    SPI_write(gMibspiTxBuffer,len);
    SPI_read(gMibspiRxBuffer,len);
    SPI_read(gMibspiRxBuffer, len);
    SPI_read(gMibspiRxBuffer, len);


    return;
}
as sent above read DeviceID, the diagram of logic analyzer as follows:
when I canceled init TCAN Rst Pin, the MISO  all bytes are 0xff, other waveform like above diagram.
Can you help ma, Let SPI commucation with TCAN properly, Thank you.
  • Hello Nill,

    The schematic looks generally OK, but I don't see what the voltage levels that are used for the VSUP, VIO supply pins, and what the pullup resistors are connected to.  Can you tell me what the voltage levels are for the following pins during your test so that I can verify the part is correctly powered and the internal LDOs are at the correct value?

    VSUP, VIO, VCCOUT, FLTR, INH, RST

    The SPI signals look ok up until the extra clock cycles before the CS signal transitions high.  These clock cycles will generate a SPI error by the device because they occur while the CS signal is low.  The TCAN4550 will count the clock cycles and if there is an incorrect number, then it will discard any SPI write commands, and it will set the SPI Error (SPIERR) interrupt status flag.  If the SPI is working correctly, you will see the SPIERR bits returned on the MISO signal on every SPI transaction.

    The common reasons for SPI errors include a protocol or formatting issue, device power/reset issue, or a clock issue.

    The protocol looks good enough to see some activity on the MISO signal for a Device ID read even if there is a few extra clock cycles that result in a SPI Error. 

    A clock can be excluded for a Device ID register read because the registers 0x0000-0x000C only use the SPI clock and do not use the device clock (crystal).  Therefore if the SPI signals are correct and there is not a another issue such as power, then you should be able to read the Device ID register.

    Because I don't see any activity on your MISO signal, so the device may have a power or reset issue.  If the supply voltages are too low, or the reset (RST) pin is "high" then the device will be in a state of reset and be non-responsive to SPI.  This is why I've asked for verification on the power and reset pin values.

    Regards,

    Jonathan

  • Hello, Jonathan

    I used Scope to measure what  the voltage levels are for the pins, the pictures as follows:

    (Vsup : min = 11.2v, max = 11.8.         Vio: min = 3.20v, max = 3.34v, RST is "low")

      

    Device power/reset look ok, I`m very confused about why don`t read TCAN. 

  • Hi Nill,

    Thanks for verifying the input voltage rails of VSUP and VIO, as well as the RST voltage.  Can you also verify the VCCOUT, FLTR, and INH voltage levels?  These voltages are output from the device and will tell us if the part is powered up properly.  If these voltages are not at the proper levels, then the part may have entered Sleep Mode as a result of the Fail Safe Function and the Sleep Wake Error (SWE) Timer expiring and it will not be able to respond to SPI.

    Upon power up, the processor has approximately 4 minutes to configure the TCAN4550-Q1, clear the PWRON flag or configure the device for Normal Mode. If this doesn't happen, then the part will enter Sleep Mode and the internal LDOs will be disabled and the SPI communication will not be possible.

    If the device has been powered for longer than 4 minutes when you try to do your SPI communication, then you may need to power cycle the TCAN4550-Q1 or issue a local wake up by pulsing the WAKE pin or provide a wake up pattern (WUP) on the CAN bus which will wake up the TCAN4550-Q1 from Sleep Mode and cause it to enter Standby mode where it will restart the 4 minute SWE timer.

    Can you try to verify that the device is not in Sleep Mode by measuring the voltage on the VCCOUT, FLTR and INH pins as well as try your SPI communication right after a Power Cycle?

    Regards,

    Jonathan

  • Hello Jonathan,

    Every SPI comminication, all operations are performed immediately after power on, even I give RST pin low-high-low in program initialization.

    I will measure the voltage on the VCCOUT, FLTR and INH pins. 

  • Hello Nill,

    How long after the RST pulse ends are you waiting before trying to communicate through SPI?  You will need to wait at least 700us.  If you are trying to communicate with the device immediately after the RST pulse and before 700us has elapsed, then the device will be unresponsive through SPI and this could be the reason you are not seeing any SPI activity.

    Please check the time between RST pulse and the start of your SPI communication.

    Regards,

    Jonathan

  • I am trying to communication after the RST pulse to high 1s and low 5s.

    (FLTR : min = 1.0 v, max = 1.33V         Vccout: min = 4.58v, max = 4.91v)

    I don`t measure the voltage on the INH pins because it on exposed position on the board.

  • Hi Nill,

    Thanks.  It looks like the voltage levels are a little lower than I would expect, but it shows the device is not in Sleep Mode, so SPI communication should be possible.

    I took a closer look at your SPI waveforms and I think there may be a polarity issue with the clock to data sampling edge.  The data is sampled on the Rising edge of the clock and in your waveforms it shows that it is transitioning during the rising edge.The datasheet shows what the timing format should look like.

    Looking closely at this clock to data relationship on your logic analyzer plots, show the data is transitioning on each rising edge which would prevent the TCAN4550 from seeing a valid SPI op code of 0x41 for a Read. 

    Can you try to adjust the polarity so that the data bits transition on the falling edge of the clock and are stable on the rising edge?  Hopefully this will resolve the primary issue of the TCAN4550 not being responsive.

    Regards,

    Jonathan

  • hi Jonathan

    I changed the SPI ti mode 1, then I can read the device ID.but I am confused about the extra clock cycles.

        

    I use the demo is :

    MMWAVE-MCUPLUS-SDK  mmWave SDK for AWR2544, AWR2944 and AM2732   ,  

    The demo from Ti.com, about MIBSPI config as above

    Can you check 2544 MIBSPI demo about SPI communication?

    Thank you.

    Nill

  • Hi Nill,

    I'm glad that we now have the SPI polarity format issue resolved and that the TCAN4550 is recognizing and responding to the data.  However, I too am confused by the extra clock cycles.  My expertise is with the TCAN4550 and I don't have any experience with the AWR2544 so I will have to re-assign this thread to the forum that supports the AWR2544.

    Regards,

    Jonathan

  • Hello Nill,

    This is looks like known issue we found recently and will be fixed properly in the next release of SDK.
    I am attaching a zip of the files here:
    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/138/SPI-issue.7z

    Note: The fix is with regards to AWR2944 but can be used in AWR2544 as well, please update the paths for the same according to the SDK being used. You can diff the files and take the necessary changes. As it’s a different SDK for AWR2544 please don’t directly paste the files without checking the diff once.

    Regards,
    Saswat Kumar

  • Hello Saswat ,

    Following your file and method, I modified AWR2544  MIBSPI and resolved the issue in MIBSPI with DMA enable.

    But if disable DMA in MIBSPI , the CS pin is alway low, because the csHold is cleared when DMA is enable. for mode that DMA is disabled in MIBSPI, the last transfer is no operation to clear cshold.

    And I have another querstion about TCAN4550 that I wan to ask Jonathan :

    I completed the TCAN4550 initialization refer to  the TCAN demo, but when I called the function 

    TCAN4x5x_MCAN_ClearInterruptsAll     // Resets all MCAN interrupts (does NOT include any SPIERR interrupts).

    then I call TCAN4x5x_MCAN_WriteTXBuffer to write to the TxBuffer,  I received a CANERR from TCAN with SPI communication.

    the Log as  follows (W and R are synchronous) :

    ClearInterruptsAll
    W: 0x61 0x10 0x50 0x01 0xff 0xff 0xff 0xff
    R: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
    W: 0x61 0x81 0x74 0x04
    R: 0xa0 0x00 0x00 0x00

    Regards,

    Nill

  • Hello Nill,

    Thanks for the feedback for the fix, I will let the software team know on this issue. I hope for now you can use the DMA enabled mode.

    Let me let Jonathan know about this.

    Regards,
    Saswat Kumar

  • Hello,

    I hope somebody answer my querstion.

    I completed the TCAN4550 initialization refer to  the TCAN demo, but when I called the function 

    TCAN4x5x_MCAN_ClearInterruptsAll     // Resets all MCAN interrupts (does NOT include any SPIERR interrupts).

    then I call TCAN4x5x_MCAN_WriteTXBuffer to write to the TxBuffer,  I received a CANERR from TCAN with SPI communication.

    the Log as  follows (W and R are synchronous) :

    ClearInterruptsAll
    W: 0x61 0x10 0x50 0x01 0xff 0xff 0xff 0xff
    R: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
    W: 0x61 0x81 0x74 0x04
    R: 0xa0 0x00 0x00 0x00

    Regards,

    Nill