The stuck-bits function is misleading in another way. It really only finds a stuck-high condition. It was written when I was seeing all sorts of junk coming out of the ADC, and probably should just be deleted (or totally reworked), now that the ADC timing problem has been addressed.With maybe three attempts at this, I wired up the ADC board. I have no input, just the 10K resistor to ground. I get an average count of 15. I need to modify stuff to get more info. No stuck bits. Was going to short the input, but my laptop just froze and turned off. Will have to run this on my RPI. I have no idea why my laptop just quits, but it's aggravating as all get out. It's something to do with USB. The system leaves no messages, it just turns off.
On the air again with my RPI. Grounded input. "Avg # bits = 9". RMS variation 0.936. Very good for not having done any changes to the board. That should not be bits. It's the average digitized value, that would be counts. So a hair over 3 bits. I didn't rework the capacitors, or add any grounding. This is just the board as received and populated.
As time goes on, the average count has increased, even with a grounded input. Now hovering around 14 counts, just shy of 4 bits. I have unplugged many unneeded power supplies, and it seems the same.
I believe there is a bug with commonbits only being initialized at the start of loop. If I put the same statement, at the start of the commonbits loop, I get no stuck bits. Without it, in a loop once it is set, it is perpetually set. At the moment, I can't see much difference in average count between running at an apparent 200KSPS or 1MSPS.
DC offset, but at least it's noise like.
It appears you are getting something around 13 counts on average. That translates to a Vos around 0.5mV. Not too bad!