FixturCtrl is a programmable USB hub with a built-in cycle counter, commonly used to connect instruments in test systems alongside fixture switches for detecting fixture closure.
Features#
- 6 Programmable USB 2.0 Ports — Independent power and data control for automated device management
- Fixture Switch/Cycle Counter Input — Compatible with Ingun inductive switch models
- Dual I2C Expansion Ports — Qwiic-compatible for Sparkfun and Adafruit peripherals
- Digital I/O Expansion Port — Customizable interfaces like buttons and LEDs
Serial Interface#
Connect via the upstream USB-C port. The device appears as a serial port with these settings:
| Parameter | Value |
|---|---|
| Baud rate | 57600 |
| Data bits | 8 |
| Stop bits | 1 |
| Parity | None |
| Flow control | None |
Commands terminate with \r\n and return either OK\r\n or ERROR\r\n.
Command Reference#
General Commands#
| Command | Description | Response |
|---|---|---|
help | Display available commands | Command list |
who | Show firmware version and serial number | Device info |
fixture | Read fixture switch state | 0 or 1 |
cycles | Read cycle counter (registers 1-3) | Count values |
GPIO Commands#
| Command | Description |
|---|---|
gptype {pin} {mode} | Set pin mode (input/output) |
gpset {pin} {state} | Set output pin state |
gpget {pin} | Read pin state |
gpall | Read all GPIO states |
GPIO pins 21-25 are available for custom I/O.
Analog Input#
| Command | Description |
|---|---|
anget {pin} | Read analog value from pins 0-3 |
USB Port Control#
| Command | Description |
|---|---|
allusb {state} | Control all 6 ports simultaneously |
usb {port} {state} | Control individual port (1-6) |
State values: on, off, power (power only, no data), data (data only, no power)
Example Session#
> who
FixturCtrl v1.2.3
Serial: FC-0001234
OK
> fixture
1
OK
> usb 1 off
OK
> usb 1 on
OK
> cycles
1: 15234
2: 0
3: 0
OK
Cycle Counter#
The fixture switch input tracks closure events:
- Register 1 — Primary cycle count
- Registers 2-3 — Available for custom counting applications
The cycle counter persists through power cycles, enabling lifetime tracking for fixture maintenance scheduling.
Python Integration#
A Python module is available within f3ts-hardware-utils for programmatic control:
from f3ts_hardware_utils import FixturCtrl
ctrl = FixturCtrl('/dev/ttyUSB0')
# Check fixture state
if ctrl.fixture_closed():
# Run test
ctrl.usb_port(1, 'on')
# ... test code ...
ctrl.usb_port(1, 'off')
# Get cycle count
cycles = ctrl.get_cycles()
print(f"Total cycles: {cycles}")I2C Expansion#
The Qwiic-compatible I2C ports support:
- Sparkfun Qwiic sensors and displays
- Adafruit STEMMA QT devices
- Custom I2C peripherals
Multiple devices can be daisy-chained on each I2C bus.
Digital I/O Expansion#
The expansion port provides GPIO pins for:
- Operator interface buttons
- Status LEDs
- Custom sensors
- External triggers
Pin configuration is software-controlled via the gptype command.
Related Documentation#
- FixturIO — Digital and analog I/O module
- Instrumentation Overview — All supported instruments
- Fixture Switches — Switch integration options