mahm150
Full Member level 1
- Joined
- Dec 14, 2010
- Messages
- 98
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,288
- Location
- Cairo, Egypt, Egypt
- Activity points
- 2,001
this message appear in proteus ADC result lost due to pending read
#define ADC_VREF_TYPE 0x40
ADMUX=ADC_VREF_TYPE;
ADCSRA=0x82;
i use this function
unsigned int 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);
delay_us(100); // make this delay but not solve this problem
ADCSRA |=0x10;
Tadc=(Tadc<< 8)| ADCL;
return ADCW;
}
#define ADC_VREF_TYPE 0x40
ADMUX=ADC_VREF_TYPE;
ADCSRA=0x82;
i use this function
unsigned int 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);
delay_us(100); // make this delay but not solve this problem
ADCSRA |=0x10;
Tadc=(Tadc<< 8)| ADCL;
return ADCW;
}