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.

TPS274C65EVM: Develop driver for TPS274 on AM243xEVM module

Part Number: TPS274C65EVM
Other Parts Discussed in Thread: TPS274C65

Tool/software:

We have written code that drives to enable and disable channels and turn on/off Led 1_4 and 5_8 on AM243xEVM platform over SPI that does not work. 

We first developed the code on Arduino Uno R4 just to quickly verify the hardware connection and setup and explore the features of the TPS274C65 EVM-USB board. That works fine. We can turn on/off the channels, See That proper current drives the channels, turn on/off LEDs, and configure the current. We can read back the registers.

However, the same code doesn't work on AM243xEVM. Of course, the SPI driver is different—on AM243xEVM, we are using TI's SPI driver. To confirm if our driver works, we have connected the SPI motor driver chip to AM243xEVM on the same bus and even with the same CS, clock frequency, and other settings. We can drive the with the third-party SPI motor driver. However, TPS274 does not do anything. 

We are currently using a 2MHz clock frequency over SPI. We have checked and reviewed the setup and implementation. The same setup works with Arduino but not AM243. We are looking for anything or ideas to debug. 

  • Hi Jamil,

    What SPI clock polarity and phase settings are you using on AM243xEVM?

    Thanks,

    Patrick

  • Here are the settings for SPI and CS. Let me know if you need any further information. If you provide I can send you the screen shots of configuration.

    const mcspi = scripting.addModule("/drivers/mcspi/mcspi", {}, false);

    const mcspi2 = mcspi.addInstance();

    mcspi2.$name = "CONFIG_MCSPI1";
    mcspi2.initDelay = "8";
    mcspi2.SPI.$assign = "SPI1";
    mcspi2.child.$name = "drivers_mcspi_v0_mcspi_v0_template1";
    mcspi2.mcspiChannel[0].$name = "CONFIG_MCSPI_CH1";
    mcspi2.mcspiChannel[0].bitRate = 2000000;
    mcspi2.mcspiChannel[0].CSn.pu_pd = "pu";
    mcspi2.mcspiChannel[0].CSn.$used = false;

    mcspi2.udmaDriver = udma1;

    mcspi2.SPI.CLK.$suggestSolution = "SPI1_CLK";
    mcspi2.SPI.D0.$suggestSolution = "SPI1_D0";
    mcspi2.SPI.D1.$suggestSolution = "SPI1_D1";

    Chip select

    gpio2.pinDir = "OUTPUT";
    gpio2.$name = "SPI1_CS1";
    gpio2.trigType = "BOTH_EDGE";
    gpio2.defaultValue = "1";
    gpio2.GPIO.gpioPin.pu_pd = "pu";
    gpio2.GPIO.gpioPin.$assign = "SPI1_CS1";

    gpio2.GPIO.$suggestSolution = "GPIO1";

  • Additional information: I can write values 0x01, 0x02, 0x04, 0x08 to TPS274C65 register 0x4D, which doesn't exist to see Red LEDs turn on based on the values set and SW channels get enabled and we notice a couple of heaters turn on. 

  • Hi Jamil,

    Sorry for the delay on this, could you try changing the frame format to POL0, PHA1 and seeing if that works?

    Thanks,

    Patrick

  • I had tried POLO, PHA1 before raising the issue. It did not work. I am going to try it again later today and shall get back to you. 

  • Hi Jamil,

    Understood, please let me know the results.

    Thanks,

    Patrick

  • Hello Jamil,

    Based on the above information , it seems that you are controlling the CS lines manually and you are not using the driver to control the CS line. 

    What is the reason manually to control CS rather than a MCSPI driver?

    On the SOC side, which the data size is configured as 8 or 16 or 32 bits and the same data size is supported on the TPS side as well?

    Hello Patrick, is there any reason to suggest customers use the POLO, PHA1.

    Does the TPS EVM support which polarity ?

    Regards,

    Anil.

  • Hello Jamil,

    Please find the today's meeting notes.

    Next items on Jamil Side : 

    1.  Do the same Testing  with 3PIn mode and disable the CS  line from the syscfg

    2. Configure SPI with Mode 1 (POL0,PHA1)

    3. If the above suggestions do not work out, monitor the CS lines and Data lines.

    Regards,

    Anil.

  • Hello Patrick,

    If you or your team have already interfaced TPS with AM263 or any other SITARA devices please attached the code here.

    Regards,

    Anil.

  • Anil, your suggestions worked. I made few changes:

    1. re-created project from scratch.

    2. change the mode to POLO, PHA1.

    3. enabled CS as part of MCSPI transaction. 

    4. removed extra MCSPI_transfer we were doing to deal with issue with other third-party peripherals. Now only doing single transfer. 

        transferOK = MCSPI_transfer(gMcspiHandle[CONFIG_HEATERSPI], &hSpiTransaction);

    Thanks for the support. 

    Please mark and close the thread as resolved.