2019-07-22 02:00 AM
In documents and lots of online sources there is a formula as follows(attached below),
But I cannot get why CAL value is in the numerator and RAW data is in the denominator. I have this logic in my mind,
In the factory, producers used a preknown/fixed 3.3 V as Vdd and then they get this reference CAL value from ADC. But in reality, my Vdd may be different because of non-idealities. So I read Vref_int channel via my ADC and it gives me `RAW`. I get the `CAL` value by reading the device memory address provided by manufacturer. ADC reading and voltage level has a direct relationship. So, I then conclude that;
` 3.3 V ------> CAL(from device memory) `
` x V ------> RAW(read from Vref_int) `
Then, ` x * CAL = 3.3 * RAW `
So, ` x = 3.3 * RAW/CAL ` should be my formula to get my current Vdd value so that then I know that a maximum ADC reading (4095 for 12 bits reading for ex.) corresponds to `x` volts.
However, in the attached formula it states that `x = 3.3 * CAL/RAW`.
Please help me with that, thanks.
My board is STM32F4-DISC.