Electronic – Weird samples from SAR ADC

adcdacnoiser2rsampling

I am playing around with some SAR (Successive Approximation) A/D-converters. I have made a test circuit where I have a 16-bit DAC from Texas Instruments (R2R-based) and an 16-bit SAR ADC from Analog Devices. Using a micro controller and some SPI programming, I am able to output a voltage on the DAC and sample it with the ADC. The goal of this test is to verify that the resulting data is a straight line, with some noise.

I let the DAC settle for at least 10 times the required settle time and the output is low-pass filtered to get rid of noise. Although I could sample quite fast, I need some time to transfer data from the micro controller to the PC, so I only make roughly 2-3 samples each second. I make sure that the ADC conversion is finished before latching a new voltage on the DAC.

After about 4000 samples regularly spaced over the entire full scale range, the result can be plotted with the DAC 16-bit word (X) and the ADC (Y). The result looks strange and If I zoom in, there is some kind of periodic "noise" (look at the plot below).

Samples from SAR ADC

I can definitely say that there is no such signal problems when measuring with my scope. There is some noise but that is like 10 mV amplitude. So something is wrong here. I also measured my voltage reference and supply lines and there are no noisy problems here either. I would accept the result if the "spikes" were like 1-10 LSB and random but this is on a much bigger scale and somewhat periodic. The periodicity could be a sign of very low resolution sampling of a linear changing signal but this is not the case. I think this is too large to be quantisation noise. The plot below shows the full range version. The problem is so big that it can be clearly seen in this plot as well. The DAC and ADC is not using the same full scale voltage which explains the flat areas in both ends of the scale.

Full range of samples

Keep in mind that the plot shows maybe about 50-100 samples with only a few samples per second, so we are talking about very slow sampling of a DC voltage that only changes after the ADC conversion is done. The voltage reference is filtered and so is the input signal to the ADC.

I have done the same with a 18-bit SAR ADC as well. Same problems.

Best Answer

OK - I solved the problem. In my SPI setup for the microcontroller, I changed both the clock polarity and the clock phase and it solved the problem. I now have very clean, smooth curves.

I makes sense now. The 16-bit words read out from the ADC were indeed not correct and contained both information from the previous word and the current. That explains both the periodicity and weirdness in the plots.

Thankfully both the DAC and ADC seems to work fine with the new clock and phase polarity, despite being from different manufactures :-)