Page 1 of 1

GPIO

Posted: Sun Feb 28, 2016 6:33 pm
by JGPIO
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.

Re: GPIO

Posted: Sun Feb 28, 2016 6:55 pm
by joan
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.

Re: GPIO

Posted: Sun Feb 28, 2016 7:01 pm
by JGPIO
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!

Re: GPIO

Posted: Sun Feb 28, 2016 7:54 pm
by rzusman
The BCM documentation has a list of all the pins and their alternate functions.
This doc is on the Raspi website somewhere.

Re: GPIO

Posted: Sun Feb 28, 2016 7:56 pm
by rurwin
It won't have changed much since revision 1, and the schematics for that are available.

Re: GPIO

Posted: Sun Feb 28, 2016 8:10 pm
by JGPIO
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?

Re: GPIO

Posted: Sun Feb 28, 2016 8:18 pm
by rpdom
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.

Re: GPIO

Posted: Sun Feb 28, 2016 8:35 pm
by JGPIO
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?

Re: GPIO

Posted: Sun Feb 28, 2016 8:39 pm
by 6by9
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.

Re: GPIO

Posted: Sun Feb 28, 2016 8:43 pm
by DirkS
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

Re: GPIO

Posted: Sun Feb 28, 2016 8:47 pm
by rpdom
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.

Re: GPIO

Posted: Sun Feb 28, 2016 8:58 pm
by JGPIO
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.