Last updated on: July 1, 2022, 1:21 a.m.
The FixturFab DEV260 Development Fixture is a simple, low-cost test fixture that is great for debugging or configuring PCBA’s during development. In this series, we will cover how to create a DEV260 fixture for configuring and testing a SparkFun Power Delivery Board. These same techniques can be used to create a fixture for programming, debugging, or configuring your custom PCBA during EVT and DVT.
DEV260 Fixtures Series
The third part of the DEV260 Fixture Series covers how to connect a Binho Nova and develop a Python test script using pytest to configure the SparkFun Power Delivery Board.
To follow along with this tutorial you will need:
- The SparkFun USB-C PD Test Demo repository code
- An assembled DEV260 Test Fixture
- A Binho Host Adapter
- A small breadboard
- Female to Male Jumper Wires
The SparkFun Power Delivery Board uses a USB-C connector to provide an output voltage of 5-20V and up to 100W of power. The board uses a standalone controller to negotiate with a power adapter and have it switch to a voltage higher than 5V. To supply power other than 5V, the STUSB4500 must be configured over I2C.
Our tests will stick to configuring the Power Delivery Board and verify that it was properly set.
We will need a device that can use I2C and take basic measurements. The Binho Nova is a multi-protocol USB host adapter that we like to use. It has support for I2C, SPI, UART, 1-WIRE, SWI protocols all in one compact package; making it a fantastic option for test instrumentation for the development of various types of boards. You can find additional detail on their product overview page.
Wiring the DEV260 Fixture
After receiving the fixture, the Binho Nova will need to be connected to the test probes before a SparkFun Power Delivery Board can be configured.
We’ll use Female to Male Jumper Wires and a breadboard to connect the P75-1W test receptacles to the test instrumentation. Attach the Binho Nova and breadboard to the bottom plate of the fixture using double-sided tape. Then use jumper wires to connect the 3V3, GND, SCL, and SDA test probes to the Binho Nova.
The bottom plate can then be placed back on the fixture.
Configuring the SparkFun Power Delivery Board
The fixture is now complete, however, without any software to control the Binho Nova, the fixture is functionally useless. To run test scripts on the fixture, we recommend using Python and pytest. Binho has a great tutorial on how to use pytest, and this approach can be extended to work with any test fixture and instrumentation that you are using.
An example project is available to follow along with for this series. To run this project, you will need to have Python 3.6+ and pip installed. Clone the repository and install the requirements.
$ git clone https://gitlab.com/fixturfab-example-projects/sparkfun-usbc-pd-test-demo.git $ cd sparkfun-usbc-pd-test-demo $ pip install -r requirements.txt
The Test Software
We will keep this article to a high-level overview of the provided test software because there are detailed comments and docstrings for the specific implementation details.
STUSB4500 Driver Class
The code can be found here. This class provides methods for configuring, controlling, and measuring the DUT. Our test class will use it to execute test cases.
The code can be found here. The class configures the DUT for testing and contains our test cases. If you are familiar with unit testing in python, this is essentially the same thing, but for the DUT in a fixture!
To run the tests, place a SparkFun Power Delivery Board in the fixture.
Run the tests using pytest.
$ pytest -x
The tests should then run which configure the SparkFun Power Delivery Board and display the following after a successful execution.
We now have a functioning development test fixture. You can use a similar process and begin writing your own tests. In a future post, we plan to add to these test cases by measuring voltage, current, and other features such as the LED functionality.