hackrid wrote:seems like the built in adc samples with 8 bit resolution.
some over sampling magic is applied to get 10 bit resolution.
my guess: ADC samples with 4MSamples/s. not certain about that.Code: Select allread_sar_dout(sardata);
for (i = 0; i < 8; i++) {
sar_dout += sardata[i];
ADC_DBG("%d, ", sardata[i]);
}
tout = (sar_dout + 8) >> 4; //tout is 10 bits fraction
That isn't oversampling at all. A right-shift by 4 positions equals a division by 16. But only 8 samples are added together in the loop right before that. That's rather strange code. If the result has 10 usable bits, then the ADC must bee 11 bits.
Greetings,
Chris