Marijn Billiet / AD5933
Embed: (wiki syntax)

« Back to documentation index

AD5933 Class Reference

AD5933 Class Reference

AD5933 class. More...

#include <ad5933.h>

Public Member Functions

 AD5933 (PinName sda, PinName scl, bool extClk)
 Create AD5933 instance.
bool setSettlingTime (unsigned int nrOfCycles)
 Time to wait before the ADC starts to sample.
bool setAnalogCircuit (bool PGA, int RangeNr)
 Set the gain of the pre-amplification and the output voltage range.
bool Measure (bool increment)
 Measure Impedance.
bool reset ()
 Resets Device.
float getTemperature ()
 Get temperature of chip.
bool standby ()
 Puts the Device in Standby Mode.
bool powerdown ()
 Puts the Device in PowerDown Mode.
bool initFrequencySweepParam (unsigned int startFreq, unsigned int stepFreq, unsigned int nrOfSteps, unsigned int nrOfCycles, bool PGA, int RangeNr)
 Initialises a frequency sweep.

Data Fields

unsigned int real
 real part of impedance (uncalibrated)
unsigned int imaginary
 imaginary part of impedance (uncalibrated)

Detailed Description

AD5933 class.

Library to communicate with the AD5933 impedance meter chip.

Example:

 #include "mbed.h"
 #include "ad5933.h"

 AD5933 Zmeter(p28, p27, false);

 int main() {
     float temp = Zmeter.getTemperature();

     Zmeter.initFrequencySweepParam(100000, 10, 2, 50, true, 1);

     while(true) {
          if(!Zmeter.Measure(true))
              printf("error occured");
          
          int real = Zmeter.real;
          int imag = Zmeter.imaginary;

          wait(1);
     }
     
 }

Definition at line 51 of file ad5933.h.


Constructor & Destructor Documentation

AD5933 ( PinName  sda,
PinName  scl,
bool  extClk 
)

Create AD5933 instance.

Parameters:
sdaI2C data line pin
sclI2C clock line pin
extClksource of the Clock signal: true = external; false = internal

Definition at line 37 of file ad5933.cpp.


Member Function Documentation

float getTemperature (  )

Get temperature of chip.

Returns:
temperature in degrees Celcius

Definition at line 235 of file ad5933.cpp.

bool initFrequencySweepParam ( unsigned int  startFreq,
unsigned int  stepFreq,
unsigned int  nrOfSteps,
unsigned int  nrOfCycles,
bool  PGA,
int  RangeNr 
)

Initialises a frequency sweep.

Parameters:
startFreqinitial frequency (max 100000Hz)
stepFreqstepsize of increment in frequency
nrOfStepsnumber of increments
nrOfCyclesNumber of cycles (outputfrequency) to wait for sampling can start (max 2044)
PGAGain of the pre-amplifier (true = x1; false = x5)
RangeNrSet the output voltage (1 = 2V; 2 = 1V; 3 = 400mV; 4 = 200mV)
Returns:
true on succes, false on failure

Definition at line 119 of file ad5933.cpp.

bool Measure ( bool  increment )

Measure Impedance.

Parameters:
increment(true = goto next frequency in sweep; false = remeasure at current frequency)
Returns:
true on succes, false on failure

Definition at line 201 of file ad5933.cpp.

bool powerdown (  )

Puts the Device in PowerDown Mode.

Returns:
true on succes, false on failure

Definition at line 196 of file ad5933.cpp.

bool reset (  )

Resets Device.

Returns:
true on succes, false on failure

Definition at line 182 of file ad5933.cpp.

bool setAnalogCircuit ( bool  PGA,
int  RangeNr 
)

Set the gain of the pre-amplification and the output voltage range.

Parameters:
PGAGain of the pre-amplifier (true = x1; false = x5)
RangeNrSet the output voltage (1 = 2V; 2 = 1V; 3 = 400mV; 4 = 200mV)
Returns:
true on succes, false on failure

Definition at line 151 of file ad5933.cpp.

bool setSettlingTime ( unsigned int  nrOfCycles )

Time to wait before the ADC starts to sample.

Parameters:
nrOfCyclesNumber of cycles (outputfrequency) to wait for sampling can start (max 2044)
Returns:
true on succes, false on failure

Definition at line 134 of file ad5933.cpp.

bool standby (  )

Puts the Device in Standby Mode.

Returns:
true on succes, false on failure

Definition at line 191 of file ad5933.cpp.


Field Documentation

unsigned int imaginary

imaginary part of impedance (uncalibrated)

Definition at line 111 of file ad5933.h.

unsigned int real

real part of impedance (uncalibrated)

Definition at line 108 of file ad5933.h.