16

In the following pinout diagram for an ATtiny26 microcontroller, a 20-pin IC:

ATTINY26 pinout diagram

The VCC/AVCC and GND pins aren't aligned. Surely it would be easier for PCB design to connect these by going straight across rather than having to cross (requiring vias, a second layer, or complex routing).

Why would these pins be switched as so?

JYelton
  • 32,302
  • 33
  • 134
  • 249

2 Answers2

31

One very good reason, as I learned myself from a recent prototype, is reversing the physical layout of the IC in a circuit.

I plugged a through-hole version of this microcontroller into a socket backwards, and spent about an hour with an oscilloscope trying to determine why pins were not behaving as expected.

When I discovered the IC was in backwards (and recovered from the desire to shoot myself), I realized I was thankful that a polarity reversal hadn't rendered the IC useless. With the pins backwards in this arrangement, the chip actually receives VCC and GND correctly in both directions.

In IC's with VCC on pin 1, and GND on the opposite corner, they heat up and generally fail very quickly when inserted backwards.

JYelton
  • 32,302
  • 33
  • 134
  • 249
  • 18
    Which means you find the problem immediately, instead of wasting an hour! ;-) –  Jun 16 '13 at 09:55
  • I had the same problem some months ago. An hour rolling back commits in git only to find out the IC was backwards. – Vorac Jun 18 '13 at 10:58
  • Interestingly, I too made mistake by attaching 5v power supply on the wrong side of breadboard and noticed only it's green LED on supply lost it's brightness... ATTiny26 survived almost a minute of wrong polarity! – Roman Susi Sep 07 '13 at 18:41
8

While noone but Atmel designers can say for sure, but one of the reasons the pins are switched is exactly to highlight they are different. VCC and AVCC are different, as well as GND 6 and GND 21, which is technically the AGND. They are not intended to be two redundant pins. By offsetting them from each other, it makes PCB designers rethink what they are doing if they simply tied them together for convenience. From the ATTINY26 datasheet:

enter image description here enter image description here

Some other Atmel parts explicitly reference the second ground pin as AGND (ATTINY 87, 167, 261, 461, 861)

While the unexpected benefit of the offset pins is that it prevents frying the chips if inserted incorrectly, I highly doubt that is a high concern in any industrial manufacturing process. If anything, if an output high on the left side is suddenly an connected directly to ground on the right side by mistake, you would have the same problem.

Passerby
  • 72,580
  • 7
  • 90
  • 202
  • 2
    +1 I realize that the AVCC and AGND are technically different from the VCC and GND opposite them and thus aren't intended to be redundant connections. They happened to have an interesting consequence of inserting the chip wrong. This definitely provides additional detail on the pin arrangement. I'm not sure that it's solely to force PCB designers to "rethink" what they're doing though. It's probably a variety of reasons. – JYelton Sep 25 '13 at 22:53