ADS1256 Sampling
The ADS1256 is a 24-bit delta-sigma ADC with an internal 8-channel MUX. The firmware uses it in differential mode to read three geophone channels and packs the results into the RS-422 data stream at the configured sample rate.
Channel Assignment
Section titled “Channel Assignment”| ADS1256 Differential Pair | SEED Channel | Geophone Orientation |
|---|---|---|
| AIN0 / AIN1 | EHZ | Vertical |
| AIN2 / AIN3 | EHN | North–South |
| AIN4 / AIN5 | EHE | East–West |
Channel assignments are defined in config.yml via the adc_channel field (0, 1, 2) and are pushed to the MCU at startup as part of the Settings Handshake.
The 4-Call MUX Cycle
Section titled “The 4-Call MUX Cycle”The ADS1256 has a one-conversion pipeline delay: when you write a new MUX register the change takes effect on the next conversion, not the current one. This means a naive 3-call loop would read:
Call 1 → MUX=Z → ADC still settling from previous → WRONGCall 2 → MUX=N → reads ZCall 3 → MUX=E → reads NThe firmware solves this with four calls per output sample, discarding the last result:
cycleDifferential(AIN0/AIN1)— MUX set to Z; ADC returns previous channel (discard on very first loop).cycleDifferential(AIN2/AIN3)— MUX set to N; ADC returns Z ✅.cycleDifferential(AIN4/AIN5)— MUX set to E; ADC returns N ✅.cycleDifferential(AIN0/AIN1)— MUX back to Z; ADC returns E ✅. Discard this result.
After the 4th call the MUX is primed at channel 0 again, and the cycle repeats cleanly.
Timing Budget
Section titled “Timing Budget”The ADS1256 output data rate (DRATE) must be fast enough to complete three differential conversions within one output sample period.
Each conversion takes 1 / DRATE seconds. With 3 channels (plus the discard call = 4 total) and a 10 % SPI overhead margin:
Rearranging:
The settings validator in rpi-seism-common enforces the stricter ×13 rule (9 filter cycles × 1.10 safety margin → rounds up to 13) to guarantee stable settling:
| Output rate | Minimum DRATE | Recommended setting |
|---|---|---|
| 100 Hz | 1300 SPS | DRATE_2000SPS (index 11) |
| 200 Hz | 2600 SPS | DRATE_3750SPS (index 12) |
| 500 Hz | 6500 SPS | DRATE_7500SPS (index 13) |
PGA (Programmable Gain Amplifier)
Section titled “PGA (Programmable Gain Amplifier)”The ADS1256 includes an integrated PGA that sets the input voltage range. For the GD-4.5 + LT1167 signal chain with ~×5.5 analog gain, the geophone signal rarely exceeds ±20 mV. The default setting is:
| Enum | Index | Input range | Use with |
|---|---|---|---|
PGA_64 | 6 | ±78.125 mV | GD-4.5 + LT1167 (~×5.5 gain) |
PGA_32 | 5 | ±156 mV | GD-4.5 direct or low-gain amp |
PGA_8 | 3 | ±625 mV | High-output piezo sensors |
The ADS1256 reference voltage directly sets the ADC full-scale range and appears in the StationXML sensitivity calculation:
The default vref = 2.5 V with PGA_64 yields approximately 215,384,678 counts/V before the instrument sensitivity factor.
Self-Calibration
Section titled “Self-Calibration”On startup (before the first reading) the firmware should trigger an ADS1256 self-calibration (SELFCAL command) to zero out internal offset and gain errors. This is particularly important after power-on temperature transients. The calibration takes ~2 ms at 2000 SPS and is invisible to the daemon due to the 2 s boot delay in the handshake sequence.