ProtoCore v0.0.1
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
ad9238.h File Reference

SPI configuration-port codec for the AD9238 (and the shared ADI high-speed-ADC SPI map it belongs to) - PC_ENABLE_AD9238. More...

#include "protocore_config.h"

Go to the source code of this file.

Detailed Description

SPI configuration-port codec for the AD9238 (and the shared ADI high-speed-ADC SPI map it belongs to) - PC_ENABLE_AD9238.

The AD9238 (12-bit, 20/40/65 MSPS dual ADC) has TWO interfaces that must not be confused:

  • The sample data path: a parallel CMOS/LVDS bus (12 data lines + DCO/output clock per channel) run far beyond what a microcontroller can bit-bang at 20-65 MSPS. That path is NOT this file - it is out of scope for direct MCU capture; see reverse_engineering/README.md for the FPGA/CPLD-buffered burst-drain architecture this project actually uses.
  • The SPI configuration port (SCLK / SDIO / CSB, 3-wire, MSB first): a low-speed, low-throughput control channel for power-down, output data format, output test patterns, and offset trim - register writes only, never the sample stream. This file is that codec: it builds the 16-bit instruction word (R/W + 2-bit byte-count + 13-bit address) and the shadow-register "device update" transfer that the whole ADI high-speed-ADC generation of this era (AD9238 and its close siblings) share, per the AD9238 Rev. D datasheet's SPI Register Map. Pure codec (builds/parses byte sequences); the SPI clocking is the app's - same contract as every other codec in this library (see services/instrumentation/scpi, services/instrumentation/gpib).

Confidence note. The instruction-word framing and the transfer-register mechanism are the standardized shape used across this ADI ADC generation and are implemented directly from that convention. The specific per-register bit-field constants below (Ad9238Reg and the test- pattern / output-mode enums) transcribe the AD9238 Rev. D datasheet's register table as best documented; confirm every address and bit position against your part's datasheet revision before writing to real silicon - per this project's hardware-verification policy (docs/KNOWN_LIMITATIONS.md), nothing here has been validated against a physical AD9238 yet.

Reference: Analog Devices AD9238 Data Sheet Rev. D, "Serial Port Interface (SPI)" section.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file ad9238.h.