[En-Nut-Discussion] ADCInit bug?

Tim Tait tim.tait1 at gmail.com
Fri Feb 17 19:20:33 CET 2006


If I don't call ADCSetPrescale( ) after ADCInit(), then the ADC does not 
return valid data. Yet ADCInit() includes a call to ADCSetPrescale(), so 
it should not be needed for the default prescaler of 64. I am  using 4.0.2.

Any ideas why?

Tim


    ADCInit();
    // NOTE: Due to apparent bug, ADCSetPrescale MUST be called after init,
    // even tho ADCInit calls it. The cause is not clear yet.
    ADCSetPrescale(ADC_PRESCALE_DIV64);    
    ADCSetRef(AVCC);
    ADCSetMode(SINGLE_CONVERSION);
    ADCSetChannel(ADC0);
    ADCStartConversion();
    ...




More information about the En-Nut-Discussion mailing list