Support Question of the Week: How Do I Configure the Aardvark I2C/SPI Host Adapter for a Loopback Mode to Echo Data?
I’m looking to set up a loopback so that data sent from an Aardvark™ I2C/ SPI Host Adapter is echoed. How can I do that?
Thanks for your question! To echo data, you can set up a loopback mode by using two Aardvark I2C/SPI Host Adapters and two instances of the Control Center™ Software to send traffic between the two Aardvark host adapters. One adapter will be configured as the master, and the other adapter will be configured as a slave. The slave unit can then be programmed with the message to “echo” when pinged by the master unit.
- Figure 1: Configuring Aardvark Host Adapters to Echo Data
Following are instructions to set up and verify a loopback mode in SPI (the instructions are similar for the I2C protocols):
- Connect the Master I2C/SPI connector of one Aardvark adapter to the Slave I2C/SPI connector of the other Aardvark adapter.
- Connect the Aardvark–Master USB port to USB port 1 of the computer.
- Connect the Aardvark–Slave USB port to USB port 2 of the computer.
- Launch the Control Center Software for the Aardvark-Master on the computer. To do so:
- Click Configure Aardvark Adapter → Select Aardvark-Master -> Click OK.
- Click Aardvark → Enabled Target Power.
- Use the SPI Control section.
- Click Master.
- Choose the following parameters: Polarity: Raising/Falling; Phase: Sample/Setup; Bit Order: MSB; SS Polarity: SS Active Low; Bit Rate: 1000KHz.
- Type 0A 0B 0C 0D in the MOSI message.
- Launch the Control Center Software for the Aardvark-Slave on the computer. To do so:
- Click Configure Aardvark Adapter → Select Aardvark-Slave -> Click OK.
- Use the SPI Control section.
- Click Slave.
- Choose the following parameters: Polarity: Raising/Falling; Phase: Sample/Setup; Bit Order: MSB; SS Polarity:SS Active Low; Bit Rate: 1000KHz.
- Type 01 02 03 04 in the MISO message → Click Set MISO → Click Enable.
- In the Control Center Software for the Master, click Send and then verify the following:
- The transaction log in the (Master) Control Center Software shows that the Aardvark – Master sent 4 bytes of 0A 0B 0C 0D, and received 4 bytes of 01 02 03 04.
- The transaction log in the (Slave) Control Center Software shows that the Aardvark-Slave received 4 bytes of 0A 0B 0C 0D, and sent 4 bytes of 01 02 03 04.
For additional information, please refer to the following documents:
Aardvark I2C/SPI Host Adapter Quick Start Guide
Aardvark Adapter User Manual
Control Center Software User Manual
Total Phase Products
Product Selector Guide