cravenhaven
Senior Member
I have a linearity problem with the ADC on a 20x2 chip.
The basic test circuit is shown below and consists of a 10K 25turn trimpot connected between V+ and ground, and the wiper connected to the adc pin via either a 100ohm or 5k6 resistor.
I am monitoring the output of the ADCs at a set range of voltages as measured by my digital multimeter (a low cost model), but notice that at the bottom of the scale the voltage and the ADC outputs become nonlinear.
The relevant code segments are attached.
As you can see in the excel picture the readings become quite nonlinear near the bottom of the range.
The basic test circuit is shown below and consists of a 10K 25turn trimpot connected between V+ and ground, and the wiper connected to the adc pin via either a 100ohm or 5k6 resistor.
I am monitoring the output of the ADCs at a set range of voltages as measured by my digital multimeter (a low cost model), but notice that at the bottom of the scale the voltage and the ADC outputs become nonlinear.
The relevant code segments are attached.
Code:
main:
READADC10 Solar_in,Solar_Reading
SERTXD(" S-Amp ="):TempW2=Solar_Reading:GOSUB ADC_Display_Reading
pause 2000
goto main
end
ADC_Display_Reading:
TempW3=TempW2/100
IF TempW3>$FF THEN
Temp1=TempW3/10
GOSUB Displ_Byte
Temp1=TempW3//10
ELSE Temp1=TempW3
ENDIF
GOSUB Displ_Byte
SERTXD(".")
Temp1=TempW2//100
GOSUB Displ_Byte
RETURN
Displ_Byte:
BINTOASCII Temp1,hundr,tens,units
IF hundr = "0" THEN
hundr = ""
IF tens = "0" THEN
tens = ""
ENDIF
ENDIF
SERTXD( hundr, tens, units, " ")
RETURN
Attachments
-
65.1 KB Views: 40
-
4.3 KB Views: 31