common ground point for analogue/digital?
[taken from PIClist]
This is the best
discussion I have seen of why a common ground point for mixed
analogue/digitial circuits is needed. It is particularly relevant for
PIC micros that
use radio chips - Shane.
Current flowing through wiring will develop voltage drops that shift
supposed "ground" reference to something other than the desired
The problem is not
just an analog versus digital problem. It can rear its ugly
head in almost ANY analog circuit, and can even wreak havoc in an all-digital
circuit. It is, however, particularly prevalent in mixed analog/digital
Ground wires serve
two different functions. Sometimes they are used to carry
currents. At other times you want the ground to serve as a rock-solid
point for making precision measurements. This is especially true in
with more than 8 bits of desired resolution.
The best way to
handle the ground problem is to have different ground systems
that connect at only one point. The precision analog REFERENCE ground
always be designed so that an absolute minimum of current actually flows
it. In practice this is accomplished by having all reference ground
terminating at a SINGLE POINT.
Firstly, all MEASUREMENT
ground connections should use individual traces that
converge at a single REFERENCE POINT. The idea is to not allow any current
through one reference trace to affect any other reference trace. What
to avoid is having one long trace that snakes all over the board, with
different ground connections being made at differnt points along this
currents will add up, causing differnt voltages to appear along the
is bad news.
Secondly, all GROUND
POWER supplied to the analog section should use another
ground system. This ground system should have a single connection to
REFERENCE ground point.
Thirdly, a COMMON
ground connection to any major DIGITAL GROUND system should
ALSO be made to the single REFERENCE ground point.
If properly constructed,
the REFERENCE ground point becomes a nice rock-solid
point from which measurements can be made. It will be COMMON to all
grounds, but this common connection should NOT itself experience any
flow. Or at least the current flow should be absolutely minimal.
In extremely noisy
systems the analog section may be floated or isolated from
other sections. In this case data is communicated from one section to
via opto-isolators, transformers, or using other isolation techniques.
isolation is also desired in medical systems where even small currents
great damage to a patient.
The tendency when
laying out a printed circuit board is to just run a ground
trace around the board and have all kinds of things attach themselves
running ground. But if you desire precision measurements you MUST have
precision reference POINT to which ALL measurements are referenced.
Fr. Tom McGahee
I've seen it mentioned
here a few times about "seperating" the digital and
analog ground plains from each other.
eventually has to be connected to the same common ground
somehow (at least in my circuit), how exactly is that done? I mean,
how does one
keep the digital signals from getting mixed into the analog ground plane?
signal diode, a cap? An example diagram (draw me a picture ;-), or a
URL to a
page/circuit that outlines that would help.
Sorry for the stupid
question, I've never had to worry about this in my little
Not stupid - this
is a basic problem when mixing analog and digital. Less
important for slow signals and low sampling resolution [ie, 8-bits].
important for faster signals, high-sensitivity [ie, less a few mV],
resolution [ie, = 12 bit sampling].
The general solution
to successfully mixing analog and digital probably doesn't
exist, but everyone has a dozen or so partial solutions, and there are
long" threads about this on piclist - if you can find them. This
whole area is
probably more art than science.
Digital Design" by Howard Johnson is one place to look.
The basic idea to
separating digital and analog grounds is simply just that -
keep them physically and electrically separate from one another all
circuit, and tie them together at ONE point only - at the place where
comes onto your board. This point usually has wide traces with low impedances
[meaning the digital currents will devleop relatively low noise signals
Vnoise = Idigital * Z]. Also, a "one-point" connection helps
loops. Think of the various grounds emanating from that point kind of
legs of an octopus. That is the common solution.
OTOH, if you look
at the datasheets for various high-performance A/D converters
[downloadable from National Semi, Linear Tech and Maxim], you will see
them recommend making the "one-point connection" directly
under the A/D itself,
which is usually not at the power insertion point of the board. So this
goes against the common solution just described.
This being said,
however, does not mean that simply separating the gnds is going
to magically make your analog circuitry noise-free. This is not a stupid
trivial problem by any means - and many engineers spend their entire
trying to figure it out -[and some are still working in it - he, he].
hope this helps,
- dan michaels
Okay, I guess that
"leads" me to another question or two. How should I tie in
the 2nd ground pin on an F876? And why is it even there for that matter?
just going to connect it to the other ground pin by running a trace
the part between them.
First, you have to realize that this is EE, and not CS, and there is
a lot of
art and black magic here [as Johnson mentions in his book], and that
seems to have a different experience and opinions with this stuff. There
probably no one true answer, regarding pcb layouts/etc.
Some people think
one of those gnds is for analog and the other is for digital,
and should be used that way. However, I just measured several chips
with my DMM,
and got about 2 ohms between the gnd pins - which is actually same reading
between the 2 Vdd pins. So looks like they are simply tied together
chips. Personally, I always use a pcb trace between them. (see next
message - Ed.)
I spoke briefly with one of the Microchip fellows in Arizona, and he
confirmed that the ground pin next to the port A pins is used internally
in a way that is much closer to the A/D converter, and is thus meant
be the analog ground.
The issue was never
that important with the 8 bit converter, which Dr.
Seuss could make work. The issue will become more and more important
with 10 and especially 12 bit converters in the 873, 773 and others.
The important thing
to remember is reference point. If the octopus
leaves the analog pin on the converter, and the signals are all
referenced to that point, and extraneous currents are not expected to
pass through the net to the digial side, then I predict that you will
have arrived at electron narvana. The last piece of the puzzle, if you
have a ground more like a tree of branches, is where to link in the
I had a design with
lots of real high gain low noise stuff on it, in
addition to a whole raft of A/D and D/A and a PC104 processor. The
first design worked like shit. The digital noise was crushing the
signals. We then made two seperate boards, one for analog and one for
digital. Seperate supplies. And optos for digital signals, and coax
with differential recievers for analog signals. The results were
breathtaking. The digital noise was nearly absent, and the final result
was an A+. I know that this is an extreme example, but just consider
doing some of these things on the board itself. Seperate ground
planes. Seperate regulators for analog and digital. Deliver signals
differential and use an IA at the receiver.
This all presumes
you have identified a real fault to begin with. If
you run the converter without a software filter, and put a fixed input
to the front end, and display the value, if properly done you should
able to sit on a bit. Some assume that if you add a software filter,
who cares about 4 bits of noise? This is a lazy approach to the
problem, especially when the answer is a change in the pattern on the
Also, I never used
anti alias filters before, as I always said that none
of my signals had frequencies over the sample rate (/2). I was
mistaken. I have no initial sources of higher frequencies, but after
adding power supply noise, opamp noise, thermal noise, resistor noise,
and noise of my kids playing in the background, do not be suprised to
find 3 bits of noise on your signal. Just put a Salen Key in front of
your A/D. You will be impressed with the lack of noise. This method
especially important when you have 12 bits or more.
There is no short answer to this. You need to analyze what current circulates
between the various chips (computer programs for this really analyze
EACH wire -
but they are out of reach for amateurs), and make sure that this current
'closed' through a ground (and/or) power line such that it cannot upset
circuits. This cannot be achieved in practice (except if you only have
or a completely star-wired power grid).
So there is a compromise
made between reality and theory, and all the digital
grounds are tied together, and all the analog grounds are tied together,
a single ground point, and these two are tied together at the ground
to the circuit. This requirement can place the ground entry point under
(common in A/D and RF applications). Sometimes designers play more tricks
the grounds (esp. the analog grounds). These are special cases that
lead to lower fiability (if the analog and the digital gnd on a chip
develop some potential difference - usually 0.6V or less - then the
If your project
is MP3 or high end audio related you can use the ground-under-
the-chip approach and feed the PSU (or battery) ground exactly there.
it's in the middle of the board ;-)
This is one of those points with multiple opinions. As I mentioned,
think this gnd pin is for your analog signals. OTOH, you have Dave's
my case, I have always used a small gnd trace "island" encircling
my xtal and
bypass caps, which I have always tied to this gnd, and my analog circuitry
[opamps/etc] has a separate gnd trace that goes striaght back to the
injection point on the board.
can see that this violates the idea of having a short noise-
free gnd connection from the analog circuitry to the A/D converter [in
on the PIC] with a single-point gnd connection between analog and digital
the A/D. It seems you cannot have it both ways :).