Total Phase offers free APIs compatible with 32-bit ARM-based platforms that allow users to run our host adapters and protocol analyzers on popular ARM-based platforms including Raspberry Pi. With Raspberry Pi being an easy-to-use and accessible computer often used for learning and development, we wanted to show how to set up and use the Raspberry Pi to interface with our tools.
To get started, you will need a Raspberry Pi and a Total Phase host adapter or protocol analyzer. In this example, we will be using the Aardvark I2C/SPI Host Adapter and an I2C/SPI Activity Board from Total Phase. The Aardvark I2C/SPI Host Adapter is a general-purpose host adapter that can emulate I2C or SPI master and slave devices. It supports I2C master and slave speeds up to 800 kHz, and SPI master speeds up to 8 MHz and SPI slave speeds up to 4 MHZ. The I2C/SPI Activity Board provides known-good slave devices used for debugging and testing purposes.
First, we will power on our Raspberry Pi system and connect it to our network via an Ethernet cable. Once connected to the power and Ethernet, we will plug our Aardvark adapter into the Raspberry Pi system via a USB cable. Then we will connect the Aardvark adapter to the activity board via the 10-Pin header cable. This set up can be seen in the image below.
Once everything is connected, we will open a terminal window and connect to the Raspberry Pi via SSH.
With the terminal open, we will change the directory to the Aardvark I2C/SPI Host Adapter.
From the Aardvark adapter directory, we will run a Python “Lights” example program that will instruct the Aardvark adapter to control the lights on the I2C/SPI Activity Board by inputting the following two commands in the terminal:
1) Python3 ./aalights.py usage: aalights PORT
2) Python3 ./aalights.py 0 Bitrate set to 100 kHz
Once executed, we can see that the lights on the board blink in succession.
Although a simple example, users can do more complex commands if they would like. Users can also easily program I2C EEPROMs and SPI Flash chips with this setup as well.
In addition to the Aardvark I2C/SPI Host Adapter, other Total Phase products offer API packages to support Linux on ARM. For instance, users can operate a Cheetah SPI Host Adapter for higher performance SPI programming, or even use the Beagle USB Protocol Analyzers or Beagle I2C/SPI Protocol Analyzer to capture USB, I2C, or SPI data.
Find the API packages that include Linux on ARM support here:
As you can see, using a Raspberry Pi system to interface with Total Phase tools is simple and easy to do. To see this example in video form, please see our video: Interfacing with the Aardvark I2C/SPI Host Adapter Using a Raspberry Pi ARM System.