Skip to main content

Analog Out & Trigger

These commands are available three ways — in the FREE-WILi GUI app, in a serial terminal, and on the device itself. See Connecting it to a computer for how to reach them.

Set Analog Output

Sets the voltage on an analog output channel.

Usage

s <channel> <value>

Examples

s 0 3.3 # Set analog output 0 to 3.3 V
s 0 0 # Stop any waveform on channel 0 and hold 0 V
s 2 1.0 # Set window comparator low threshold to 1.0 V
s 3 4.0 # Set window comparator high threshold to 4.0 V

How to use it — press s. At the prompt, enter: channel (0-3) and float voltage (0.0-4.84).

What you enterchannel, value.

Set Trigger Window

Configures a window comparator on the Trig IN/VREF input (pin 4 of the FreeWili 2 20-pin connector). The comparator drives an internal digital signal that can be used as a trigger source for the Logic Analyzer and Logic Player.

⚠️ Pin Sharing Warning

The Trig IN/VREF pin is shared with the CANFD special-function pins:

  • Software CAN Rx
  • CANFD Int

How to use it — press t. At the prompt, enter: Trigger voltages for V- and V+ (0-5.0).

What you entervalue_low, value_high.

Enable Trigger

Routes the window comparator output from the Trig IN/VREF pin (pin 4 of the FreeWili 2 20-pin connector) onto the CPU's internal GPIO40 trigger input.

Once enabled, the comparator signal configured by t (Set Trigger Window) becomes available to the Logic Analyzer and Logic Player as a trigger source.

Usage

e

No arguments.

Prerequisites

  1. Set the comparator thresholds first with t <valueLow> <valueHigh>.
  2. Apply the analog signal to monitor on the Trig IN/VREF pin.

⚠️ Pin Sharing Warning

GPIO40 and the Trig IN/VREF pin are shared with CANFD special-function pins (Software CAN Rx, CANFD Int). Enabling the trigger will override those features on this pin.

How to use it — press e.

Set Programmable VOut

Controls the on-board programmable output supply (VOut) on the FreeWili 2. This rail can source up to 1.5 A at a software-selected voltage between 1.0 V and 5.5 V, and is also the source used by the g (Glitch Programmable VOut) command.

Usage

u <enable> [setVoltage]

Examples

u 0 # turn VOut off
u 1 3.3 # enable VOut and set it to 3.3 V
u 1 5.0 # enable VOut and set it to 5.0 V
  • g <nanoSeconds> — Briefly glitches VOut low (for fault-injection experiments).
  • p (menu state) — Shows the current VOut enable state and the most recently programmed voltage.

⚠️ Notes

  • Make sure the load connected to VOut is rated for the selected voltage before enabling.
  • Switching VOut on or changing voltage can briefly perturb attached devices; power-cycle-sensitive targets should be designed accordingly.

How to use it — press u. At the prompt, enter: Enable (0/1) Voltage (1.0 to 5.5V).

What you enterenable, set_voltage.

Glitch Programmable VOut

Triggers a brief voltage glitch on the on-board programmable VOut rail by activating the MOSFET crowbar that pulls the rail toward ground for approximately the requested number of nanoseconds. Intended for fault-injection / voltage-glitching experiments on a target powered from VOut.

Usage

g <nanoSeconds>

Prerequisites

  1. Enable and program VOut first with u 1 <setVoltage> (1.0 – 5.5 V).
  2. Connect the target device to VOut.

Examples

g 50 # ~50 ns glitch pulse on VOut
g 250 # ~250 ns glitch pulse on VOut
g 2000 # ~2 µs glitch pulse on VOut
  • u <enable> [setVoltage] — Enable / set the programmable VOut voltage.
  • p (menu state) — Shows the current VOut enable state and programmed voltage.

⚠️ Warnings

  • Voltage glitching can reset, corrupt, or permanently damage the connected target. Only glitch devices you are willing to risk.
  • The crowbar briefly shorts VOut low — ensure the load and any series/decoupling components can tolerate the transient.
  • Avoid long or repeated pulses near the upper end of the range, especially at higher VOut voltages and currents.

How to use it — press g. At the prompt, enter: approx nanoseconds of glitch (10 to 2000).

What you enternano_seconds.

Set Waveform

Configures the DAC63204 function generator on analog output 0 or 1 and starts it. Channels 2 and 3 are the trigger-window comparator thresholds and are rejected.

Usage

w <channel> <waveform> <frequencyHz> <lowVoltage> <highVoltage> <phase>

Frequency

The hardware generates waveforms by stepping the output at one of 15 slew rates in one of 8 code-step sizes, so only a discrete set of frequencies exists. The firmware picks the closest and prints both the requested and the actual value.

  • Sine: 8.13 Hz to 10.42 kHz, 15 evenly-spread steps. Sine plays a fixed 24-point table, so lowVoltage and highVoltage do not set its amplitude - they select the nearest output gain (1.5x, 2x, 3x or 4x of the 1.21 V internal reference).
  • Triangle: roughly 0.024 Hz to 977 Hz at full amplitude, up to about 62 kHz on a narrow span.
  • Sawtooth / inverse sawtooth: twice the triangle rate for the same settings.

A precise high frequency costs amplitude: near the top of the range the slew rate is already at its 4 us minimum and only the code step can move, in 2x jumps.

Notes

  • Writing a DC voltage to the channel with s stops the waveform (last writer wins).
  • phase is documented by the datasheet for the sine wave only; for the ramp shapes the value is written to the register but its effect is unspecified.
  • There is no square wave - the hardware does not generate one.
  • x <mask> - start or stop both channels in one write, edge-aligned.
  • s <channel> <value> - set a static DC voltage (stops any waveform).
  • p - shows the current waveform state for both channels.

How to use it — press w. At the prompt, enter: channel (0-1) shape (0=off 1=tri 2=saw 3=invsaw 4=sine) freq (Hz) low (V) high (V) phase (0-3).

What you enterchannel, waveform, frequency_hz, low_voltage, high_voltage, phase.

Waveform Run/Stop

Sets the run state of the DAC63204 function generator on analog outputs 0 and 1 with one COMMON-DAC-TRIG register write, so channels started together start on the same edge.

Usage

x <mask>

Prerequisites

Configure each channel first with w <channel> <waveform> <frequencyHz> <lowVoltage> <highVoltage> <phase>. w also starts the channel it configures; use x when you need the two channels to start together.

How to use it — press x. At the prompt, enter: run mask (bit0 = ch0, bit1 = ch1; 0 stops both, 3 runs both).

What you entermask.

See also: Analog IO panel — the on-screen panel for this.