EVAL-AD5933ARDZ no-OS Example Project
See projects/eval-ad5933ardz (doxygen) for the Doxygen documentation.
Supported Evaluation Boards
Overview
The EVAL-AD5933ARDZ is an Arduino-compatible evaluation board for the AD5933, a high precision impedance converter system that combines an on-board frequency generator with a 12-bit, 1 MSPS ADC and an on-chip DFT engine. The frequency generator excites an external unknown impedance, and the DFT engine returns a real and an imaginary data word for each measured frequency point, from which the host computes magnitude, phase, and impedance.
The AD5933 is controlled over a 400 kHz I2C interface at slave address 0x0D.
The excitation frequency is swept from a programmable start frequency in a
programmable increment over up to 511 increments (512 points total), with a
software-selectable output range, PGA gain, and settling-time count. These
examples target the SDP-CK1Z controller board, which carries an STM32
microcontroller and mates with the EVAL-AD5933ARDZ through the SDP connector.
Applications
Electrochemical analysis
Bioelectrical impedance analysis
Complex impedance measurement
Corrosion monitoring and protection equipment
Biomedical and automotive sensors
Proximity sensing
Nondestructive testing and material property analysis
Hardware Specifications
Power Supply Requirements
The EVAL-AD5933ARDZ is powered through the controller board over the SDP connector; no external supply is required for the default configuration. The UART console is available over the controller board's USB connection.
No-OS Supported Examples
This project is organized around the no-OS variant based build flow. Selecting a
variant at build time (--variant <name>) chooses which application is
compiled. The platform main() is a thin dispatcher that calls
example_main(), provided by the selected example. Shared initialization data
is defined in
src/common,
and platform-specific macros and extra init parameters are in
src/platform.
Basic Example
The basic example initializes the AD5933, reads back the on-chip temperature, configures a frequency sweep, and then walks the sweep point by point. For each point it computes a gain factor from the calibration resistor and uses it to convert the raw real/imaginary DFT words into an impedance value, which is printed over UART.
The example supports both measurement paths, selected by the
measurement_mode variable at the top of example_main():
AD5933_MEAS_MODE_2W (the default 2-wire I-measure path, J3 jumper in
I_MEASURE) or AD5933_MEAS_MODE_4W (the 4-wire V-measure path, J3 jumper in
V_MEASURE). The calibration resistor value is chosen automatically to match the
selected mode.
The sweep parameters (start frequency, frequency increment, and number of
increments) are set as macros at the top of
basic_example.c. The device-level
configuration (clock source and frequency, PGA gain, output range, and settling
cycles) lives in the ad5933_user_init structure in
common_data.c.
IIO Example
The IIO example launches an IIOD server on the board so that any libiio client
can connect, configure the AD5933, run a frequency sweep, and read back the
collected real/imaginary data. The sweep parameters used to seed the device at
start-up (start frequency, frequency increment, number of increments, and the
calibration impedance) are set at the top of
iio_example.c; the device-level
configuration is shared with the basic example through ad5933_user_init in
common_data.c.
The whole flow uses standard libiio operations — there is no new protocol:
Configure the sweep parameters by writing the device attributes
out_altvoltage0_frequency_start,out_altvoltage0_frequency_increment,out_altvoltage0_frequency_points(the number of increments; points =out_altvoltage0_frequency_points+ 1) andout_altvoltage0_settling_cycles. The excitation output range (out_altvoltage0_raw) and the input PGA gain (in_voltage0_scale) can be adjusted the same way.Enable the scan channels and open a buffer. The
real(voltage0) andimag(voltage1) channels are scannable, signed 16-bit. Enabling the buffer initializes and starts the sweep automatically; the driver then walks every point, waiting for each to become valid and collecting its real/imaginary words.Read the buffer to retrieve the collected points. Each point is delivered as two interleaved words — real then imaginary — for up to
num_increments + 1points. Requested samples beyond the number of points collected are padded withINT16_MAX. Disabling the buffer places the device in power-down mode. The host performs any magnitude / phase / impedance math from the raw data.
Individual points can also be driven manually through the debug attributes
(sweep_initialized, sweep_started, repeat_measurement,
incremented_measurement and the read-only current_output_frequency); see
the driver documentation for details.
If you are not familiar with ADI IIO Application, please take a look at: IIO No-OS
If you are not familiar with ADI IIO-Oscilloscope Client, please take a look at: IIO Oscilloscope
No-OS Supported Platforms
STM32
Used Hardware
SDP-CK1Z controller board (STM32)
Connections
The EVAL-AD5933ARDZ connects to the SDP-CK1Z through the Arduino Uno-compatible headers. There are no wiring necessary. Place the jumper at position 1-2 on the J1 header to use the on-board external clock. Place the jumper at position 2-3 to use the AD5933 internal clock.
The J3 header selects the measurement path used by the basic example: I_MEASURE
for the 2-wire mode (AD5933_MEAS_MODE_2W) and V_MEASURE for the 4-wire mode
(AD5933_MEAS_MODE_4W).
The AD5933 is accessed over I2C, and the example console is emitted over the controller board's UART:
Build Command
The STM32 platform uses the CMake/Ninja build system via the no_os_build.py
helper script. Available variants: basic, iio_example. Available boards:
sdp-ck1z.
For toolchain setup and prerequisites, see the STM32 CMake build guide.
# point at the STM32 toolchain installations
export STM32CUBEMX=</path/to/stm32cubemx>
export STM32CUBEIDE=</path/to/stm32cubeide>
# Windows (PowerShell) equivalent:
# $env:STM32CUBEMX = "C:\ST\STM32CubeMX"
# $env:STM32CUBEIDE = "C:\ST\STM32CubeIDE"
cd no-OS
# build the IIO example on the SDP-CK1Z board
python tools/scripts/no_os_build.py build \
--project eval-ad5933ardz --variant iio_example --board sdp-ck1z
# build and flash (requires a connected debug probe)
python tools/scripts/no_os_build.py build \
--project eval-ad5933ardz --variant iio_example --board sdp-ck1z \
--probe openocd --flash