I am currently testing the AD7691 18-bit SAR ADC. I have made a circuit with a 16-bit DAC that puts out a voltage for the AD7691 to sample. Then I programmed a micro controller to read and write bits to the DAC and ADC with SPI, and a serial port to transfer data to the PC. The DAC and ADC use different full scale ranges (analog interface makes the DAC about voltages between -20.48 V to 20.4794 V and the ADC reads voltages between -16.384 V to 16.3839 V). The analog interface obviously includes amplification for the DAC output and attenuation of the ADC input along with limiting and common-mode offset to fit within the input range of the AD7691.
I made a small sample program that "sweeps" the DAC from 0 to 65535 with steps of 1 (-20.48 V to 20.4794 V in steps of 1 LSB). For each step I take a sample with the ADC. Plotting the result (x: DAC, y: ADC) gives 65536 points resembling a straight line, as shown below. Obviously one can clearly see that the full scale range of the DAC is greater than that of the ADC, which is supposed to be like that in my project.
Zooming in at the center of the full scale range shows nice samples with a small amount of noise:
The lower part of the FSR shows something different:
The same can be said about the upper part of the FSR:
All three zooms is on the same scale, just different areas of the FSR (X spans 1000, Y spans 5000). Clearly, so called "stuck codes" or "repeated codes" are present in the outer areas of the FSR but not in the center.
I made another plot, computing the difference of one sample to the next over the entire range:
In the "stuck" areas, the difference between two stuck codes is like 32, 64, 96 and so on. This makes me think that the problem is digital rather than analog.
I have also tested the AD7691 with different micro controllers, different frame sizes, different SPI clock and phase configurations and experimented a lot with timing. Some setups did not work at all, but those that "worked" still gives me repeated codes outside the center of the FSR.
I thought that the problem could be a SAR-specific problem. According to the AD7691 data sheet, it is a good idea to put filters on the inputs, like 15 Ohm and 2.7 nF as in figure 29 in the data sheet. I have tried slower filters, like 270 Ohm and 2.7 nF as well as 80 Ohm and 10 nF. No difference. The plots are almost identical.
My voltage reference can deliver a lot of current and is heavily filtered. So is the supplies and everything else.
I have measured the voltage of various batteries to rule out the DAC as the problem. The result here is a sample repeating itself with some kind of periodic "spikes":
So, I still think the problem is digital. I have checked (and changed) my SPI-related code and I still get weird results.
The SPI connection mode I am using for the AD7691 is "CS MODE, 4-WIRE WITHOUT BUSY INDICATOR" as described in page 20 in the AD7691 data sheet.
I posted a question at StackExchange as well. Interesting comments but still no solution: spi - Stuck codes in samples from ADC - Electrical Engineering Stack Exchange
Now it's been like a week and still no solution :-(
I hope that an Applications Engineer from Analog Devices with experience in SAR ADC's like the AD7691 would look at this problem.
Any advice, ideas and help is appreciated. I really need to solve this problem. Thanks in advance :-)