ProtoCore v1.0.16
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) - PROTOCORE_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) - PROTOCORE_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 AN-877'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, the transfer-register mechanism and every register address in Ad9238Reg are transcribed from AN-877 Rev. A, which defines the map this whole ADI ADC generation shares. AN-877 says which registers exist and where; it does not say which of them a given part implements, so 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 AN-877 Rev. A, "Interfacing to High Speed ADCs via SPI", the FORMAT and CHIP PROGRAMMING sections. Cached at docs/learn/datasheets/an877.pdf.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file ad9238.h.