Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excitation Voltage Output #20

Open
Anupriya12-07 opened this issue Oct 4, 2021 · 9 comments
Open

Excitation Voltage Output #20

Anupriya12-07 opened this issue Oct 4, 2021 · 9 comments

Comments

@Anupriya12-07
Copy link

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.

@ChabaneAmaury
Copy link

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.

@Anupriya12-07
Copy link
Author

Anupriya12-07 commented Oct 27, 2021 via email

@ChabaneAmaury
Copy link

Could you send your code, with the error please?

@Anupriya12-07
Copy link
Author

Anupriya12-07 commented Oct 27, 2021 via email

@ChabaneAmaury
Copy link

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);
    

};`

@Anupriya12-07
Copy link
Author

Anupriya12-07 commented Oct 27, 2021 via email

@Anupriya12-07
Copy link
Author

Anupriya12-07 commented Oct 28, 2021 via email

@ChabaneAmaury
Copy link

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.

@Lezaputriutami
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants