I want to use an ATmega32 ADC in its 4 channel single-ended mode to convert four analog signals into digital (one at a time). I have written the C code but what I cannot figure out is what I should do with the ground pins of those four analog signals. Should I common them and connect to the controller ground? Also why are there two ground pins in the ATmega32 (11 and 31) - is one of them an analog signal ground?

  • \$\begingroup\$ Can I have a look at your program? \$\endgroup\$
    – user23384
    May 2 '13 at 14:19

The ground side of the incoming analog signals needs to be connected to the ground of the microcontroller.

Multiple ground pins on a microcontroller very conveniently allow greater current load to reach ground with reduced pin impedance (by paralleling): For instance, if a microcontroller can sink 40 mA per GPIO pin, and has a total current limit of say 200 mA, then if 4 or 5 of those GPIOs are sinking current at any given time, that amount of current would necessarily have to reach circuit ground through a single ground pin of the microcontroller.

Adding a second, sometimes third or fourth ground pin allows this cumulative current load to reach ground distributed through multiple pins. No one pin gets overloaded or heated up, the load gets distributed.

An added benefit of multiple ground pins is convenience in routing on tightly packed boards - ground traces do not need to wriggle between other pins to "get to the other side". While this practice of having disconnected ground traces is frowned upon, sometimes it is just the way it's done, for convenience or out of necessity.

Some microcontrollers and other ICs also have different types of ground, such as Analog Ground and Digital Ground, explicitly named as such. There the purpose is different: The Digital ground is used as the "common" pin(s) for all digital signals, while the Analog ground is the common pin(s) for all analog signals.

  • \$\begingroup\$ Thanks that was very thorough but are the two grounds of atmega32 are alanalog ground and digit or are they the same digital ground?because the pin label only says GND \$\endgroup\$ Apr 28 '13 at 2:21
  • \$\begingroup\$ They are the same. \$\endgroup\$ Apr 28 '13 at 3:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.