How Can I Best Communicate with Multiple SPI Slaves?

Question from the Customer:

I have two Promira Serial Platforms; each has the SPI Active - Level 2 Application. How can I best communicate to multiple SPI slaves using separate SPI slave select (SS) signals?

Response from Technical Support:

Thanks for your question! There are two ways you can communicate through the SS signals: Control Center Serial Software and Promira Software API. Following are summaries of what each application can do for you.

Communicate via Control Center Serial Software

The Control Center Serial Software in an easy-to-use GUI application that provides access to Promira platform functions. Here is a summary:

  1. Connect the Promira Serial Platform to the Control Center Software.
  2. At the top menu bar, select Adapter and then click Multi I/O SPI.
  3. In the Multi I/O SPI window, select the SSn for the desired slave. The number of displayed Slave Select lines is dependent on how many slaves the attached device can support. You can also select the desired Bitrate.
  4. Set the command and address values.
  5. There is large text box that for inserting the data you want to send.
  6. Transactions are displayed below in the Transaction Log.

For more information, please refer to the article Which Tool Should I Use to Have One SPI Master Control Multiple Chips on an SPI Bus?

For a more automated process, you can use commands via an XML script in Batch Mode. For more information, please refer to the Batch Mode section in the Control Center Serial Software User Manual.

Communicate via Promira Software API

If you need more customized control, we recommend using Promira Software API. Using the API, you can create a new script or modify one of our sample scripts, which you can then run from the command line.

For communicating with multiple SPI slaves via separate SPI SS signals, we recommend taking a look at the API examples: spi_file and spi_slave. Both use the Promira platform for SPI slave implementation. Here is a key component of both examples:

To configure the SS lines, use a bitmask: 1 corresponds to enable; 0 corresponds to disable. The command to use is ps_spi_enable_ss.

Enable SS Lines (ps_spi_enable_ss)

int ps_spi_enable_ss (PromiraChannelHandle channel,
u08 ss_enable);Enable select SS lines and disable GPIO lines.

Arguments:

channel         handle of the channel
ss_enable     bitmask based on the 8 SS lines where 1 corresponds to enable and 0 to disable.

Return Value:

A status code is returned with PS_APP_OK on success.

Details

ss_enable is to enable which pins are configured to ss line instead of GPIO. The least significant bit is SS0.

For more information, please refer to the API Documentation section from the Promira User Manual.

Additional resources that you may find helpful include the following:

We hope this answers your question. Looking for more information? You can contact us and request a demo that applies to your application, as well as ask about our Total Phase products.

Request a Demo