
Numbers are simulation results (tt, 27 °C, 1.8 V) unless stated otherwise. The full tile was simulated from its pins in every operating mode below, and again from the extracted layout (R + C): the codes match the schematic exactly. Corner and Monte Carlo results are in the repository (
sim/*/README.md).
An 8-bit successive-approximation (SAR) ADC that uses its own on-chip bandgap reference, plus an on-chip temperature sensor read through the same ADC.
ua[0], VPTAT, VBG or ground.ua[1].
With an external reference, the ADC can measure the internal bandgap voltage itself.| Pin | Internal mode (MODE = 0) | External mode (MODE = 1) |
|---|---|---|
ua[0] |
VIN, ADC input (0 … VREF) | VIN |
ua[1] |
REF_SEL = 1: external VREF input (1.0–1.8 V). REF_SEL = 0 and VREF_OE = 1: buffered VREF output | same |
clk |
ADC clock (1 MHz for VIN; ≤ 100 kHz for INSEL = VPTAT or VBG) | unused |
rst_n |
reset (active low) | reset |
ui[0] |
START: high = convert continuously | EXT_D0 |
ui[1] |
VREF_OE: buffered VREF on ua[1] |
EXT_D1 |
ui[2] |
— | EXT_D2 |
ui[3] |
BG_PD: power down bandgap + VREF buffer | EXT_D3 |
ui[7:4] |
— | EXT_D[7:4] |
uo[7:0] |
D[7:0], conversion result | mirrors EXT_D[7:0] |
uio[0] (in) |
MODE | MODE |
uio[1] (in) |
— | EXT_SAMPLE (1 = track, 0 = hold) |
uio[2] (in) |
— | EXT_CMP_CLK (comparator evaluates while high) |
uio[3] (in) |
REF_SEL (0 = internal, 1 = ua[1]) |
REF_SEL |
uio[4] (out) |
CMP_OUT, comparator output | CMP_OUT |
uio[5] (out) |
EOC, end of conversion | 0 |
uio[7:6] (in) |
INSEL: 00 VIN, 01 VPTAT, 10 VBG, 11 GND | INSEL |
All tests run from the TT demo board's RP2040 (MicroPython). Set uio[0,1,2,3,6,7] as RP2040
outputs and uio[4,5] as inputs. After power-up (or BG_PD 1 → 0), wait ≥ 100 µs before the first
conversion: the filtered reference settles in ≈ 45 µs (simulated).
Basic conversion (internal reference). MODE = 0, REF_SEL = 0, INSEL = 00, clock 1 MHz,
pulse rst_n low, then set START = 1. Apply a DC voltage (0 … 1.2 V) to ua[0] from a low-impedance
source. On each rising edge of EOC, read D[7:0]. Expect D ≈ 256 · VIN / VREF with VREF ≈ 1.21 V.
Reference check and calibration. Set VREF_OE = 1 and measure ua[1] with a ≥ 10 MΩ multimeter:
≈ 1.21 V (whole tile: 1.208 V; simulated chip-to-chip spread σ ≈ 18 mV from mismatch, ±0.4 % over
process). While converting, ua[1] shows short dips (up to ≈ 35 mV for ≈ 100 ns) when the DAC switches;
a multimeter averages them out. Store the
measured value and use it as VREF in all conversions: D · VREF_measured / 256.
(A 1 MΩ probe reads ≈ 17 mV low, because the buffer's output resistance is ≈ 12 kΩ. Conversions are
not affected.)
Offset and gain calibration (recommended for any absolute measurement). The comparator's random
offset is ≈ 17.5 mV σ (Monte Carlo; ≈ 4 LSB, up to ≈ 8 LSB on a 95th-percentile chip). It shifts every
code by the same amount; it does not affect linearity. Convert two known DC inputs on ua[0], e.g.
VA ≈ 0.2 V and VB ≈ 1.0 V (measured with the multimeter), giving codes DA and DB. Then
VIN = VA + (D − DA) · (VB − VA) / (DB − DA). This removes offset and gain (VREF) error together.
Avoid calibration points within ≈ 50 mV of 0 V or VREF: there a chip with a large offset clips at
code 0 or 255.
Linearity. Sweep VIN slowly over 0 … 1.2 V (or use a sine from a function generator) and record codes. Compute DNL/INL from the code histogram, ENOB from an FFT.
Temperature sensor. INSEL = 01, clock ≤ 100 kHz (VPTAT has ≈ 270 kΩ source impedance and needs a ≥ 4 µs sample phase). About 2.4 °C per code.
Bandgap voltage through the ADC. Apply a known reference (e.g. 1.500 V) to ua[1], decoupled with
≥ 100 nF next to the pin. REF_SEL = 1, INSEL = 10, clock ≤ 100 kHz. VBG = D · VREF_ext / 256.
For better than ≈ ±20 mV, correct D for the comparator offset first: with the same settings but INSEL = 00,
convert a known voltage near 1.2 V on ua[0] and use the difference to its ideal code.
Fallback: external reference. If the bandgap doesn't work, REF_SEL = 1 with an external
reference on ua[1] still runs the ADC (tests 1 and 3).
Fallback: external SAR mode. MODE = 1. Drive EXT_SAMPLE = 1, then 0 (sample), then for each bit from MSB to LSB: set the trial code on EXT_D, pulse EXT_CMP_CLK high, read CMP_OUT (1 = input below the trial level → clear that bit). This exercises the DAC and comparator without the on-chip SAR logic.
Offset check. INSEL = 11 (ground): depending on the sign of the comparator offset, this gives code 0
or a small non-zero code (a few LSB are normal, see the calibration under test 2). A small known input
(e.g. 50 mV) on ua[0] measures the offset of either sign.
Simulated on the whole tile (from its pins, sim/m2/): test 1 gives the ideal code floor(256 · VIN / VREF)
at 0.05 / 0.31 / 0.6 / 0.9 / 1.17 V (schematic and extracted layout); test 4 gives 127 at 27 °C; test 5
gives 206 with a 1.5 V reference (VBG ≈ 1.21 V); test 6 with the bandgap powered down (BG_PD = 1) gives
the ideal codes; in test 7 CMP_OUT flips between the trial codes just below and above the input; test 8
gives 0.
ua[0] (0 … 1.2 V, low output impedance).ua[1] for tests 5 and 6.| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | START / EXT_D0 | D0 | MODE |
| 1 | VREF_OE / EXT_D1 | D1 | EXT_SAMPLE |
| 2 | EXT_D2 | D2 | EXT_CMP_CLK |
| 3 | BG_PD / EXT_D3 | D3 | REF_SEL |
| 4 | EXT_D4 | D4 | CMP_OUT |
| 5 | EXT_D5 | D5 | EOC |
| 6 | EXT_D6 | D6 | INSEL0 |
| 7 | EXT_D7 | D7 | INSEL1 |
ua | PCB Pin | Internal index | Description |
|---|---|---|---|
| 0 | T | 9 | VIN |
| 1 | U | 8 | VREF_OUT / VREF_EXT |