Hello,
My team has a device which contains a circuit based on the CN0540 with only some minor part substitution, but we're having trouble calibrating to sensors.
We're using pyadi-iio to interact with the device, and after reading page 5 of the CN0540 circuit note, created this calibration routine.
raw_data = adc.rx()
mean = np.mean(raw_data)
if mean > 0:
dac_value -= 2 ** (14 - i)
else:
dac_value += 2 ** (14 - i)
adc._set_iio_attr_float(
"voltage0", "raw", True, dac_value, dac_chan
)
time.sleep(0.1)
The issue is that the DAC is driven to it's limit every time, no matter the sensor used.
I'm asking this question, hoping to get some insight on whether this is the intended way to calibrate this circuit, or if there is perhaps a mistake in our hardware we need to investigate.
Thank you,
Wyatt