What might bias the analog inputs low in the BLxSxx series?

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

I don’t know what Digi’s manufacturing process covers, but this looks like it could be a calibration issue.

Have you tried running the calibration program “Adc_cal_se_unipolar.c”? I believe it reports current calibration data and can update the data stored on the SBC.

1 Like

It looks like the backup batteries died and they lost their calibration constants. I suspect they’ve been on the shelf a while.

RESERVED_READ_WRITE.c reads and allows you to back up the calibrations.
Adc_cal_se_unipolar.c lets you update the calibrations.

After replacing the batteries and using those two programs they’re working well.

Thanks for your help.

I believe calibration constants are stored in flash, but I don’t know whether Digi calibrates before shipping, or the expectation is for their customers to calibrate as needed before use. Now that you’ve calibrated, it should maintain those constants even with the backup battery removed.