Skip to main content

USB Port Power Management

The AT1000 provides control over its two USB 3.0 ports, allowing engineers to power cycle devices under test (DUTs) and measure current and voltage consumption.

USB communication

This API controls USB power. For direct communication with USB devices, use their normal libraries inside a standalone project. Access to a USB device from a project requires a standalone project created on firmware 0.7.0 or newer.

USB Power Control​

Each USB port can be individually powered up or down. This allows for controlled testing of USB-powered devices.

await tester.power.usb(1).enable(); // Power up the USB power supply channel 1
await tester.power.usb(1).disable(); // Power down the USB power supply channel 1

Power Cycling a USB Device​

disable() cuts the port's power but does not discharge it. The port voltage decays at a rate set by the connected device: with no device connected, a port still reads about 2.6 V 15 s after disable() and takes about 130 s to fall below 0.5 V (typical measurement). A device that is re-powered before its supply has fallen far enough may not reset. To power cycle a device, wait until read_voltage() falls below the level at which your device resets before enabling the port again.

const usb = tester.power.usb(1);
await usb.disable();
// Wait for the port voltage to decay below 1 V
while ((await usb.read_voltage()) > 1.0) {
await new Promise((resolve) => setTimeout(resolve, 100));
}
await usb.enable();

Reading USB Voltage and Current​

The AT1000 allows real-time measurement of voltage and current supplied to a USB-powered device.

// Read voltage on USB port 1
let usb_voltage = await tester.power.usb(1).read_voltage();
console.log("USB Power Voltage:", usb_voltage, "V");

let usb_current = await tester.power.usb(1).read_current();
console.log("USB Power Current:", usb_current, "A");