Tool/software:
My design runs on 3.3V. I have an analog switch I control to switch in a reference for conversion. The values are 3.3V 2.5V 1.25V and 1.024V.
I am switching in a different reference for each channel prior to conversion.
I am running in differential input mode. CH1 gets 1.25V
CH2 gets 2.5V
CH3 gets 1.25V
It seems like the reference voltages are getting messed up. I would expect half response for a given signal if I give the channel a 2.5V ref than when I give it a 1.25V reference.
Is there a set up time or a problem with switching in different references for different channels? I can supply more information as directed in the thread.
Hi GREG SHIPLEY,
Can you explain in more detail what you mean by "getting messed up"? Is the voltage close to the expected target, or way off? Can you quantify the error you are seeing?
If you slow down the ADC data rate as much as possible does the issue get better?
Can you provide a schematic?
-Bryan
Here a couple pages of the ADC. schematic area. I am switching in the references via an analog switch. I have verified this does work and the appropriate voltage is making it to the REF pin. Basically what is happening, If I select a reference of 3.3V, I get a response, if I change it to 1V I get the same response, I would expect a larger response for a smaller REF voltage. I am running pretty slow, I am sampling three channels once and sending the data at 2Hz. Let me know what else you would like to know.
Hi GREG SHIPLEY,
Have you selected the correct reference in the ADC register settings? The ADC does default to REFP0/REFN0, which appears to be the reference source you are using, but is it possible you have the internal reference selected as the source?
Do you get the correct response using the 3.3V VREF? For example, if you apply 1V, you should get an ADC code that is approximately 1 / 3.3 * (2^23) = 2542002d. Then when you change the reference source, how much does the code value change? Can you provide the actual data you are receiving, including the input voltage, the (expected) VREF, and the gain?
You should not get the same code if you are changing the VREF voltage, the ADC code should double for a 1.25V VREF compared to a 2.5V VREF, for example, assuming the input voltage stays the same.
-Bryan
Ok now it lets me reply for some reason it would not before.
so resolved it. Problem 1: I was only assigning the reference voltage in an ADC_INIT routine at power up, so power cycle required for it to change. Problem 2, our windows post processing software was doing math calculating the voltage based off of a 1.25V reference. So, it was not correct. Looking at the ADC number coming in, it changes correctly when changing references.
Thank you for your time.