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.

TMS320F28379D: Communicating with Endat2.2 Encoders with CLB Library - Troubleshooting SPI peripheral

Part Number: TMS320F28379D
Other Parts Discussed in Thread: CONTROLSUITE, TIDM-1008, BOOSTXL-POSMGR

Hello,

I have been trying to establish communication to two endat2.2 encoders using the position manager CLB library. I am running into issues with setting up the SPI to issue and read commands. I am using the endat example software provided by ControlSuite. It sets the SPIB as a slave and handles the initialization routine required to transmit position data. Currently I am not seeing any of the commands being issued on the SOMI signal, any change in value of the GPIO34 signal that is dedicated to toggle the read/write of the RS-485 transceiver, nor seeing a clock being generated by GPIO7 which is configured as EPWM4. 

I tested GPIO34 by itself and am able to set it high or low. By setting the SPIB to master, I can see that it is also connected properly as I can see data pass through the SIMO and CLK which is tied to GPIO7. A potential mistake on my part is not tying GPIO27 which is SPISTEB to ground. A misunderstanding on my part believing that it was unused given that there is no CS line needed for the encoders, but since the MCU is the slave, I can understand why it would be required to enable the SPIB. Nonetheless, I have access to the SPISTEB on the GPIO23 pin and have selected that as the SPISTEB and tied it to ground, with no success. 

I have modeled every other part of the design based on a TI Motor Drive dev kit and have attached the relevant schematic drawings. Any troubleshooting advice would be appreciated. I am interested to know why the GPIO34 isn't toggled by the CLB library, my clock is hanging in a high state instead of looking like a PWM wave, and why my SOMI line remains low when I expect it to be issuing the commands necessary to establish communication.

 

  • Some reading into other questions regarding the problem leads me to believe it is an issue with initializing the SPI correctly as I won't be seeing the clock signal switching until a command is pushed through. I am unsure why my SPI is not working even though I made the change to enable the slave transmit via GPIO23 and it is grounded. All other parts of the code have remained untouched besides disabling the unused power control. I can see that SPITXBUF is updated with commands but nothing on my SOMI and CLK lines to indicate it is being pushed through. 

  • any change in value of the GPIO34 signal that is dedicated to toggle the read/write of the RS-485 transceiver

    Hi Eric -

    In the controlSUITE code this is connected to GPIO9.  Did you try moving it? Can you check if it toggles when set to GPIO9? This signal is driven by the CLB so I think part of the configuration is within the library.

    potential mistake on my part is not tying GPIO27 which is SPISTEB to ground

    Yes, this SPISTE should be tied to ground. 

    why my SOMI line remains low

    Since the SPI clock isn't being generated, the message in the SPI won't be clocked out. The issue with TXeN and SPICLK need to be resolved first. 

    The function sequence should tell the CLB to start the SPI clock and also pull TxEN high for transmit. 

    PM_endat22_setupCommand()
    PM_endat22_startOperation()
  • The software indicates that GPIO34 is used for this purpose:

    GpioCtrlRegs.GPBMUX1.bit.GPIO34 = 1; // Configure GPIO34 as EnDat TxEN

    I can check to see if GPIO9 toggles when I configure it as the TxEn but it wouldn't work as part of my design as that pin is used elsewhere.

    I do not have access to the pins in order to ground GPIO27. Is there a particular reason the SPI cannot be enabled using another pin dedicated to SPISTEB?

  • The software indicates that GPIO34 is used for this purpose:

    GpioCtrlRegs.GPBMUX1.bit.GPIO34 = 1; // Configure GPIO34 as EnDat TxEN

    hmmm my controlSUITE install shows GPIO9. I don't think I changed it, but could do a reinstall to check.

    I do not have access to the pins in order to ground GPIO27. Is there a particular reason the SPI cannot be enabled using another pin dedicated to SPISTEB?

    SPISTE is connected directly to the SPI (doesn't go through the CLB) so enabling it on a different GPIO is fine.

  • This is in the C2000 position manager reference guide, indicating GPIO34 being dedicated for TxEN. It is also the one used on the Motor Drive development board. My assumption is that even if my SPI interface isn't working, I should see that pin toggle.

    If enabling SPISTE on GPIO23 and tying it to ground is a solution, then I am at a loss as to why my SPI interface isn't generating commands. I have read other solutions to this problem and based on their answers and that reference guide, SPI is configurable to other pins. Software gives me a value of 0 for GpioDataRegs.GPADAT.bit.GPIO23 so I know I am enabling slave transmit. At least I think I know.

  • Hi Eric,

    Unfortunately the EnDat was never released for the IDDK board that I am aware of. The controlSUITE demo library is supported on TIDM-1008 which is a booster pack for a LaunchPad. (BOOSTXL-POSMGR).  https://www.ti.com/tool/TIDM-1008

    Regards,

    Lori

  • The IDDK supports EnDat, the same software that is the endat example file is found within the IDDK software and I have gotten it to work on that board. I haven't been able to return to the problem which appears to be my SPI not issuing commands as a slave even though I have it enabled. 

  • Ok if you have it working on another board then I don't see any obvious issue following the same setup and pins as that other board.