thicc boi
Posts: 8
Joined: Sat Jan 19, 2019 6:51 pm

Different GPIO Pins?

Thu Jan 31, 2019 1:16 am

I thought there were just GPIO, ground, 3.3v, 5v, and some fancy pins, I had no idea the GPIO pins had a bunch of weird funky categories, and even worse, none of them make any sense. I've just started getting into computer programming and RPi's, and this is terrifying for me.

I'm trying to program a simple 4x4 matrix keypad, I got PuTTy, I got a nice little kit of lights, resistors, all that stuff, but I just realized today, after looking at the lables for the GPIO pins, that they have different types, and I cannot get my head past this until I figure it out.
Last edited by thicc boi on Thu Jan 31, 2019 2:18 am, edited 1 time in total.

Andyroo

Re: Different GPIO Pins?

Thu Jan 31, 2019 1:56 am

As for your problem, have a look at https://pinout.xyz. The first diagram shows you each pin, it’s PIN number and the BCM number.

First thing to understand is the difference between the PIN number and BCM.
PIN numbers refers to the location on the header
BCM represents the pin on the Broadcom chip (main CPU)

Second thing are the possible pin functions shown in brackets
These are only turned on when needed using the Pi config GUI or command line program

To start with just ignore the functions and get used to the two numbering schemes then select one type of interface to use first and learn how to turn it on and access it in software.

I would start with a simple 1-Wire temperature sensor (DS18B20) and understand how that’s presented both to the system and programs using modules.

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

Re: Different GPIO Pins?

Thu Jan 31, 2019 6:28 pm

1-Wire, that is one of the most complex and strange variations on I2C, and very hard to get working, not for beginners who want to keep their sanity. :mrgreen:

Its easy, some GPIO pins can, but don't have to, be used with special hardware in the chip, to be used for specific hardware functions.
examples are I2C, or inter IC Bus, a two-wire bus used to add specif hardware to a processor, hardware like a digital to analog converter, or other kind of I2C chips.
other examples are PWM, where special hardware turns the GPIO on and off rapidly, with varying on/off ratio's, used to control servo's, or after filtering create a variable DC voltage.
a third example is SPI, for fast serial devices.

All these GPIO functions are optional and can be largely ignored.
There are plenty of GPIO that do not have special functions, start with these.

Andyroo

Re: Different GPIO Pins?

Thu Jan 31, 2019 11:07 pm

mahjongg wrote:
Thu Jan 31, 2019 6:28 pm
1-Wire, that is one of the most complex and strange variations on I2C, and very hard to get working, not for beginners who want to keep their sanity. :mrgreen:
It must be me or my age :lol:

SteveSpencer
Posts: 351
Joined: Thu Mar 28, 2013 9:19 am
Location: Nottingham, UK

Re: Different GPIO Pins?

Fri Feb 01, 2019 3:52 pm

mahjongg wrote:
Thu Jan 31, 2019 6:28 pm
1-Wire, that is one of the most complex and strange variations on I2C, and very hard to get working, not for beginners who want to keep their sanity. :mrgreen:

Its easy, some GPIO pins can, but don't have to, be used with special hardware in the chip, to be used for specific hardware functions.
examples are I2C, or inter IC Bus, a two-wire bus used to add specif hardware to a processor, hardware like a digital to analog converter, or other kind of I2C chips.
other examples are PWM, where special hardware turns the GPIO on and off rapidly, with varying on/off ratio's, used to control servo's, or after filtering create a variable DC voltage.
a third example is SPI, for fast serial devices.

All these GPIO functions are optional and can be largely ignored.
There are plenty of GPIO that do not have special functions, start with these.
This is excellent advice. For a really simple use of GPIO, you need some wires, a breadboard, resistors and LEDs.
Is it still possible to get the book (and kit?) for Adventures In Raspberry Pi ? (authored by RPF Director of Informal Learning, Carrie Anne Philbin)
Steve S
No, I can't think of anything funny that won't offend someone if they want it to...

PhatFil
Posts: 1482
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: Different GPIO Pins?

Fri Feb 01, 2019 4:22 pm

thicc boi wrote:
Thu Jan 31, 2019 1:16 am
I thought there were just GPIO, ground, 3.3v, 5v, and some fancy pins, I had no idea the GPIO pins had a bunch of weird funky categories, and even worse, none of them make any sense. I've just started getting into computer programming and RPi's, and this is terrifying for me.

I'm trying to program a simple 4x4 matrix keypad, I got PuTTy, I got a nice little kit of lights, resistors, all that stuff, but I just realized today, after looking at the lables for the GPIO pins, that they have different types, and I cannot get my head past this until I figure it out.
In addition to the good advise above i would suggest you take a step back and concentrate on your task in hand.. Find a good guide to follow setting up your 4x4 matrix keypad, and dont worry too much about understanding every aspect of what your doing first time through.. You WILL have it by the time your finished ;)

when prototyping a circuit on a bread board as a rule of thumb make the ground connection first, so everything is grounded as you build, then work on the logic connections and finally after checking everything over then connect the +voltage up..

Its not unusual to get overwhelmed when starting to learn something new, everyone experiences it to some degree, stick with it and im sure in a few months you will find yourself helping a new starter out with something you learnt the hard way ;)

LTolledo
Posts: 2442
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: Different GPIO Pins?

Fri Feb 01, 2019 8:47 pm

....and to prevent some misadventures with your RPi, most of us will recommend putting your RPi in a protective case specially designed for the RPi

....as several reported unprotected RPis has been KIA ("killed in action") due to "accidental shorts".
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

JohnsUPS
Posts: 135
Joined: Fri Jul 06, 2018 2:13 am
Location: USA

Re: Different GPIO Pins?

Sat Feb 02, 2019 3:07 am

I totally agree with the notion of putting the Pi in a case. Good advice there. It is what I do during development. Tabletops, benches or whatever can have things that may get under the Pi and then it "mysteriously" stops working (that is unless the magic smoke gets out).

As far as becoming acquainted with the GPIO pins and such, I have followed this and used many of the examples as jumping off points for things:

https://www.w3schools.com/nodejs/nodejs ... _intro.asp

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

Re: Different GPIO Pins?

Sat Feb 02, 2019 11:45 pm

Don't forget rule #101, when using GPIO's, putting 5V on a GPIO means immediate destruction of your RPI :!: :!: :!: :!:

RPI's do not tolerate 5V (or even 4V) on their GPIO pins!

JohnsUPS
Posts: 135
Joined: Fri Jul 06, 2018 2:13 am
Location: USA

Re: Different GPIO Pins?

Sun Feb 03, 2019 6:47 pm

Sat Feb 02, 2019 5:45 pm

Don't forget rule #101, when using GPIO's, putting 5V on a GPIO means immediate destruction of your RPI :!: :!: :!: :!:

RPI's do not tolerate 5V (or even 4V) on their GPIO pins!
Voltage level translators are your friends.......they are much cheaper than a Pi of any flavor. Use (or make) good ones.

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

Re: Different GPIO Pins?

Fri Feb 08, 2019 5:51 pm

Resistor dividers are even cheaper, level translators are overkill for 99% of applications, except when used with I2C (when used with 5V I2C levels, an easier solution is to use pullups to 3V3 instead of to 5V where possible).

JohnsUPS
Posts: 135
Joined: Fri Jul 06, 2018 2:13 am
Location: USA

Re: Different GPIO Pins?

Wed Feb 20, 2019 3:51 am

Yes, resistor dividers are cheaper, and is the best solution to knock down a higher voltage swing input to something safe for the Pi.

However, when using a GPIO as an output to drive something else, 3.3V may not be enough, not to mention the rather weak current sourcing ability. 3.3V is well within the recognized TTL hi input threshold, but does not provide a full/maximum noise margin. If the GPIO is being asked to drive something other than, say, another chip or TTL gate level Vth MOSFET, I'll go with a buffer or translator to increase the voltage swing to provide a better drive signal. I'm not building hundreds of anything, so as a standard design procedure to protect the Pi, I always actively buffer any GPIO used as an output in some way. I don't consider that overkill, but protection.
Using a translator allows the user to tailor the output voltage swing to their needs and provides buffering in the process. They're cheap, easily obtainable, easy to build, easy to use and will protect the Pi.

boyoh
Posts: 1372
Joined: Fri Nov 23, 2012 3:30 pm
Location: Selby. North Yorkshire .UK

Re: Different GPIO Pins?

Wed Feb 20, 2019 11:50 pm

I’m not a great believer in using potential dividers as voltage levellers
I like to use opto isolators or transistor circuits, no guesswork.
If you use a potential divider to switch current above low signal
Level, make sure the current through the divider is ten times
Greater than you want to take off it. You can’t have 10ma through
The divider and expect to take 20ma off it’

Regards BoyOh
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

LTolledo
Posts: 2442
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: Different GPIO Pins?

Thu Feb 21, 2019 11:24 am

boyoh wrote:
Wed Feb 20, 2019 11:50 pm
I’m not a great believer in using potential dividers as voltage levellers
I like to use opto isolators or transistor circuits, no guesswork.
......’

Regards BoyOh
+1 on this.


....well each has his/hers/its preferences.
Just do it responsibly and safely!
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

drgeoff
Posts: 10115
Joined: Wed Jan 25, 2012 6:39 pm

Re: Different GPIO Pins?

Thu Feb 21, 2019 1:32 pm

LTolledo wrote:
Thu Feb 21, 2019 11:24 am
boyoh wrote:
Wed Feb 20, 2019 11:50 pm
I’m not a great believer in using potential dividers as voltage levellers
I like to use opto isolators or transistor circuits, no guesswork.
......’

Regards BoyOh
+1 on this.


....well each has his/hers/its preferences.
Just do it responsibly and safely!
-1

Resistive dividers are fine for RPI GPIOs. Unless you also need isolation.

User avatar
ptimlin
Posts: 90
Joined: Tue Jan 08, 2019 7:44 pm

Re: Different GPIO Pins?

Thu Feb 21, 2019 4:35 pm

drgeoff wrote:
Thu Feb 21, 2019 1:32 pm
-1

Resistive dividers are fine for RPI GPIOs. Unless you also need isolation.

Agreed. There is no "guesswork" involved with Ohm's Law. It is as straight forward and predictable as you can get.

User avatar
rpdom
Posts: 15937
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Different GPIO Pins?

Thu Feb 21, 2019 4:40 pm

drgeoff wrote:
Thu Feb 21, 2019 1:32 pm
Resistive dividers are fine for RPI GPIOs. Unless you also need isolation.
Yes, the impedance of a GPIO set to input is so high that the current is in microamps.

Return to “Beginners”