i want 10 bit precision of ADC with my code below.but the problem is that the result does not change Continuously while i change the voltage continuously with two Precision potentiometer.
do you konw what i mean??
for example :
now ADCL is 0x56.i turn the potentiometer slowly, but ADCL doesn't change immediately .i keep turning, suddenly ADCL changes to 0x60,then 0x62,then0x63,then0x71;it can't be 0x57,0x58,0x59,0x61...........
i hope someone can help me!! thanks a lot first .
this is my code:
#include<iom16v.h>
unsigned long angular,adth,adtl;
unsigned char count=0,adjok=0;
unsigned long speed=0;
unsigned long temp;
adinit()
{
ADMUX=0xc0;
ACSR=0x80;
ADCSRA=0xc8;
}
uinit()
{
UBRRL=51;
UCSRB|=0x88;
SREG|=0x80;
now ADCL is 0x56.i turn the potentiometer slowly, but ADCL doesn't change immediately .i keep turning, suddenly ADCL changes to 0x60,then 0x62,then0x63,then0x71;it can't be 0x57,0x58,0x59,0x61...........
What you didn't mention was: You saw the value changing with the voltometer and this value didn't match the ADC value? Or you turned the potentiomemeter, you didn't see changes and you assumed that the voltage changes but the ADC does not follow? And what do you mean by "precision potentiometer"? Because if you are talking about multiturn, then it "tries" to be linear but it can't manage it all the time. It is like "hoping" from one resistor value to another, I have seen this, that's why I'm asking about the way you did your experiments.
Sudden increase or decrease may happen if your power supply is not proper. There are some other factors which affect the adc is filtering. (i.e. long wires from potentiometer).