JGPIO
Posts: 25
Joined: Sun Feb 28, 2016 6:29 pm

GPIO

Sun Feb 28, 2016 6:33 pm

Hello.

The BCM2835 soc has 54 GPIO pins, but only some of these are available on the GPIO connector.

Is there any documentation showing what the other pins are used for?

Many thanks.

User avatar
joan
Posts: 15039
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: GPIO

Sun Feb 28, 2016 6:55 pm

Not really. Some will be used for the SD card interface. For all I know the others will be unused. Look at the compute module documentation, that has access to all 54 GPIO.

JGPIO
Posts: 25
Joined: Sun Feb 28, 2016 6:29 pm

Re: GPIO

Sun Feb 28, 2016 7:01 pm

Yeah, and I understand some are used for sound, some for the camera module, some for status LEDs etc etc, but I can't find anything official.

Thanks for the fast response though!

rzusman
Posts: 347
Joined: Fri Jan 01, 2016 10:27 pm

Re: GPIO

Sun Feb 28, 2016 7:54 pm

The BCM documentation has a list of all the pins and their alternate functions.
This doc is on the Raspi website somewhere.

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4257
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: GPIO

Sun Feb 28, 2016 7:56 pm

It won't have changed much since revision 1, and the schematics for that are available.

JGPIO
Posts: 25
Joined: Sun Feb 28, 2016 6:29 pm

Re: GPIO

Sun Feb 28, 2016 8:10 pm

Many thanks for all the replies.

I am aware of the defaults and alternative functions of all 54 BCM2835 GPIO pins, and I know which pins are availabe on the GPIO header(s) for the various versions of the RPi. What I don't know for certain is what the RPi uses the other pins for.

According to http://elinux.org/RPi_Low-level_peripherals

GPIO16 drives status LED D5 (usually SD card access indicator)
GPIO28-31 are used by the board ID and are connected to resistors R3 to R10 (only on Rev1.0 boards).
GPIO40 and 45 are used by analogue audio and support PWM. They connect to the analogue audio circuitry via R21 and R27 respectively.
GPIO46 is HDMI hotplug detect (goes to pin 6 of IC1).
GPIO47 to 53 are used by the SD card interface. GPIO47 is connected to the SD card interface card detect switch; GPIO48 to 53 are connected to the SD card interface via resistors R45 to R50.

But what about the rest?

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

Re: GPIO

Sun Feb 28, 2016 8:18 pm

I wouldn't put much stock in what you read on the elinux site. A lot of that information is out of date and only applies to the original A and B boards.

On all models from the A+/B+ onwards, there is no card detect switch on the SD slot. GPIO 47 is used for the ACT LED. GPIO 35 is used for the PWR LED.

JGPIO
Posts: 25
Joined: Sun Feb 28, 2016 6:29 pm

Re: GPIO

Sun Feb 28, 2016 8:35 pm

Wow rpdom, you're right! I've just made the Power and Activity LEDs on my B+ blink. Many thanks!

One would have assumed the Power LED was connected direct to the supply, not under control of the BCM2835.

How did you know this. What other pin usage are you aware of?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9560
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: GPIO

Sun Feb 28, 2016 8:39 pm

https://github.com/raspberrypi/firmware ... t-blob.dts is the pin configuration file that the firmware uses to configure the majority of pins. There's a separate section for each variant.
There are a few pins that are done dynamically (eg i2c to the camera and display) but there are defines for those.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

DirkS
Posts: 10417
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: GPIO

Sun Feb 28, 2016 8:43 pm

JGPIO wrote:How did you know this. What other pin usage are you aware of?
There are various posts here on the forum.
There are actually some device tree parameters that can control the behaviour of power and act leds.
See https://github.com/raspberrypi/firmware ... t/overlays (or /boot/overlays/README on your Pi), parameters act_led_xxx and pwr_led_xxxx

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

Re: GPIO

Sun Feb 28, 2016 8:47 pm

JGPIO wrote:Wow rpdom, you're right! I've just made the Power and Activity LEDs on my B+ blink. Many thanks!

One would have assumed the Power LED was connected direct to the supply, not under control of the BCM2835.
It is - sort of. The LED is pulled high normally, but gets pulled low when low voltage is detected. GPIO 25 is normally set as input and can be used to monitor the power state, but if set to output it will override the pull on the LED and you can switch it on and off.

JGPIO
Posts: 25
Joined: Sun Feb 28, 2016 6:29 pm

Re: GPIO

Sun Feb 28, 2016 8:58 pm

I've just been reading the link provided by 6by9 and the following line puzzled me:

pin@p35 { function = "input"; termination = "no_pulling"; polarity = "active_low"; }; // Power low

input? Power Low?

Then I read the post by rpdom which made the line make sense.

Many thanks to you all.

Return to “Interfacing (DSI, CSI, I2C, etc.)”