mjmeli/arduino-ad5933

Excitation Voltage Output

Opened this issue · 9 comments

How to define macros for excitation voltage output. I am using AD5933 for impedance measurement .But i did not known how to set the excitation voltage value .
arduino-ad5933-master.zip
This is code i upload.Please tell me the correct place to include excitation voltage macro and its functions.

Check in the header file. You willl find the "setRange" function, allowing you to define the range based on one of the macro also defined in the header file (ex: "CTRL_OUTPUT_RANGE_1"). Check the datasheet corresponding to the AD5933 to know which one to use.
You will want to call this function in the setup.

Could you send your code, with the error please?

Ah yes I see. Go in the header file and the "static" keyword before the function name. You should have this: "static bool setRange(byte);"
`/**

  • AD5933 Library class

  • Contains mainly functions for interfacing with the AD5933.
    */
    class AD5933 {
    public:
    // Reset the board
    static bool reset(void);

    // Temperature measuring
    static bool enableTemperature(byte);
    static double getTemperature(void);
    
    // Clock
    static bool setClockSource(byte);
    static bool setInternalClock(bool);
    static bool setSettlingCycles(int);
    
    // Frequency sweep configuration
    static bool setStartFrequency(unsigned long);
    static bool setIncrementFrequency(unsigned long);
    static bool setNumberIncrements(unsigned int);
    
    // Gain configuration
    static bool setPGAGain(byte);
    
    // Excitation range configuration
    static bool setRange(byte);
    
    // Read registers
    static byte readRegister(byte);
    static byte readStatusRegister(void);
    static int readControlRegister(void);
    
    // Impedance data
    static bool getComplexData(int*, int*);
    
    // Set control mode register (CTRL_REG1)
    static bool setControlMode(byte);
    
    // Power mode
    static bool setPowerMode(byte);
    
    // Perform frequency sweeps
    static bool frequencySweep(int real[], int imag[], int);
    static bool calibrate(double gain[], int phase[], int ref, int n);
    static bool calibrate(double gain[], int phase[], int real[],
                          int imag[], int ref, int n);
    

    private:
    // Private data
    static const unsigned long clockSpeed = 16776000;

    // Sending/Receiving byte method, for easy re-use
    static int getByte(byte, byte*);
    static bool sendByte(byte, byte);
    

};`

Can you post the code here, on github? Because you might be sending it by email, which only takes the text. I would like to have some precisions as well on your setup.

hi,i have the same problem. and I've tried changing the h file but it doesn't work. can you help me