Roff
Well-Known Member
Do you have plenty of power supply decoupling caps, and good ground planes? You should have, at minimum, a 100nF cap from each supply pin to GND on each IC (or circuit, when you go discrete). The fact that you get different answers with and without the AND gate implies to me that you need better decoupling and/or a pullup on your AND gate output (or a CMOS AND gate). Re-read my comments about logic levels.
Your LSB is only 20mV. Digital noise can easily be 10 times this. It is best to have separate analog and digital ground planes, with them connected to each other at one point only. I don't think this will work in the case where you are using the SAR outputs as the switches for the ladder network.
Since you are also using +5V for analog and digital purposes, you need to be sure that +5V is extremely clean (well-filtered/decoupled). It is the reference for your A/D and for your D/A.
From a noise standpoint, it would be better to have a separate analog +5V, with a D/A which does not use the outputs of the SAR as the switches for the ladder network, because the SAR puts a lot of undesirable current transients on the +5V supply.
Your LSB is only 20mV. Digital noise can easily be 10 times this. It is best to have separate analog and digital ground planes, with them connected to each other at one point only. I don't think this will work in the case where you are using the SAR outputs as the switches for the ladder network.
Since you are also using +5V for analog and digital purposes, you need to be sure that +5V is extremely clean (well-filtered/decoupled). It is the reference for your A/D and for your D/A.
From a noise standpoint, it would be better to have a separate analog +5V, with a D/A which does not use the outputs of the SAR as the switches for the ladder network, because the SAR puts a lot of undesirable current transients on the +5V supply.