Skip to content

Main content

Microcontroller: ADC Differential Midcode Offset Tool

Crosswalk an explicitly offset-binary differential ADC code to its signed midcode-relative integer; no voltage calibration or device encoding inference.

Loading tool…

Description

Subtract 2^(bits - 1) from offsetBinaryCode for signedCode, with code bounded by the selected 1-24-bit width.

Ideal ADC and DAC models connect digital codes to a reference span and quantization step. Coding, endpoint conventions, and reference behavior determine the meaning of a code-domain term.

Subtract 2^(bits - 1) from offsetBinaryCode for signedCode, with code bounded by the selected 1-24-bit width.

When to use this tool

Use Microcontroller: ADC Differential Midcode Offset when you need one explicit converter coding, resolution, or analog-model term.

How to use the tool and how it works

  1. Enter offsetBinaryCode, bits. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read result. Expand result to inspect the returned fields.

Subtract 2^(bits - 1) from offsetBinaryCode for signedCode, with code bounded by the selected 1-24-bit width.1

Input fieldMeaning and unitsAccepted input
offsetBinaryCodeOffset Binary CodeRequired. Safe integer.
bitsBitsRequired. Safe integer.
Output fieldInterpretationReturned shape
resultResultRequired. Object.
result.signedCodeSigned CodeCalculated result member: number.
json
{
  "input": {
    "offsetBinaryCode": 128,
    "bits": 8
  },
  "output": {
    "result": {
      "signedCode": 0
    }
  }
}

Limitations and assumptions

  • This is a coding crosswalk only, not an analog voltage calibration or two's-complement bit-string formatter.
  • Outputs are nested inside result. Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Compare the ideal term with device transfer curves, noise, calibration, and acquisition requirements.

References

  1. Calculation and input contract: microcontroller/adc-differential-midcode-offset — tool.io

Similar or alternative tools