Scott, >I know what you mean. In case anyone's interested, this is how you measure >linearity error. > >2) Find the least square's curve fit of the data. In other words, find the >line that best fits the data. I "cheat" and use Excel's linest function to achieve the same result. Linest does a least squares staright line curve fit identical to what you described. Format is INDEX(LINEST(Ax:AY,Bx:By),Z) Where Ax:Ay is ther range of the first variable (millivolts here) Bx:By is range of second variable - sigmadelta count here And Z is 1 for slope and 2 for intercept of the best fit (least squares) line. You then just multiply each sigma-delta count by the slope and add the intrecept to get a "predicted" voltage output from the converter. Plotting this against the actual millivolts input i) As two lines - gives you a good visual check on any strange values. ii) As an X/Y scatter graph - SHOULD give a rluler flast line if its working properly. It's an excelent way of spotting discontinuities and non linearities . If the capacitor is too small you get "plateaus" at certain points - the first to show as the capacitor is reduced is around the half maximum count point eg 1024 in a 2048 count decimal system. >1) Collect a whole bunch of data and record a) the voltage applied and b) >and the converted digital value. You also should collect several samples >at each voltage value and use the mean of the digital values to represent >converted digital value. There's another test for measuring the spread. I haven't done any formal "spread" measurements yet but I let the converter run at a single input value and watch the output count - if it varies by more than +/- 1 count over a short trm I want to know why. Sometimes you get a few counts variation towards one or other end of the range. If the comparator / gate switching point is not well defined the count will fluctuate more widely for a fixed input and you can be sure that the results are going to be poor. So far I get MUCH worse results than you do using gate inputs but much the same using a comparator. >2) Find the least square's curve fit of the data. In other words, find the >line that best fits the data. > >3) Find the sample that most deviates from this line. Plotting the graph in Excel does this visually and lets me see all the data at a glance. For runs with good results I also plot the limit lines for 1 and 2 count errors to see how tightly the data matches theoretical. I often get many of the actual data values well under the 1 count error limit indicating that they are the best possible result available for that particular input and number of samples. OTHER I also do a "real" estimate based on what I'm going to have in the final system - a zero point which can be calibrated any tine on the fly and a max value point available only during setup. Russell estimated voltage = (COUNT - COUNTmin) x (mVmax-mVmin)/(COUNTmax-COUNTmin) + mVmin This gives a curve with zero error at each end and a positive error curve between the two points. It is generally more inaccurate than the least squares curve but represents something like what I'm going to be able to actually do in practice. In the final version there will (probably) be one adjustment = max value set, and the zero value will be read as required. RM