Thank you for the reply @jpeyron. This been very helpful.
I have a problem with measuring of 0 - 24 V DC with PMOD AD5 using Arduino UNO. As we know from datasheet, any incoming input voltage to be measured must be within ±(AVDD-1.25V). So, a Voltage divider to step down the input voltage to below 2 V used. The set up of a Voltage divider is,
The PMOD AD5 is operating at 3.3V, which means, reference voltage is 2.5V.
AD7193.h library is used (same one which I mentioned in my first post)
The functions that they have used in the library to measured the voltage are;
By applying the above code, I am getting right reading of the voltage divider should give but this Voltage function is missing a voltage divider ratio, so that's why I am trying to use my function to calculate voltage. The code I am using is;
The output of the above code is 1.25V, Even if there is not input voltage, which mean that it does not work.
My questions are;
Firstly, I don't know what is mPolarity means in the AD7193.h library?
Secondly, why he used half of 24-bit ADC resolution (float)8388608 ?
Finally, how would I use my own function to calculate voltage by getting raw data from the PMOD AD5 ADC?