efort
Posts: 15
Joined: Wed Jun 12, 2013 2:09 pm

Why were so many pins dedicated to power & gnd

Thu Jun 13, 2013 10:46 pm

I was looking over the P1 expansion header on the RPi. why are so many pins dedicated to and duplicated for power and ground? It seems this same connector could have been 20 pins instead of 26, or six more gpio pins could have been brought out from the cpu in the same space. heck, as a start, p5 could be eliminated completely and there'd still be only 24 pins in use with full access to all signals, both power rails, and ground.

what tradeoffs were chosen in the design to call for this apparent waste of pins? those extra pins had to increase cost even if only part of a pence per board.

Eben?

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Why were so many pins dedicated to power & gnd

Thu Jun 13, 2013 11:12 pm

As you've probably noticed the ground pins have been carefully placed near every GPIO I/O pin with exception for GPIO 9.
This is because when doing DIY GPIO work you may only require 2 to 4 in a row block and not the full 26 pins.
Having a ground pin nearby is quite handy since it removes the need for a single dupont cable just for the sake of ground wire or for multiple circuits with their own cables requiring a ground connection.

Richard S.

User avatar
johnbeetem
Posts: 945
Joined: Mon Oct 17, 2011 11:18 pm
Location: The Mountains
Contact: Website

Re: Why were so many pins dedicated to power & gnd

Fri Jun 14, 2013 6:33 pm

If the GPIO signals were all very slow, you'd only need one ground. However, whenever you have signals that change fast -- which is typically all digital IC pins nowadays -- those sharp edges require having very good ground connections or the edges will cause noise on other signals. A good rule of thumb for connectors is to have one GND or power line for every two signal wires.

When I got started in this biz, 74LSxxx TTL was very common. It had slow, smooth transitions so you didn't need lots of grounds. Modern CMOS drivers have very fast voltage transitions, which in turn cause very fast current transitions. Those rapid changes in current require good grounds or you'll have problems.

User avatar
solar3000
Posts: 1051
Joined: Sat May 18, 2013 12:14 am

Re: Why were so many pins dedicated to power & gnd

Fri Jun 14, 2013 7:23 pm

how fast are the GPIOs?
Antikythera

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12228
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Why were so many pins dedicated to power & gnd

Fri Jun 14, 2013 9:10 pm

fast enough so that bad grounding can be an issue, (for example the SPI port can go quite fast) but I think its true that the designer intended to group functionality together on the header with each function block having its own GND, so that a smarter connection system could be used than having to use a whole 26 pin band cable.

User avatar
solar3000
Posts: 1051
Joined: Sat May 18, 2013 12:14 am

Re: Why were so many pins dedicated to power & gnd

Sat Jun 15, 2013 1:31 pm

according to a search, I forgot which, its in the MHz range if written in c.
I just wrote a script to oscillate four 7-segment LEDs.
From looking at it I can guess its in the KHz range. You know what I mean? Persistence of vision and such? You just swing your eyes across and you see the individual LEDs lit, but if you stare strait on they all look like they're solidly lit.
Antikythera

User avatar
johnbeetem
Posts: 945
Joined: Mon Oct 17, 2011 11:18 pm
Location: The Mountains
Contact: Website

Re: Why were so many pins dedicated to power & gnd

Sat Jun 15, 2013 7:51 pm

solar3000 wrote:according to a search, I forgot which, its in the MHz range if written in c.
I just wrote a script to oscillate four 7-segment LEDs.
From looking at it I can guess its in the KHz range. You know what I mean? Persistence of vision and such? You just swing your eyes across and you see the individual LEDs lit, but if you stare straight on they all look like they're solidly lit.
It's not the data rate that causes ground noise. It's how fast GPIOs switch between high and low, i.e., how fast the signals transition in volts per nanosecond. You could have ground noise problems with a 300 Baud line if the bits change fast enough.

I once read about the "Frito Effect" where if you look at multiplexed LED display and bite down on something crunchy like a corn chip (or crisp?), your head vibrates enough so it looks like the digits are bouncing around.

User avatar
solar3000
Posts: 1051
Joined: Sat May 18, 2013 12:14 am

Re: Why were so many pins dedicated to power & gnd

Sun Jun 16, 2013 1:37 am

I take it you would need an oscilloscope to see this.
Antikythera

User avatar
johnbeetem
Posts: 945
Joined: Mon Oct 17, 2011 11:18 pm
Location: The Mountains
Contact: Website

Re: Why were so many pins dedicated to power & gnd

Sun Jun 16, 2013 3:56 am

solar3000 wrote:I take it you would need an oscilloscope to see this.
Definitely need a 'scope to see ground noise problems. In many cases, you need a very fast 'scope (1G sample/sec or faster) and active probes. Passive 'scope probes can filter out subtle signals so you can't see them, and in some cases filter the circuit well enough to make the misbehavior go away.

User avatar
Burngate
Posts: 6009
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Why were so many pins dedicated to power & gnd

Sun Jun 16, 2013 9:50 am

johnbeetem wrote:... I once read about the "Frito Effect" where if you look at multiplexed LED display and bite down on something crunchy like a corn chip (or crisp?), your head vibrates enough so it looks like the digits are bouncing around.
Same effect with CRT monitors and ginger nuts.

User avatar
solar3000
Posts: 1051
Joined: Sat May 18, 2013 12:14 am

Re: Why were so many pins dedicated to power & gnd

Sun Jun 16, 2013 11:47 am

johnbeetem wrote:
solar3000 wrote:I take it you would need an oscilloscope to see this.
Definitely need a 'scope to see ground noise problems. In many cases, you need a very fast 'scope (1G sample/sec or faster) and active probes. Passive 'scope probes can filter out subtle signals so you can't see them, and in some cases filter the circuit well enough to make the misbehavior go away.
Which scope do you use?
Antikythera

User avatar
johnbeetem
Posts: 945
Joined: Mon Oct 17, 2011 11:18 pm
Location: The Mountains
Contact: Website

Re: Why were so many pins dedicated to power & gnd

Sun Jun 16, 2013 1:36 pm

solar3000 wrote:
johnbeetem wrote:
solar3000 wrote:I take it you would need an oscilloscope to see this.
Definitely need a 'scope to see ground noise problems. In many cases, you need a very fast 'scope (1G sample/sec or faster) and active probes. Passive 'scope probes can filter out subtle signals so you can't see them, and in some cases filter the circuit well enough to make the misbehavior go away.
Which scope do you use?
Tektronix has a number of 'scopes suitable for this sort of signal, but they're very expensive. For example, 2.5 to 5G sample/sec with 500MHz to 1 GHz bandwidth starts around US$10K list price for TDS, DPO, and MSO series. Active probes now list for more than US$1K each. These are affordable for companies where the 'scope pays for itself quickly by letting engineers see signals they couldn't see before. There are cheaper 'scopes from other vendors but my experience has mostly been Tek. Also, a particular ground noise problem may not need anywhere near that bandwidth and you can get by with a much cheaper 'scope.

If you can't afford a high-end 'scope, your best bet is to use good design practices like having a ground or power line for each pair of signals to prevent the problem in the first place.

User avatar
solar3000
Posts: 1051
Joined: Sat May 18, 2013 12:14 am

Re: Why were so many pins dedicated to power & gnd

Sun Jun 16, 2013 10:20 pm

huh? I can get one at an affordable $10000USD? And THEN I have to buy $1000USD probes?
That's the price a sub-compact car!

$35USD for a RPi, $10000USD for a scope! :o

How about a scope for under $200USDs?
What about an old vacuum tube scope?
That I do have.
Antikythera

User avatar
johnbeetem
Posts: 945
Joined: Mon Oct 17, 2011 11:18 pm
Location: The Mountains
Contact: Website

Re: Why were so many pins dedicated to power & gnd

Mon Jun 17, 2013 6:35 pm

solar3000 wrote:huh? I can get one at an affordable $10000USD? And THEN I have to buy $1000USD probes?
That's the price a sub-compact car!

$35USD for a RPi, $10000USD for a scope! :o

How about a scope for under $200USDs?
What about an old vacuum tube scope?
That I do have.
It's "affordable" for a reasonable-size company. Not so much for an individual. Also, those are list prices from the Tek web site, and you can get discounts and used equipment by shopping around.

If the ground noise problem is bad enough, you can observe it on any scope. In this particular discussion, we're talking about RasPi GPIOs which have plenty of power and ground pins so you're not going to see a problem that isn't there.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12228
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Why were so many pins dedicated to power & gnd

Mon Jun 17, 2013 7:59 pm

ground (bounce) problems most often become an issue if you have long wires without a corresponding ground wire, and you are controlling some kind of latch or register, which is the case with I2S, but already also with SPI and even I2C, or something homegrown with shift registers. :D
ist not the speed of the signal, its that reflections may cause false triggering. In very bad cases you may also need termination resistors.

()blivion
Posts: 4
Joined: Tue Jun 18, 2013 7:41 am

Re: Why were so many pins dedicated to power & gnd

Tue Jun 18, 2013 8:48 am

The systems IO is fast enough that termination and signal propagation needs to be cared for. Having lots of ground wires between pins helps with crosstalk as well as gives engineers a way to easily realize a characteristic impedance for making transmission lines.

From what I have seen, the GPIOs can go at just around 10Mhz with C. Probably a bit higher with hand coded ASM. However, at some critical speed, you wouldn't be able to do anything other than flip the pins, the GPIOs do not have a data buffer of any kind that I know of, so the CPU would have to hold the GPIO's hand constantly. I haven't used the SPI yet so I wouldn't know what that can do, but the specification is not limited to any particular speed... so it could be anything. And the SPI peripheral does have at least one buffer, the output shift register. Considering the Pi is primarily a non realtime system (media platform, not control), it should have tons of IO buffering honestly.

OP's complaints seem more political than technical, so this is mostly irrelevant to the topic. But if one was worrying about this because they wish they had more usable pins they could work with, the two flex cable connectors and the P5 header have a few extra. Also, demultiplexers, shift registers, and/or microcontrollers can expand pins many fold. 100+ pins isn't unreasonable like this, though expect a proportionate drop in speed.

BTW, having lots of power wires helps with current if you are powering the Pi through the header... as I am.

efort
Posts: 15
Joined: Wed Jun 12, 2013 2:09 pm

Re: Why were so many pins dedicated to power & gnd

Tue Jun 18, 2013 10:23 pm

()blivion wrote: OP's complaints seem more political than technical, so this is mostly irrelevant to the topic. But if one was worrying about this because they wish they had more usable pins they could work with, the two flex cable connectors and the P5 header have a few extra. Also, demultiplexers, shift registers, and/or microcontrollers can expand pins many fold. 100+ pins isn't unreasonable like this, though expect a proportionate drop in speed.

BTW, having lots of power wires helps with current if you are powering the Pi through the header... as I am.
()blivion wrote:
OP's complaints seem more political than technical, so this is mostly irrelevant to the topic. But if one was worrying about this because they wish they had more usable pins they could work with, the two flex cable connectors and the P5 header have a few extra. Also, demultiplexers, shift registers, and/or microcontrollers can expand pins many fold. 100+ pins isn't unreasonable like this, though expect a proportionate drop in speed.

BTW, having lots of power wires helps with current if you are powering the Pi through the header... as I am.
Actually some of each.....

There apparently are claimed technical reasons for the multiple grounds (but what about the reasoning for 3v3 & 5v more than one place....) but it's been my experience thus far and with the on board connector being male rather than female that to really use this expansion you need to jumper all 26 pins over to a breadboard anyway where you just end up having rails for this sort of thing. actually I've learned that a single common ground point is better in most cases as it avoids ground loops and other common (ok, bad pun...) problems! just figured I'd ask what the tradeoffs were in the design. Not really complaining more just why certain tradeoffs observed and wondering what lead to those. I understand grouping things into functional groups but when those groups are still on the same header and the same cable duplicating common functions between them just never made sense to me, that's all.

User avatar
jbeale
Posts: 3494
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Why were so many pins dedicated to power & gnd

Tue Jun 18, 2013 11:32 pm

My understanding was that some of the power/ground pins were actually essentially placeholders for a future possible revision which might have brought out more GPIO pins. They were not able to route more than what you see, on Rev 1. Later on Rev.2 they managed a few more, but decided on an addition connector, instead of using the existing redundant power/ground. Of course more grounds are always useful at high speed, in fact SPI can be configured to run at a 150 MHz clock speed. No one has yet demonstrated that working to my knowledge. 32 MHz is as high as I've seen SPI reported working, limited by the speed one particular LCD TFT panel would accept.

By the way, the entry-level 2-channel Rigol digital oscilloscopes start under $500, probes included, with 100 MHz analog bandwidth and 1 Gig sample/sec. Check out the Rigol DS1102E listing at $399 here: http://www.rigolna.com/products/digital ... e/ds1102e/

()blivion
Posts: 4
Joined: Tue Jun 18, 2013 7:41 am

Re: Why were so many pins dedicated to power & gnd

Wed Jun 19, 2013 2:55 am

There apparently are claimed technical reasons for the multiple grounds (but what about the reasoning for 3v3 & 5v more than one place....)
Again, in different words, having multiple power pins allows for more current than one single pin could handle. Lower resistance.

If you look at the pinout of any modern PC CPU or similar, you will see that something between one and two thirds of the pins are for power and ground. The reason is that at only ~1.5 volts, the amount of current needed to reach 100+ watts would be about 66 amps. To put that into perspective, some welders have settings for 40 amps and can still get the job done. So you need a lot of pins to prevent things from melting.

Return to “General discussion”