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.

LAUNCHXL-F28379D: How can we communicate with more than three SPI devices in TMS320F28379D by using the standard SPI libraries

Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: TMS320F28379D, SYSCONFIG

Tool/software:

Hi,

We have a requirement to use 7 SPI devices in TMS320F28379D, although we have many SPI pins available, however, we only have three channels of SPI (SPIA, SPIB, & SPIC) available which are pin muxed to the available SPI pins on the controller.

On sysconfig, I have defined all the three channels available, however, I need 4 more SPI channels, which needs to work with at least 1MHz speed.

Is it possible to use standard libraries available to use 7 SPI channels all together?

  • Hi,

    Any update?

    Is it possible to use other GPIOs to generate clock on other GPIO pins which are not configured as SPIA, B or C, so that we can use them for SPI communication?

  • Hi Gautham,

    Apologies for the delay. The F28379D has a total of 3 SPI instances. There are also 2 MCBSP instances, which is a separate serial communication peripheral that can be used in SPI mode (please refer to the TRM for more information, this may not support all use cases). The list of available SPI pins is large due to the MUXing of pins and is not directly indicative of how many SPIs can be configured.

    Regarding your 2nd question, it is possible to have the chip select ie PTE controlled by a GPIO instead of hardware. By doing this, you can connect 1 controller/master SPI to 'n' peripheral SPIs (without needing 'n' masters). Is this similar to what you're trying to implement? Or do you strictly need more (& complete) SPI instances? 

    Thanks,

    Arnav

  • Hi Arnav,

    Thank you for clarification w.r.t MCBSP.

    We have made a custom board with TMS320F28379D, wherein, we are communicating with a device which works on SPI, however, we are only required to use SCLK and MISO. we have 2 devices which are connected as below:

    Device 1:

    GPIO 14 - SCLK; GPIO 15 - MISO

    Device 2:
    GPIO 38 - SCLK; GPIO 39 - MISO

    Since, these Pins are not related to SPIA, B or C, we tried toggling the pins to generate clock and get the data from the device, however, the minimum pulse which we could get by toggling GPIO 14 and GPIO 38 is 1.3 microsecond. 

    How can we reduce this further? TRM says, GPIOs can be toggled with 25MHz frequency.

  • Hi,

    Any update on this?

  • Hi Gautham,

    The toggle frequency you're seeing is likely due to the optimization level used. Can you check the same with a higher compiler optimization level applied?

    Regarding your setup, since you need MISO, you plan to use both F28379Ds as slaves, correct? In that case, why are you required to also generate clock pulse from these devices? If you could clarify how you intend to emulate the SPI, would be helpful. 

    Thanks,

    Arnav

  • Hi ,

    The optimization level was off, we switched it on and tried different settings and we were able to achieve GPIO toggle frequency upto 300ns., which will suffice. However, we have some follow up questions based on some observation after applying optimization. Some background on our project:

    We are using TMS320F28379D to control a BLDC motor, we have an encoder and the output of encoder is in SPI format, however, only 2 SPI lines are used for the communication, CLK and MISO. We have verified the output of the encoder both using standard SPI libraries and also using GPIO pins and it is working correctly.

    Observation:

    On selecting different options in optimization level, we observed that the GPIO toggles at approximately 4 times the frequency when optimization was off, however, encoder output changed, instead of 0 to 360 degrees (which we get when optimization is OFF), we get 0 to 180 range only and in some other optimization options, we were getting 0 to 90 degrees only, finally we managed to find out that selecting Register optimization level and that too range set to 0 (between 1 to 5), we were getting correct output.

    How does changing different optimization have an effect on how the code is being read from encoder?


     

  • Hi,

    can you help us on this?