How Do I Flash Multiple SPI Target Devices with One Master Host Adapter?

Ideas that Connect by Geralt

Artwork by Geralt

Question from the Customer:

We recently purchased a Cheetah SPI Host Adapter to flash multiple Macronix MX25R3235F devices through . Using the Flash Center Software, I am able to flash a single slave, but I need to flash all three target devices. I am using the same configuration as shown in the Cheetah SPI Host Adapter User Manual.

Single SPI bus with 3 slaves


My question – how can I flash three target devices using one master device?  Or do I need to use a different software to flash three slaves with the one master host adapter?

Response from Technical Support:

Thanks for your question!  With the Flash Center Software, programming with the same data is possible only by using multiple master host adapters – one host adapter for each target device. We do have an alternate solution for you: Cheetah Software API.

Using API for Multiple SPI Targets

Here is an example of an SPI transaction:

  1. Call ch_spi_queue_clear to clear the command queue.
  2. Call ch_spi_queue_oe to add a command to the queue to enable the Cheetah device’s outputs on the SPI bus.
  3. Call ch_spi_queue_ss to add a command to the queue to enable the slave select signal.
  4. Call ch_spi_queue_byte and ch_spi_queue_array to queue data sent across the SPI bus.
  5. Call ch_spi_queue_ss to queue a command to disable the slave select signal.
    • Note: If you prefer to disable the outputs of the Cheetah SPI Host Adapter, you can instead call ch_spi_queue_oe for the command queue.
  6. Call ch_spi_batch_shift to send the queued commands across the SPI bus.

Here is an overview of how the commands work:

ch_spi_queue_oe  enables and disables the output signals on the Cheetah device.

ch_spi_queue_ss  adds a command to the queue to enable the slave select signal. However, to execute the command queue, it needs to be batched. Commands are accumulated in a queue until a call is made to batch shift all of the queued commands.  Also, to make sure only the commands you need are executed, the command queue should clear before running the desired commands.

ch_spi_batch_shift sends the accumulated commands, including the commands to enable and disable the slave selected, across the SPI bus. After the commands are sent, you can see the SPI signals (SS, MISO, MOSI, SCLK) toggle according to the accumulated commands.

Note:  The command queue is not cleared after it has been executed, which allows the same queue to be repeatedly executed without re-queuing the commands. To clear a queue, call  ch_spi_queue_clear.

For more information about using API functions, please refer to section 5 API Documentation of the Cheetah SPI Host Adapter User Manual.

Greater Productivity from One SPI Host

The Cheetah adapter can support up to three target devices. If you need greater capacity, consider the   Promira Serial Platform combined with the SPI Active - Level 3 Application, which supports up to eight target devices. Using the Level 3 Application requires the installation of both Level 1 and Level 2 of the SPI Active Application. See the chart below to compare our SPI and I2C devices.

Comparison of Promira, Aardvark, Cheetah and Beagle

We hope this answers your questions. Additional resources that you may find helpful include the following:

If you want more information, feel free to contact us with your questions, or request a demo that applies to your application.