Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
AD5933 Class Reference
#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:
-
sda I2C data line pin scl I2C clock line pin extClk source 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:
-
startFreq initial frequency (max 100000Hz) stepFreq stepsize of increment in frequency nrOfSteps number of increments nrOfCycles Number of cycles (outputfrequency) to wait for sampling can start (max 2044) PGA Gain of the pre-amplifier (true = x1; false = x5) RangeNr Set 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 | ( | ) |
bool setAnalogCircuit | ( | bool | PGA, |
int | RangeNr | ||
) |
Set the gain of the pre-amplification and the output voltage range.
- Parameters:
-
PGA Gain of the pre-amplifier (true = x1; false = x5) RangeNr Set 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:
-
nrOfCycles Number 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 |
Generated on Thu Jul 14 2022 01:54:59 by
