Description
Use referenceVoltage / 2^bits for unipolar bin width or twice that value for twos-complement-bipolar.
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.
Use referenceVoltage / 2^bits for unipolar bin width or twice that value for twos-complement-bipolar.
When to use this tool
Use Microcontroller: ADC Code Bin Midpoint when you need one explicit converter coding, resolution, or analog-model term.
How to use the tool and how it works
- Enter code, bits, referenceVoltage, coding. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read result. Expand result to inspect the returned fields.
Use referenceVoltage / 2^bits for unipolar bin width or twice that value for twos-complement-bipolar. Return (code + 0.5) × bin width as midpointVoltage for either coding.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| code | Code | Required. Safe integer. |
| bits | Bits | Required. Safe integer. |
| referenceVoltage | Positive converter reference voltage in volts. | Required. Finite number. |
| coding | Coding | Required. Text; one of "unipolar", "twos-complement-bipolar". Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| result | Result | Required. Object. |
| result.midpointVoltage | Ideal code-bin midpoint in volts under the selected coding. | Calculated result member: number. |
| result.binWidthVoltage | Ideal voltage width of one quantization bin, in volts. | Calculated result member: number. |
{
"input": {
"code": 0,
"bits": 3,
"referenceVoltage": 8,
"coding": "unipolar"
},
"output": {
"result": {
"midpointVoltage": 0.5,
"binWidthVoltage": 1
}
}
} Limitations and assumptions
- These are ideal quantization-bin midpoints under the specified coding, including asymmetric endpoint midpoints; actual ADC transition levels and saturation are not modeled.
- 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
Similar or alternative tools
- Microcontroller: ADC Differential Midcode Offset
Subtract 2^(bits - 1) from offsetBinaryCode for signedCode, with code bounded by the selected 1-24-bit width.
- Dac Unipolar Zero Scale Gap
Use reference / 2^bits as an ideal LSB and divide signed zeroOffset by it for offsetLsb.