sdaser
Posts: 2
Joined: Mon Mar 19, 2018 5:10 pm

Pi 3 Model B V1.2 (BCM2837RIFBG) Pin Mapping

Mon Mar 19, 2018 7:11 pm

Hi
I have just purchased a Pi 3 Model B V1.2 and am trying to use the GPIO for switching an LED on/off. I have finally come to the point where this is working however the pin mapping that I have identified does not match any information that I can find about Pi 3.

E.g.: When switching BCM 13 HIGH/LOW then physical pin 8 is toggled (BCM 5 --> pin 12; BCM 5 --> pin 10; BCM 13 --> pin 8; BCM 15 --> pin 31).

I have performed the following commands:

Code: Select all

[email protected]:~ $ sudo python
Python 2.7.13 (default, Nov 24 2017, 17:33:09)
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import RPi.GPIO as GPIO
>>> GPIO.setmode(GPIO.BCM)
>>>
>>> GPIO.setup(13, GPIO.OUT)
>>> GPIO.output(13, GPIO.HIGH)
>>> GPIO.output(13, GPIO.LOW)
>>>
>>> GPIO.VERSION
'0.6.3'
>>>
>>> GPIO.RPI_INFO
{'P1_REVISION': 3, 'RAM': '1024M', 'REVISION': 'a02082', 'TYPE': 'Pi 3 Model B', 'PROCESSOR': 'BCM2837', 'MANUFACTURER': 'Sony'}
>>>

Code: Select all

[email protected]:~ $ gpio allreadall
+-----+------+-------+      +-----+------+-------+
| Pin | Mode | Value |      | Pin | Mode | Value |
+-----+------+-------+      +-----+------+-------+
|   0 | IN   | High  |      |  27 | IN   | Low   |
|   1 | IN   | High  |      |  28 | IN   | Low   |
|   2 | IN   | High  |      |  29 | IN   | High  |
|   3 | IN   | High  |      |  30 | IN   | Low   |
|   4 | IN   | High  |      |  31 | IN   | Low   |
|   5 | IN   | High  |      |  32 | ALT3 | High  |
|   6 | IN   | High  |      |  33 | ALT3 | High  |
|   7 | IN   | High  |      |  34 | ALT3 | Low   |
|   8 | IN   | High  |      |  35 | ALT3 | High  |
|   9 | IN   | High  |      |  36 | ALT3 | High  |
|  10 | IN   | Low   |      |  37 | ALT3 | High  |
|  11 | IN   | Low   |      |  38 | ALT3 | High  |
|  12 | IN   | High  |      |  39 | ALT3 | High  |
|  13 | OUT  | Low   |      |  40 | ALT0 | Low   |
|  14 | IN   | Low   |      |  41 | ALT0 | Low   |
|  15 | IN   | High  |      |  42 | ALT0 | High  |
|  16 | IN   | Low   |      |  43 | ALT0 | Low   |
|  17 | IN   | High  |      |  44 | IN   | High  |
|  18 | IN   | Low   |      |  45 | IN   | High  |
|  19 | IN   | High  |      |  46 | IN   | High  |
|  20 | IN   | Low   |      |  47 | OUT  | High  |
|  21 | IN   | High  |      |  48 | ALT0 | Low   |
|  22 | IN   | Low   |      |  49 | ALT0 | High  |
|  23 | IN   | High  |      |  50 | ALT0 | High  |
|  24 | IN   | Low   |      |  51 | ALT0 | High  |
|  25 | IN   | Low   |      |  52 | ALT0 | High  |
|  26 | IN   | Low   |      |  53 | ALT0 | High  |
+-----+------+-------+      +-----+------+-------+

Code: Select all

[email protected]:~ $ gpio readall
 +-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |
 |   2 |   8 |   SDA.1 |   IN | 1 |  3 || 4  |   |      | 5v      |     |     |
 |   3 |   9 |   SCL.1 |   IN | 1 |  5 || 6  |   |      | 0v      |     |     |
 |   4 |   7 | GPIO. 7 |   IN | 1 |  7 || 8  | 0 | IN   | TxD     | 15  | 14  |
 |     |     |      0v |      |   |  9 || 10 | 1 | IN   | RxD     | 16  | 15  |
 |  17 |   0 | GPIO. 0 |   IN | 1 | 11 || 12 | 0 | IN   | GPIO. 1 | 1   | 18  |
 |  27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |
 |  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 1 | IN   | GPIO. 4 | 4   | 23  |
 |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |
 |  10 |  12 |    MOSI |   IN | 0 | 19 || 20 |   |      | 0v      |     |     |
 |   9 |  13 |    MISO |   IN | 1 | 21 || 22 | 0 | IN   | GPIO. 6 | 6   | 25  |
 |  11 |  14 |    SCLK |   IN | 0 | 23 || 24 | 1 | IN   | CE0     | 10  | 8   |
 |     |     |      0v |      |   | 25 || 26 | 1 | IN   | CE1     | 11  | 7   |
 |   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |
 |   5 |  21 | GPIO.21 |   IN | 1 | 29 || 30 |   |      | 0v      |     |     |
 |   6 |  22 | GPIO.22 |   IN | 1 | 31 || 32 | 1 | IN   | GPIO.26 | 26  | 12  |
 |  13 |  23 | GPIO.23 |  OUT | 0 | 33 || 34 |   |      | 0v      |     |     |
 |  19 |  24 | GPIO.24 |   IN | 1 | 35 || 36 | 0 | IN   | GPIO.27 | 27  | 16  |
 |  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO.28 | 28  | 20  |
 |     |     |      0v |      |   | 39 || 40 | 1 | IN   | GPIO.29 | 29  | 21  |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+
I have also tried mode GPIO.BOARD and value 23 - same results.

What am I making wrong?
Any help would be appreciated!

User avatar
rpdom
Posts: 12647
Joined: Sun May 06, 2012 5:17 am
Location: Ankh-Morpork

Re: Pi 3 Model B V1.2 (BCM2837RIFBG) Pin Mapping

Mon Mar 19, 2018 8:51 pm

Try turning your Pi around. I thing you're looking at the pins the wrong way. What you think is pin 8 is really pin 33. Look at https://pinout.xyz for a picture. Pin 2 is closest to the corner of the board. Pin 39 is near the USB.

sdaser
Posts: 2
Joined: Mon Mar 19, 2018 5:10 pm

Re: Pi 3 Model B V1.2 (BCM2837RIFBG) Pin Mapping

Mon Mar 19, 2018 9:49 pm

Hi rpdom,

That was it!
I confused myself with a breakout extension board that I connected. You see, I am a bloody beginner.

Now it is working fine. :D

Thanks!

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

Who is online

Users browsing this forum: No registered users and 14 guests