Datasheet
Preliminary Technical Data EVAL-AD5933EB
Rev. PrC | Page 15 of 32
SOURCE CODE FOR IMPEDANCE SWEEPS
PROGRAM THE AD5933
INTO POWER-DOWN MODE.
PLACE THE AD5933 INTO STANDBY MODE.
PROGRAM FREQUENCY SWEEP PARAMETERS
INTO RELEVANT REGISTERS.
(1) START FREQUENCY REGISTER
(2) NUMBER OF INCREMENTS REGISTER
(3) FREQUENCY INCREMENT REGISTER
READ VALUES FROM REAL AND
IMAGINARY DATA REGISTER.
PROGRAM INITIALIZE WITH START
FREQUENCY COMMAND TO THE CONTROL
REGISTER.
POLL STATUS REGISTER TO CHECK IF
THE DFT CONVERSION IS COMPLETE.
RESET: BY ISSUING A RESET COMMAND TO
THE CONTROL REGISTER, THE DEVICE IS
PLACED INTO STANDBY MODE.
PROGRAM THE INCREMENT FREQUENCY OR
THE REPEAT FREQUENCY COMMAND TO THE
CONTROL REGISTER.
POLL STATUS REGISTER TO CHECK IF
FREQUENCY SWEEP IS COMPLETE.
05435-026
PROGRAM START FREQUENCY SWEEP
COMMAND IN THE CONTROL REGISTER, AFTER
A SUFFICIENT AMOUNT OF SETTLING TIME
HAS ELAPSED.
YES
YES
NO
YES
NO
Figure 26. Sweep Flowchart
This section outlines the evaluation board code structure required
to set up the AD5933 frequency sweep. The sweep flow outline is
shown in
Figure 26. Each section of the flowchart will be explained
with the help of Visual Basic code extracts. The evaluation board
source code (Visual Basic) is available upon request from the
Analog Devices
Technical Support Center. The firmware code
(C code), which is downloaded to the USB microcontroller
connected to the AD5933, implements the low level I
2
C signal
control (that is, read and write vendor requests).
The
Evaluation Board Source Code Extract section provides an
example of how to program a single frequency sweep, starting at
30 KHz, with a frequency step of 10 Hz and 150 points in the
sweep. The code assumes that a 16 MHz clock signal is connected
to Pin 8 (the MCLK pin) of the AD5933. The impedance range
being tested is from 90 kΩ to 110 kΩ. The gain factor is calculated
at the midpoint of the frequency sweep, that is, 30.750 kHz. The
calibration is carried out with a 100 kΩ resistor connected between
VOUT and VIN. The feedback resistor is 100 kΩ.
The first step in
Figure 26 is to program the three sweep
parameters that are necessary to define the frequency sweep
(that is, the start frequency, the frequency increment, and the
number of frequency increments in the sweep). Refer to the
AD5933 data sheet for more details.