I'm using an AD7799 to capture Thermocouple input voltages and convert to temperature. I'm running Linux Kernel 3.10 and have the ad7793 driver built in.
When performing successive reads, I'm getting carryover data from one read to the next. For instance, performing cat in_voltage0-voltage0_raw will yield 8388608. After this, I attempt to read in_voltage1-voltage1_raw and obtain the same value from the ADC, despite providing a known voltage input (3.3V) that should max out the differential pair reading.
I have the ADC update rate set at 39Hz. I am using a gain of 1.
Are there any known issues relative to this problem? Or any recommendations to resolve?
What is the value of your Vref? Also, if you try to reduce the voltage on the first channel from 3.3V to something like 1V, do you see any change?
Another thing that you can try is to use a newer version of the driver. At a first look, it seems that a newer version of the driver performs a device reset at setup: https://github.com/analogdevicesinc/linux/blob/master/drivers/iio/adc/ad7793.c#L283
Let us know how it goes.
I should also note that pioD10, which I'm using as the trigger, is the dout/!drdy pin.
I think I was able to reproduce your issue. Can you please try to read the channels in reverse order CH3 -> CH2 -> CH1 ... and see if the problem persists?
I was able to do some more tests on the AD7799. In order for the driver to work properly, you need to connect the DOUT pin from the AD7799 to both the SPI DIN pin from your microcontroller and also to a different pin configured as an interrupt.
Please let me know if this fixes the issue.
Thanks for letting me know. I will test this to see if the issue is resolved.
Any input on this ?
I will have new boards in a few more weeks to validate against. Will follow up then.
I have confirmed having a second pin on the microprocessor connected to DOUT/~DRDY allows use of the interrupt driven approach.
It is odd, however, that to have this work I need to set the additional pin edge to "falling" directly from user space to enable the functionality. Further, there is no direct link between this pins falling edge trigger and the actual AD7799 driver itself.