Support Question of the Week: How do I Control the SPI Slave Responses from an Aardvark I2C/SPI Host Adapter that is in SPI Slave Mode?

I am using the Aardvark I2C/SPI Host Adapter in the SPI Slave mode. How can I specify multiple responses for the Aardvark to return, such that each packet returns a different response?

To provide some background, the delay between bytes in my application is short enough that the Aardvark adapter can only echo what is reads from MOSI after the first byte. MOSI is not connected to the SPI master, so I have tied the MOSI and MISO signals together with a 1K resistor. I have no control over the timing of SCLK or the timing between packets. The timing is too fast for a typical computer to change the response in real-time.

Thanks for the question! The Aardvark adapter, along with the Control Center Software can store one response to any packet, as a slave.  The response cannot be changed on the fly, so to change the data that the Aardvark adapter slave sends, the Aardvark adapter's set response must be set to a different value each time. For example, for the Aardvark adapter to send AA in the first read, BB in the second read, and CC in the third read:

  1. Set the first slave response with AA and then execute the first master read.
  2. Set the second slave response with BB and then execute the second master read.
  3. Set the third slave response with CC and then execute the third master read.

The following is an example of how that can be done. Please note this example uses an Aardvark I2C/SPI Host Adapter, the Control Center Software and the Total Phase SPI Flash Demo Board. If necessary, the SPI Flash Demo Board can be substituted with an off-the-shelf SPI slave device.

Control Center Software can be used to control the response of an Aardvark I2C/SPI Host Adapter in SPI Slave mode Figure 1: Control Center Software - SPI Slave Mode
  1. Ensure the most current USB drivers and version of the Control Center Software are installed.
  2. Verify the setup by writing and reading to the SPI flash device (M25P32) that is on the SPI Flash Demo Board. For these instructions, please refer to the knowledge base article Writing and Reading from SPI Flash Using Aardvark Adapter and Control Center.
  3. In the following example, commands are sent to the slave device to set its response. For details about using the Control Center Software, please refer to the Control Center Software User Manual.
    1. Send A B C D from the SPI master device.
    2. Set the Aardvark SPI slave Response to 1 2 3 4.
    3. Receive from the SPI master device. Verify the SPI slave device sends 1 2 3 4 to the SPI master device.
    4. Send  E F G H from the SPI master device; the SPI master device then sends E F G H to SPI slave device.
    5. Set the Aardvark SPI slave Response to 5 6 7 8.
    6. Receive from the SPI master device. Verify the SPI slave device sends 5 6 7 8 to the SPI master device.

For additional information, please refer to the following documents:

We hope this answers your question. If you have other questions about our host adapters or other Total Phase products, feel free to email us at or submit a request for technical support. 

Leave a Reply