Skip to content

ADC input range (analog module v3r4): SDK + MCP 2.13.4 - #50

Merged
wardviaene merged 1 commit into
mainfrom
adc-low-range
Oct 29, 2026
Merged

wardviaene merged 1 commit into
mainfrom
adc-low-range

Conversation

@wardviaene

Copy link
Copy Markdown
Member

SDK and MCP support for the ÷2 ADC low range on analog module v3r4. The firmware side is embeddedci-com/benchpod-firmware#72 (firmware 3.9.5).

SDK (embeddedci 2.13.4)

  • BenchPod.adc_range(range=None) reads or switches the range: normal is ±32.8 V, low is ±5.46 V at about 6x the resolution.
  • adc_range_test() runs the self-test through the cal1 loopback.
  • analog_path, adc_read and capture_adc take range=. calibrate_adc_gain("cal1", range="low") measures the low range's gain.
  • Captures scale with the fit of the range in use. The SDK takes the fit from the adc_range reply, and re-reads it when a reply says the pod changed range (off and cal2 put it back to normal).
  • New fields:
    • AdcReading: range, fullscale, overrange
    • Capture: range, overrange, clipped_samples
    • AnalogPathState.range, Calibration.adc_low_gain_ppm
    • Capabilities: adc_low_range, adc_range, adc_range_fullscale
  • New types: AdcRange, AdcRangeState, AdcRangeTest, AdcRangeTestPoint.
  • capture_adc(source="current_in") now reads the pod's fit after routing, so the fit matches the range in use. Two existing tests pinned the old command order and were updated.
  • Every change is additive; the API snapshot was refreshed.

MCP (embeddedci-mcp 2.13.4)

  • New adc_range tool: read, switch, or test=true.
  • range on analog_path, adc_read, capture_adc and calibrate_adc_gain.
  • Results report the range, the full scale, overrange and clipped samples.
  • The README rows and the tool snapshot are updated.

Tests

  • New tests/test_adc_range.py runs against a fake pod that tracks the range the way the firmware does.
  • The MCP tool test covers the new tool and arguments.
  • A hardware e2e test, test_adc_low_range_reads_the_cal1_loopback, skips on boards without the low range.
  • Locally: make test for all four suites is green.

Needs a v3r4 board: the e2e test above, and checking that captures in the low range scale right over LAN and cloud.

🤖 Generated with Claude Code

SDK: BenchPod.adc_range(range=None) reads or switches the ADC input range
(normal ±32.8 V, low ±5.46 V), adc_range_test() self-tests it, and
analog_path / adc_read / capture_adc take range=. calibrate_adc_gain("cal1",
range="low") measures the low range's gain. Captures scale with the fit of
the range in use: the SDK takes it from the adc_range reply and re-reads it
whenever a reply says the pod changed range (off and cal2 put it back to
normal). AdcReading gains range/fullscale/overrange, Capture range/overrange/
clipped_samples, Calibration adc_low_gain_ppm, Capabilities adc_low_range/
adc_range/adc_range_fullscale. capture_adc(source="current_in") reads the
pod's fit after routing, so it is the fit of the range in use.

MCP: new adc_range tool (read, switch, test=true); range on analog_path,
adc_read, capture_adc and calibrate_adc_gain; results report the range,
full scale, overrange and clipped samples.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wardviaene
wardviaene merged commit d30f2dd into main Oct 29, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant