i created a custom pcb whit sam D21 mcu. I connected the Aref pin to GND via the 0,1uF capacitor and the VDD_ANA(analog VCC) via a ferrite bead (100 Ohm) to VCC, whit 2x capacitor(0.1uF, 10 uF) to GND for bypass. I use internal 1V reference in 12bit mode. But the analog readings are jumping from 157.4mV to 162.1 mV and all in between. I also made sure that there is big ground plane under all analog pins and connections on the PCB.
At same time i am checking values whit oscilloscope and the value is sitting steady at 162.8mV(+/-0.1mV).
I use op amp in buffer configuration at analog entrance to prevent my pcb effecting the value that i measure. I also measured whit scope the analog output of op amp, and also the analog input on mcu and all voltages are steady, so i assume something goes wrong inside the MCU.
Any idea what could be the cause of fluctuation in analog reading?
P.S. I also tried addind input capacitor on analog input side to stabilize reading but it had no effect on it, so now im 99% sure it is the problem in MCU.
P.S.2. So far i did improve whole thing by averaging 200 analog readings so now the value is fluctuating from 162.1 mV to 162.8 mV. So it is better and the averaging process takes only few milliseconds so it is not a big problem. But if anyone has idea on how to stabilize reading even further, i am open for suggestion :D