User avatar
gordon@drogon.net
Posts: 2020
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: GPIO - Wiki wrong?

Fri Apr 27, 2012 8:48 am

GizmoB73 said:


GordonH said:


I think we're all sorted now - I was initially thrown by starting at GPIO 7 which doesn't appear to work (at least on my Pi - anyone?) I'm suspecting it has to be re-programmed to be used as genera purpose.


If when you are referring to GPIO 7, what you mean is P1-07 then mine works when I refer to it as GPIO4 on the BCM2835.  I have had it happily switching an LED on and off.



Heh.. Here we go again - what port is what pin is what ever

By GPIO7, I'm meaning the GPIO7 pin mentioned on the Wiki page. It's pin 7 on the connector (4th down on the left/bottom).

It's labelled GPIO_GCLK on the schematic and connected to GPIO4 on the BCM2835.

So yes, the same port as you.

Hm. Your works and mine doesn't. I'm using the latest Debian image, what are you using? I'm wondering if it's pre-programmed in a different mode in this image, or maybe I've just blown it!

I've a 5-hour train journey this afternoon - maybe I'll play with it then...

Gordon
--
Gordons projects: https://projects.drogon.net/

GizmoB73
Posts: 80
Joined: Fri Jan 27, 2012 12:51 pm

Re: GPIO - Wiki wrong?

Fri Apr 27, 2012 8:58 am

GordonH said:


Hm. Your works and mine doesn't. I'm using the latest Debian image, what are you using? I'm wondering if it's pre-programmed in a different mode in this image, or maybe I've just blown it!
I've a 5-hour train journey this afternoon – maybe I'll play with it then…

Gordon


I am using the latest debian image too.  If you want I could always send you a compiled version of my simple app that will just toggle that pin high and low at one second intervals as per my sample code.  It would just verify that your hardware is OK.  PM me your email address if you are interested.

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

Re: GPIO - Wiki wrong?

Fri Apr 27, 2012 10:02 am

I've just come across this thread, and though I've only skimmed most of it, it seems to be based on the diagram on the wiki.
So could I, first, apologise? Most humbly so.
When the GPIO pin-out was first published, I knocked up that drawing, just as a first effort. Since then, we've been given more info, and the consensus seems to be that a more rational labeling would be good. I tried with a better diagram, but I don't know how to change the wiki!
So if you'd like it changed, and know how to do it, my other drawings (and some other stuff) are at
https://sites.google.com/site/burngateh ... e/drawings
Or, of course, draw a better diagram yourself!

User avatar
Dave_G_2
Posts: 196
Joined: Sat Apr 14, 2012 7:04 pm

Re: GPIO - Wiki wrong?

Fri Apr 27, 2012 10:17 am

@Burngate

Nobody is having a go at you personally and are simply pointing out that the wiki is wrong.

Whether it's because it was originally done wrong or more info has come to light since it was first knocked up is not important.

What is important is that with the new info it can now be rectified.

User avatar
gordon@drogon.net
Posts: 2020
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: GPIO - Wiki wrong?

Fri Apr 27, 2012 10:18 am

Burngate said:


I've just come across this thread, and though I've only skimmed most of it, it seems to be based on the diagram on the wiki.
So could I, first, apologise? Most humbly so.
When the GPIO pin-out was first published, I knocked up that drawing, just as a first effort. Since then, we've been given more info, and the consensus seems to be that a more rational labeling would be good. I tried with a better diagram, but I don't know how to change the wiki!
So if you'd like it changed, and know how to do it, my other drawings (and some other stuff) are at
https://sites.google.com/site/burngateh ... e/drawings
Or, of course, draw a better diagram yourself!


No problems – my goof up (probably) in the end and trying to rush things – so much so that I even posted in the wrong forum!!!

What threw me was a non-working GPIO7 pin, then discovering that the SPI pins were acting like GPIO pins (probably to be expected until they're put into SPI mode!).

The issue in-hand is the continued numbering of them – have to say I favour keeping the goip0-7 labels on the connector – just makes it confusing when refering to the actual BCM GPIO pin numbers.

In the processing prodicing a Wiring compatable library for it, and will number them from pin0 to pin7 (corresponding to the gpio 0-7 on your GIF) – same "pin" style as Arduino with a layer of abstraction to hide the real pin numbers from the hardware IO port details.

Gordon

(edit to correct more dyslectic typos than usual!)
--
Gordons projects: https://projects.drogon.net/

GizmoB73
Posts: 80
Joined: Fri Jan 27, 2012 12:51 pm

Re: GPIO - Wiki wrong?

Fri Apr 27, 2012 10:24 am

Thanks for the update, I guess people will have a different view on which they prefer depending on their backgrounds.

Personally I think the 0-7 numbering makes sense but I have played with Arduino's a fair bit.

The rather haphazard numbering of GPIOs (4 through to 25 with some missing inbetween) as they break out from the BCM2835 is a little less obvious to me, but there is less room for confusion in the code, so it is swings and roundabouts.

Unfortunately with the new numbering, my "slice-of-pi" add-on board doesn't match any more...  Maybe that is the answer also... if you want them labelled 0-7 use an add-on board that labels them like that and just map them in your code?

I am sure there will be many more opinions on this one.

User avatar
gordon@drogon.net
Posts: 2020
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: GPIO - Wiki wrong?

Fri Apr 27, 2012 10:28 am

GizmoB73 said:


Thanks for the update, I guess people will have a different view on which they prefer depending on their backgrounds.

Personally I think the 0-7 numbering makes sense but I have played with Arduino's a fair bit.


That's the same background as me (well in recent times anyway). The pin to hardware port abstraction is handy, but I've occasionally found it frustrating, however it works for the masses...


The rather haphazard numbering of GPIOs (4 through to 25 with some missing inbetween) as they break out from the BCM2835 is a little less obvious to me, but there is less room for confusion in the code, so it is swings and roundabouts.

Unfortunately with the new numbering, my "slice-of-pi" add-on board doesn't match any more...  Maybe that is the answer also... if you want them labelled 0-7 use an add-on board that labels them like that and just map them in your code?


Sure. Right now, I have a trivla map array that does just that.


I am sure there will be many more opinions on this one.


Probably not in this location though - I suspect my initial goof of posting in the wrong forum didn't help

Gordon
--
Gordons projects: https://projects.drogon.net/

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

Re: GPIO - Wiki wrong?

Fri Apr 27, 2012 10:50 am

Dave_G_2 said:

Nobody is having a go at you personally ...

'sorllrite, not a problem!

Though it's a bit embarassing still having my poor-quality artistry displayed for the world to see and laugh at!

User avatar
gordon@drogon.net
Posts: 2020
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: GPIO - Wiki wrong?

Fri Apr 27, 2012 10:53 am

Burngate said:


Dave_G_2 said:


Nobody is having a go at you personally ...


'sorllrite, not a problem!

Though it's a bit embarassing still having my poor-quality artistry displayed for the world to see and laugh at!



Yea, the things we do to be helpful then come back to embarass us years later

I think it's OK though - maybe if altering it, take heed of the warning message about making the pins DNC - Do Not Connect...

Gordon
--
Gordons projects: https://projects.drogon.net/

User avatar
rew
Posts: 423
Joined: Fri Aug 26, 2011 3:25 pm

Re: GPIO - Wiki wrong?

Sat Apr 28, 2012 9:23 am

Dave_G_2 said:


Not to mention the errors (as I see it)  in the peripherals datasheet.

See page 96 (description of the bits in the GPLEVn register).


Added to the errata page:
http://elinux.org/BCM2835_data.....errata#p96
Check out our raspberry pi addons: https://www.bitwizard.nl/shop/

User avatar
rew
Posts: 423
Joined: Fri Aug 26, 2011 3:25 pm

Re: GPIO - Wiki wrong?

Sat Apr 28, 2012 9:26 am

GordonH said:


I think we're all sorted now - I was initially thrown by starting at GPIO 7 which doesn't appear to work (at least on my Pi - anyone?) I'm suspecting it has to be re-programmed to be used as genera purpose.


Just get the "gpio_list" program from
http://bitwizard.nl/software/g.....120419.tgz

and check for yourself. It will print a nice map of what your GPIO pins are programmed for. It queries the hardware directly. No chance of some driver in the middle messing things up.
Check out our raspberry pi addons: https://www.bitwizard.nl/shop/

User avatar
Dave_G_2
Posts: 196
Joined: Sat Apr 14, 2012 7:04 pm

Re: GPIO - Wiki wrong?

Sat Apr 28, 2012 9:30 am

Thanks rew.

I wasn't aware of the existence of that page.

Nice to have all the errors/typos in one place.

I'm going to download and convert that page to a pdf and keep it next to the datasheet.

User avatar
rew
Posts: 423
Joined: Fri Aug 26, 2011 3:25 pm

Re: GPIO - Wiki wrong?

Sat Apr 28, 2012 9:36 am

Burngate said:


https://sites.google.com/site/burngateh ... e/drawings


Looks good. That's the way I would have preferred seeing it the first time!

One thing that can be improved is that you specify the GPIO pin number for the "special purpose" pins too. So mention: GPIO7/SPI0_CE1 and GPIO0/SDA0.

This makes it clear which SPI / I2C controller the pins are connected to internally, as well as indicating that those pins COULD be used for GPIO as well if you don't need the module they are connected to.

One note needs to be mentioned: The RPI itself has pullup resistors on the SDA0/SDA1 pins, so if you use them as input you''ll need to sink 2mA extra when you pull them low.
Check out our raspberry pi addons: https://www.bitwizard.nl/shop/

hippy
Posts: 5332
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: GPIO - Wiki wrong?

Sat Apr 28, 2012 12:29 pm

rew said:


Burngate said:


https://sites.google.com/site/burngateh ... e/drawings


Looks good. That"s the way I would have preferred seeing it the first time!

One thing that can be improved is that you specify the GPIO pin number for the "special purpose" pins too. So mention: GPIO7/SPI0_CE1 and GPIO0/SDA0.


Thanks for the updated diagrams Burngate and I'd agree with rew that both GPIOx and 'specific purpose' naming would be useful, perhaps two separate diagrams to keep things less cluttered ?

And no worries over the initial diagrams and no need to feel any guilt or need to apologise. These are trials and tribulations which any project has; no big thing. I'll admit I did not fully realise the mis-match in naming could be such a potential problem until this thread or would have raised a flag earlier. Thanks for putting the effort in.

Return to “Beginners”