Support Question of the Week: How Do You Transfer SPI Data Using the Aardvark I2C/SPI Host Adapter and LabVIEW?
Today's article is based on a new Knowledge Base article, Sending SPI Messages Between Two Aardvark adapters Using Aardvark LabVIEW.
The AardvarkTM I2C/SPI Host Adapter is often used with LabVIEW to transfer SPI data. The Aardvark LabVIEW Driver supports the Windows operating system and includes examples. You can use the Aardvark LabVIEW Driver to control the Aardvark adapter, as well as write a custom program for specific requirements. For information about API Software, which is also used to write custom software, please refer to section 5 of the Aardvark Adapter Use Manual. Following are instructions to install the Aardvark LabVIEW driver and then run two examples that use Aardvark LabVIEW drivers (connect and spi):
- connect example - Indicates if the I2C/SPI/GPIO functions are available, and displays the port number, Aardvark handle, Serial Number, Hardware version, and Firmware version for the connected Aardvark adapters.
- spi example - Reads and writes SPI data between two Aardvark adapters. In this example, one Aardvark adapter is the SPI master and the other Aardvark adapter is the SPI slave.
Aardvark LabVIEW Driver Installation Guidelines:
- Download and run the latest version of the Total Phase USB Drivers Installer.
- Download and install the latest version of Aardvark LabVIEW Driver following the README file in the driver package.
- Be sure to place the aardvark.dll into a directory that is listed in the system search path. The Windows system32 directory (on 32-bit Windows) is a good location for the aardvark.dll.
- Connect the two Aardvark adapters to the computer via the USB connector.
- Connect the two Aardvark adapters to each other via the I2C/SPI connector.
- Install 32-bit LabVIEW for Windows from the LabVIEW website.
- Be sure to use 32-bit LabVIEW; currently, the Aardvark LabVIEW Driver is only provided in a 32-bit package.
- Launch Aardvark LabVIEW Driver by clicking on the icon …/aardvark-labview-v5.03/aardvark/aardvark.llb.
- Run the original connect Aardvark LabVIEW Driver example as provided in the Aardvark LabVIEW Driver package. To do so:
- Go to the Aardvark Example Connect.vi window.
- Click Operate → Run.
- Verify that the computer detects the first Aardvark adapter, and that the Aardvark parameters are correct including: Aardvark Handle, Aardvark Port; Aardvark Serial Number String, Hardware Version String, and Firmware Version String. Refer to Figure 1 below.
Figure 1: Setting up Drivers for the Aardvark Host Adapter
Instructions to send SPI data between two Aardvark adapters with the Aardvark LabVIEW Driver SPI.
- Go to the Aardvark LabVIEW Driver Example SPI.vi window.
- Click Operate → Run.
- Verify that the Aardvark parameters are correct including: Aardvark Handle 1, Aardvark Handle 2, Message received by master, and Message received by slave. Refer to Figure 2 below.
Figure 2: Sending SPI Data between Aardvark Host Adapters