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.

C674x PSP SPI Driver

Other Parts Discussed in Thread: OMAPL138

I am trying to understand the "multi-instance" aspect of the PSP SPI driver.

On the board I am working with, there are several devices connected to the SPI1 bus. I have been able to test all these individually, and each of the devices is working. However, when I have a project with multiple UDEV using the same deviceId, the code immediately seems to halt and not start up normally.

This seems to imply that multi-instance seems to mean I can instantiate a UDEV for SPI0 and SPI1, but only one for each?

The other issue is SPI devices can have different Spi_Params requirements. Some can be clocked faster, some slower. I have one device with a different polarity from the other on the same SPI bus. Using PSP, how can I make this work? It seems so far like I can have more than one UDEV for the same SPI port.

  • It appears that on C6747, I can have an instance of SPI0 and another of SPI1. In this case, is it possible to have multiple Spi_Params, one for each device? I haven't seen any example on how the Spi_Params ties to a specific device outside of the initial instantiation.
  • Hi,

    Thanks for your post.

    Usually, the SPI driver can operate on all the instances on the c6748/OMAPL138 EVM. Different instances with corresponding device ID's 0 through 2 are supported and these instances can operate simultaneously with configurations supported by the SPI

    driver. You can refer all details in the bios psp user guide in the docs folder of your PSP installation directory.

    It all depends on how you explore the SPI PSP features like CSHOLD, delay, ouput clock frequecy etc in the spi_params structure and if you need to help configure the SPI PSP drivers to interface with a slave device. You could refer the below E2E post:

    http://e2e.ti.com/support/dsp/omap_applications_processors/f/42/t/33841

    There is a wiki article that explains the SPI features like CSHOLD and delays a bit more...

    http://wiki.davincidsp.com/index.php/Using_SPI_Chip_Select_Pin_on_C674x/OMAP-L1x

    Usually, the SPI clock will run at SYSCLK2 / prescale value.  It seems like the PSP code will choose  a prescale value that will produce a clock frequency nearest to that set by this field. The clock can be different for each of the data formats so it makes more sense to have this as a field in the Spi_ConfigDataFmt so a different clock can be preassigned for each data format that will be used.

    Please refer the above E2E post for more details on SPI_Params configuration settings.

    For more information on configuring UDEV and SPI, please refer to the Spi sample

    application (included with the driver release), and the DSP/BIOS API Reference

    (spru403o.pdf, included in your DSP/BIOS installation).

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question

    -------------------------------------------------------------------------------------------------------