A
@robert-hh This was a typo, i meant 100nF (ceramic capacitor with value 104) :-)
Yes, I understand that the firmware should not be of an issue, this was really strange and inconsistent.
Regarding vref_to_pin() call, at least for 10-20 secs the 1.1V output seems not to switch-off (i had a voltmeter connected permanently).
I am also suspecting issues with ground-cabling in the breadboard, but I hope the capacitor would deal with them.
Anyway, the thing is that I observed really large differences in the observed values when changing modules. For example for a 3.9V battery voltage using 3 different modules I got 3.9V, 3.7V and 3.6V.
I will re-run the tests and report again.
Thanks!