ADCs won't read above 2.5v (511 raw)
Posted: Sat Oct 07, 2017 1:51 am
I feel like there's a simple explanation for this, but I'm getting dizzy trying to find it...
I have an 18F2620 with 3 ADCs. With Flowcode 7 simulation, all three ADCs read correctly from 0 volts to 5 volts using "getVoltage()" and from 0 to 1023 using "getInt()".
And when I simulate the hardware using Proteus all ADCs read correctly: 0 volts to 5 volts using "getVoltage()" and from 0 to 1023 using "getInt()".
BUT...on the actual hardware, the ADCs will only read from 0 to 2.5 volts using "getVoltage()" and from 0 to 511 using "getInt()". There's nothing connected to the pins except a test voltage source (a pot dividing 5 volts). I can measure the voltage on the input pins and the go from 0v to 5v but the processor ADCs only read the correct voltage up to 2.5 volts, then won't rise above that level.
It's not a case of the voltage being divided by 2, since the voltage reads correctly until it gets to 2.5 volts (or 511 raw)...it won't read the higher voltages, it just reads all voltages over 2.5 as exactly 2.5, or 511 using "getInt()".
Anybody know why my hardware ADC inputs won't read any higher than exactly 2.5v or 511, while the simulations work correctly?
...thanks
I have an 18F2620 with 3 ADCs. With Flowcode 7 simulation, all three ADCs read correctly from 0 volts to 5 volts using "getVoltage()" and from 0 to 1023 using "getInt()".
And when I simulate the hardware using Proteus all ADCs read correctly: 0 volts to 5 volts using "getVoltage()" and from 0 to 1023 using "getInt()".
BUT...on the actual hardware, the ADCs will only read from 0 to 2.5 volts using "getVoltage()" and from 0 to 511 using "getInt()". There's nothing connected to the pins except a test voltage source (a pot dividing 5 volts). I can measure the voltage on the input pins and the go from 0v to 5v but the processor ADCs only read the correct voltage up to 2.5 volts, then won't rise above that level.
It's not a case of the voltage being divided by 2, since the voltage reads correctly until it gets to 2.5 volts (or 511 raw)...it won't read the higher voltages, it just reads all voltages over 2.5 as exactly 2.5, or 511 using "getInt()".
Anybody know why my hardware ADC inputs won't read any higher than exactly 2.5v or 511, while the simulations work correctly?
...thanks