I'm working on a project which requires that I get repeatable adc readings to +/-5mV. I do call analogReadResolution(12) which should give me accuracy down to ~0.8mV. What I'm seeing though is up to 30mV of error.
Teensy is powered from a 9VDC wall wart -> 7805 -> Teensy Vin, and in software I use the measured Vin value instead of assuming it's exactly 3.3V.
I know with software I can correct for the inaccuracy, but that would require good repeatability. When I cycle power to the teensy, the measurement can change up to 50mV. This leads me to think the supply voltage is changing enough to screw up my measurements.
I came across this code for arduino and teensy 2.0 (assuming it will work on the 2.0 since they are all Atmel chips). http://hacking.majenko.co.uk/making-accurate-adc-readings-on-arduino
Would there be a way to get this code to work with the Teensy 3.0/3.1?
Teensy is powered from a 9VDC wall wart -> 7805 -> Teensy Vin, and in software I use the measured Vin value instead of assuming it's exactly 3.3V.
I know with software I can correct for the inaccuracy, but that would require good repeatability. When I cycle power to the teensy, the measurement can change up to 50mV. This leads me to think the supply voltage is changing enough to screw up my measurements.
I came across this code for arduino and teensy 2.0 (assuming it will work on the 2.0 since they are all Atmel chips). http://hacking.majenko.co.uk/making-accurate-adc-readings-on-arduino
Would there be a way to get this code to work with the Teensy 3.0/3.1?