I’m updating a controller that previously used an SR9000 system to BL5S220 controllers.
The analog-in channels consistently read low compared to a calibrated voltmeter.
To make sure it wasn’t our program or equipment I used the Adc_rd_se_unipolar.c sample program and set up a voltage divider from the 5 V output on the board to an analog in channel.
When set to what I believe is the appropriate gain code for anaInVolts(), “2” for 0-5V single ended unipolar, the reading is consistently ~0.5 V lower than expected, and will be quite negative at low values.
When using a gain code for lower voltages, such as 0-1, the reading is much closer, but obviously can’t read the full range of the 0-5 V instruments we plan to use.
Am I misunderstanding how this works or is there another piece to reading the analog ins? I haven’t set up an SR9000 to compare results but I recall they were consistent with a multimeter.
Below is a comparison of the values at different gain codes to anaInVolts(). Readings in volts, gain codes from the ADC_GAINS table in the Dynamic C help files.
Thanks for any help.
meter blxSxx gain code
0.000 -0.44 2
0.407 0.00 2
0.999 0.61 2
2.000 1.69 2
2.999 2.75 2
4.003 3.83 2
4.987 4.90 2
0.000 -0.17 4
0.159 0.01 4
1.002 0.90 4
2.002 1.97 4
2.503 2.51 4