Skip to content

Driver

ADS7952 Driver

A C++20 driver for the TI ADS7950, ADS7951, ADS7952 and ADS7953 12-bit SAR ADCs. It checks that the chip really answers, reads channels one at a time or as a scan with the fewest frames the chip allows, and keys every result on the channel address in its reply, on any MCU.

Quickstart API guide Source on GitHub

The driver has no platform code. You give it a small class that brings the bus up and moves one 16-bit frame at a time; it does the rest: the reset, the identity check, the frame pipeline, the program sequences and the checks.

12-bit SAR ADC ADS7952 Texas Instruments
Function
12 single-ended channels (4, 8 or 16 on the ADS7950, ADS7951, ADS7953), 12 bits, up to 1 MSPS
Interface
SPI mode 0, up to 20 MHz; one 16-bit frame per conversion, the result two frames after its channel
Modes
Manual (any channel per frame), Auto-1 (a programmed list), Auto-2 (channel 0 to a last channel)
Ranges
0 to VREF or 0 to 2 x VREF, with an external 2.0 V to 3.0 V reference
Extras
Two alarm thresholds per channel on GPIO0 and GPIO1; four GPIOs (TSSOP); power-down
Supply
+VA 2.7 V to 5.25 V, +VBD 1.7 V to +VA

What you get

  • One object per chip. ADS7952<YourPort> takes a reference to your port and does no I/O until EnsureInitialized(). See API guide.
  • A start-up check a dead bus cannot pass. Two channels selected, their addresses read back two frames later: MISO stuck, a fixed pattern or an SDI that never reaches the chip all fail. See Contract.
  • The minimum traffic. A running Auto-1 scan costs one frame per channel; a repeated channel one frame. Extra read-backs are chosen per call. See Contract.
  • Errors you can act on. Every call returns Result<T> with an Error such as Bus, ChannelMismatch or SequenceMismatch. See API guide.
  • Zero-overhead portability. The port is a CRTP class checked by a concept: a transfer and a delay, plus an optional logging hook. See Porting.
  • No heap, no exceptions, no RTTI. The host tests build with -fno-exceptions -fno-rtti. See Contract.
  • Tested without hardware. Host tests run the driver against a protocol model of the chip with the faults seen on hardware, and a fuzzer attacks every reply. See Testing and CI and Status and limitations.

Datasheet

Document Revision Get it
Datasheet: ADS79xx 12-, 10-, 8-Bit, 1-MSPS, 16-, 12-, 8-, 4-Channel, Single-Ended, Serial Interface ADCs (Texas Instruments SLAS605) C, 2018-07 PDF ยท vendor page

Written against these revisions; the SHA-256 of each file is in docs/datasheets.yml. Where each part of the driver is in the datasheet: Datasheet map.

Where to go next

  • Quickstart


    Wire the chip, write the port, read a channel in about 15 lines.

  • Hardware


    Pins, the frame, the modes, the registers and power.

  • Contract


    What the driver promises, what it needs, threading and errors.

  • API guide


    Start, read, scan, set ranges, alarms and GPIOs, and handle errors, task by task.

  • Porting


    Implement the port for your MCU.

  • API reference


    Every class and member, generated from the headers.