From b3e46fac2f8b9c285c3ecb261a5d67edf68db32e Mon Sep 17 00:00:00 2001 From: Michael B Reiser Date: Mon, 7 Sep 2026 17:15:49 -0400 Subject: [PATCH 1/3] =?UTF-8?q?feat(console):=20analog-input=20calibration?= =?UTF-8?q?=20UI=20in=20the=20Analog=20In=20panel=20(two-point,=20deadband?= =?UTF-8?q?,=20clear,=20read)=20+=20wire=200xA5/0xA6/0xA7=20+=20ai=5Fcal?= =?UTF-8?q?=20capability=20(S2)=20=E2=80=94=20Studio=20v0.75?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Studio half S2 of docs/development/analog-input-plan.md § 4. Stacked on S1 (feat/console-analog-in). Pairs with firmware F2 (feat/ai-calibration). - js/arena-wire-g6.js: OPCODES SET_ANALOG_CAL 0xA5 / GET_ANALOG_CAL 0xA6 / GET_ANALOG_IN_RAW 0xA7; ANALOG_CAL_ACTIONS {sampleGround 0, sampleOpen 1, setDeadband 2, clear 0xFF}; encodeSetAnalogCal(ch, action, mv) with range checks, encodeGetAnalogCal, encodeGetAnalogInRaw; decodeAnalogCal (18-byte record -> {version, adcBits, source, sdMirrorOk, channels[{valid, rawOpen, rawGnd, deadbandMv, gainMvPerCount, offsetMv}]}), decodeAnalogInRaw; CAPABILITY_BITS bit 6 'ai_cal'. Tests 186 -> 204. - js/studio-analog-in.js: nominalMv, calLine, calMv, calStepsText, describeCalSource, calTableRows. - arena_studio.html: "calibrate" row in the Analog In panel — channel select, Read (0xA6 + 0xA7 -> table with both points, mV/count, offset, deadband, live raw on the calibrated and nominal scales), "1 · Sample +10 V (open)", "2 · Sample 0 V (ground cap)", deadband Set, Clear (confirm). Writes are advanced-only (SAFE_BLOCKED_CMDS) and gated on the ai_cal capability; every write is logged to the Console and to the bridge run log (event analog_cal), and refreshes the 0xA4 flags text. Warns when the +10 V point reads low (BNC not open / un-reworked board). HELP text updated; footer v0.75. - tests/test-studio-analog-in.js 105 -> 148: calibration math + wiring incl. the safe-mode set (writes blocked, read allowed) and the ai_cal gate. - Release notes v0.75. Not bench-tested (no hardware). Browser check offline: panel renders, handlers wired; the real two-point flow needs a board with ai_cal firmware. Co-Authored-By: Claude Fable 5.1 --- arena_studio.html | 85 +++++++++++++- .../development/arena-studio-release-notes.md | 11 ++ js/arena-wire-g6.js | 107 +++++++++++++++++- js/studio-analog-in.js | 87 +++++++++++++- tests/test-arena-wire-g6.js | 71 ++++++++++++ tests/test-studio-analog-in.js | 84 ++++++++++++++ 6 files changed, 439 insertions(+), 6 deletions(-) diff --git a/arena_studio.html b/arena_studio.html index fba4fcd6..4b3b8c93 100644 --- a/arena_studio.html +++ b/arena_studio.html @@ -2830,6 +2830,16 @@

Import error

+
calibrate + + + + + + + +
+
±10 V front end · nominal scale, per-board calibration not yet applied · a board without the LAB-209 resistor rework reads ≈ +10 V for any input above 0 V · needs io_ext firmware
@@ -2953,7 +2963,7 @@

Import error