[En-Nut-Discussion] AD conversion resolution?

Alexander Baranov baranov at intech21.com
Thu Dec 15 14:38:39 CET 2005


Hi.
If you want to estimate ADC linearity here is one of the ways to do it:
Feed pure sine signal to it's input (with a half range offset), program ADC
for measurements with constant sampling rate satisfying Nyquist  criteria
and send the samples to PC through serial port. Let it be 1024 samples. Then
you estimate the spectrum of obtained signal (e.g. with the help of Excell
or MATLAB) and get  the linearity characteristics.
Regards, Alex.
----- Original Message ----- 
From: "Gerwin Voorsluijs" <g.m.voorsluijs at wanadoo.nl>
To: "Ethernut User Chat (English)" <en-nut-discussion at egnite.de>
Sent: Thursday, December 15, 2005 4:35 AM
Subject: Re: [En-Nut-Discussion] AD conversion resolution?


> Hi Alexander,
>
> I am slowly turning a potentionmeter that is linked to an external power
> source. To my knowledge that gives a continuously varying voltage and
> therefore the AD readout should show the 10 bit resolution plus possibly
> a little jitter.
>
> Alexander Baranov wrote:
> > Hello.
> > Do you mean that you control the input voltage steps and they are
precisely
> > equal?
> >
> > ----- Original Message ----- 
> > From: "Gerwin Voorsluijs" <g.m.voorsluijs at wanadoo.nl>
> > To: <en-nut-discussion at egnite.de>
> > Sent: Wednesday, December 14, 2005 12:50 PM
> > Subject: [En-Nut-Discussion] AD conversion resolution?
> >
> >
> >
> >>Dear all,
> >>
> >>I'm trying to use the 10bit AD conversion of the Ethernut and with some
> >>trial and error I've managed to get some data out of it. The values I
> >>get seem OK, but I'm a little disturbed by the fact that I don't get a
> >>continuously climbing value out of it when I raise the voltage slowly.
> >>For example, for the purpose I am using it (which I am sure has
> >>continuous voltages!) I get the following set of "steps":
> >>
> >>156   158   159   176   177   184   188   192   193   195   199   206
> >>207   224   225   227   231   240   241   248   252   254   255   304
> >>312   316   318   319   327   335   348   352
> >>
> >>I know I am not using the full range of 0-5 V (I measured with a
> >>"normal" voltmeter around 0.8-1.7 V so that seems OK)
> >>
> >>Does anyone have any idea what is going on? Lemme include the little
> >>piece of code I used:
> >>
> >>#include <cfg/crt.h>    /* Floating point configuration. */
> >>#include <string.h>
> >>#include <stdio.h>
> >>#include <io.h>
> >>#include <dev/board.h>
> >>#include <sys/timer.h>
> >>#include <dev/adc.h>
> >>
> >>int main(void)
> >>{
> >>     u_long baud = 115200;
> >>     FILE *uart;
> >>
> >>     u_char ad_chk;
> >>     u_short adc_value;
> >>     NutRegisterDevice(&DEV_UART, 0, 0);
> >>     uart = fopen(DEV_UART_NAME, "r+");
> >>     _ioctl(_fileno(uart), UART_SETSPEED, &baud);
> >>
> >>     ADCInit();
> >>     ADCSetRef(AVCC);
> >>     ADCSetMode(SINGLE_CONVERSION);
> >>     ADCSetChannel(0);
> >>
> >>     for (;;)
> >>{
> >>ADCStartConversion();
> >>while (ADCRead(&adc_value))
> >>    NutThreadYield();
> >>fprintf(uart, "%i ", (int) adc_value);
> >>     }
> >>}
> >>
> >>
> >>_______________________________________________
> >>En-Nut-Discussion mailing list
> >>En-Nut-Discussion at egnite.de
> >>http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
> >>
> >>
> >
> >
> >
> > _______________________________________________
> > En-Nut-Discussion mailing list
> > En-Nut-Discussion at egnite.de
> > http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
> >
> >
>
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
>
>





More information about the En-Nut-Discussion mailing list