How Can I Best Verify MOSI/MISO SPI Data Traffic Using the Aardvark I2C/SPI Host Adapter?

Question from the Customer:

I am using the API functions to control the Aardvark I2C/SPI Host Adapter in SPI mode. To loop the MOSI/MISO, can I use only one Aardvark adapter or do I need two Aardvark adapters?

Response from Technical Support:

Thanks for your question! To test the traffic as you described, you will need two Aardvark adapters. One Aardvark adapter will be the SPI Master and the other will be the SPI Slave.  Here is an overview of using the API to have two Aardvark adapters talk to each other.

Using API to Have Two Host Adapters Exchange SPI Data

Following are instructions to set up the adapters for use via API commands.  The instructions are for a 64-bit Windows operating system and Visual Studio is used for running the code. The programming languages that you can use include Python, C, and C#.

Initial Setup

  1. Ensure the following are installed on your system:
  2. Connect the Aardvark adapter acting as the Master to computer USB port 1.
  3.  Connect the Aardvark adapter acting as the Slave to computer USB port 2.
  4. Ensure both adapters are visible in the Microsoft Windows Device Manager.

Setup for Running Aardvark Software API

  1. Ensure the DLL is in the same directory as the executable files.
  2. Ensure the Visual Studio output format is 64-bit.
  3. Run the Python/C/C# aadetect example that is provided in the API package. This verifies the Aardvark adapters are set up correctly; the port numbers for the connected Aardvark adapters will be displayed.
  4. Open two shells (terminals): “shell-1” for the Aardvark SPI Slave; “shell-2” for the Aardvark SPI Master.
    1. In shell-2, run the API command aaspi_slave; the Aardvark Slave will wait for a new transmission.
    2.  In shell-1, run aaspi_file to transmit a binary file with the Aardvark Master.
  5.  Verify that the Aardvark Master successfully sends data, and that Aardvark Slave receives successfully the data.

Run Two Aardvark Adapters for SPI Data Transfers

Additional resources that you may find helpful include the following:

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 sales@totalphase.com. You can also request a demo that is specific for your application.

Request a Demo