Robert
Robert
You're welcome! The board by itself doesn't allow to use different clocks. It's 16MHz by default. I just switched the crystal oscillator in mine to 20MHz, since I had to...
Sure it does enhance the resolution. For example, for ADC_OVERSAMPLE_BITS=2, for a single analog read, first it generates additional 4 bits of data by collecting 16 samples into the accumulator....
Actually, best have a look at [the code](https://github.com/Traumflug/Teacup_Firmware/blob/tronxy/analog-avr.c#L15-L121). This technique actually needs a bit of white noise to work. It's probabilistic. Imagine the raw ADC provides a resolution of 5mv...
There's only a single shift. Unless I'm not seeing something... look at [the line 92](https://github.com/Traumflug/Teacup_Firmware/blob/tronxy/analog-avr.c#L92) - that should be the only shift.
Oh, you're right! That's for the AD595 sensor, which I simply overlooked :) The code was meant for and tested for thermistors
I mean, originally it was `temp = (temp * 500L) >> 8;` Since I'm adding ADC_OVERSAMPLE_BITS, then I figured it should be shifted by (8 + ADC_OVERSAMPLE_BITS), instead of 8....
First, config_wrapper.h is #included in analog.c, which in turn includes analog-avr.c. And analog-avr.c seems to do anything only when included from analog.c. So this is fine. The second shift shouldn't...
You could say so. I meant to change the maxAdc setting each time in configtool's options, but that's a poor solution, obviously. I'll try and add adjusting maxAdc based on...
Actually, the formula for AD595 was correct - and oversampling would improve its accuracy. At first oversampling seems useless for this formula, but let's not forget we're dealing with integer...
Sure, you need 12-bit temperature tables. I made a quick-and-dirty fix for that, and I'm using it myself. I'll refactor it into a proper solution integrated into the configtool.