Mixed Signal Layout with Microcontrollers

Discussion in 'General Electronics Chat' started by jwilk13, Sep 26, 2011.

  1. jwilk13

    Thread Starter Member

    Jun 15, 2011
    Hey all,

    I came across a thread here just a few minutes ago dealing with mixed signal PCB design, and a question popped up. I'm familiar with the concept of "partitioning" the analog and digital ground planes such that they are separated by the ADCs (but still connected, like image shown), but I'm wondering how you would do something like this with a microcontroller.

    Most of the designs I work on deal with microcontrollers with built-in ADCs, usually in a 44-pin TQFP package. Would the goal be to place the analog inputs on one side of the chip and all digital I/O on the other, keeping it separated similar to the image shown?

    Some other questions:
    1) How would you go about characterizing something as "analog" or "digital" when dealing with a microcontroller? For example, the outputs are classified as "digital" in the datasheet, but are they not an analog voltage in reality?

    2) When does it become necessary to take mixed signal layout into consideration?

    I've done some reading on the subject, but I'm still unclear on a lot of stuff, as you can see. Any info would be great. Thanks!

  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011

    It's usually not as simple as picking a "side" for digital and analog, as you'll usually find pins needed here go there and vice versa. Some larger micro controllers do have seperate analog and digital supply pins which d make partitioning easier.

    While it is true a digital pin has an analog voltage the important difference between "analog" and "digital" circuitry is noise immunity: you can dump a half volt or more of signal into a digital input and not affect the output; try that in an analog amplifier and your output is a mess containing all that noise.

    One way to look at sectioning is to divide the circuit up into functional blocks, that may be as much as every separate IC or transistor, or each group of common functions.

    Now either draw or imagine a resistor in series with the power into and out of each block: that's your wiring resistance and such as no connection is perfect. Try to visualize what would the effect of a "bounce" of voltage across those resistors be due to a change in the current used by that block.

    One simple circuit I did that took two spins of the PCB was a micro and an amp: the micro drove a transducer, and the amp looked at the return signal on that transducer. As it was a tiny return signal it was an amp with a gain of 1,000. The second spin required just moving where the transducer connected back to ground, just moving the placement of the conductor got it closer to where the power came in and thus kept the ground bounce out of the amp. In that case, a little bounce made a big signal that took a very long time to die out, and I would miss my return.

    An "ideal" case would be each part/section having it's own supply or return path back to one point that is the power input. That's a "star" connection. However, that is usually not practicable nor entirely necessary. If you can section all the "digital" and "analog" apart, then join them at one point you usually have all you need (until one analog thing disturbs another, or...).
  3. jwilk13

    Thread Starter Member

    Jun 15, 2011
    Thanks Ernie, helpful as always :)

    From things that I'm reading, it sounds like when people refer to "analog" devices they're typically talking about amplifiers of some sort.

    I'm thinking about all this stuff because I just designed a circuit with a microcontroller, a couple of linear voltage regulators, some resistors (used as voltage divider circuits to provide analog inputs to the uC), capacitors, and a high-side switch, and I'm not sure what qualifies as "digital" and "analog" and if it requires close attention to their grounds. None of the components have separate pins for analog and digital ground like an ADC would.

    Also, the above-mentioned circuit works fine on a proto-board with all the grounds connected to the common supply line and no real strategy to layout. I'm sure things change when it comes to the PCB though. When thinking about analog circuits as ones in which current or voltage vary with time to convey information and digital circuits as discrete values, the only analog portion of my circuit that I can think of would be the resistive voltage dividers being used as analog inputs to the uC.