I am using CodeVisionAVR C compiler. I wrote a C code ( from CVAVR ex.)
such this for Mega64:
unsigned char read_adc(unsigned char adc_input)
{
ADMUX=adc_input|ADC_VREF_TYPE;
// Start the AD conversion
ADCSRA|=0x40;
// Wait for the AD conversion to complete
while ((ADCSRA & 0x10)==0);
ADCSRA|=0x10;
return ADCH;
}
Using 8bit ADC but it's output is wrong.
when input voltage is below 0.6 volt outputbyte=0x00 !!!
and when input voltage is above 0.6 volt outputbyte=0xFF !!!
could anybody help me.
best regards
amerion
...........................................................
...........................................................
I FOUND ANSWER: The IC WAS BURNED.
...........................................................
...........................................................