## weird voltage 3.0V on GPIO.26

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

### weird voltage 3.0V on GPIO.26

hello,
although there is no special program started by me I have a weird voltage signal of constant 3.0 V on GPIO.26
no power consuming devices plugged to either GPIOs.

5V pins are 4.9V, 3.3V pins are 3.3V

I would assume that my Raspi is defective, but is there a way to test?
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

Burngate
Posts: 6261
Joined: Thu Sep 29, 2011 4:34 pm
Contact: Website

### Re: weird voltage 3.0V on GPIO.26

GPIO 26 on pin 37, or GPIO 7 on pin 26?
Does it still occur if you power-up the Pi without an SD card? (It should be set as input until told different by software)

EDITED: I wasn't helped by misreading my spreadsheet - GPIO 7 is on line 10 - Doh!
Last edited by Burngate on Sat May 14, 2016 5:33 pm, edited 1 time in total.

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

### Re: weird voltage 3.0V on GPIO.26

GPIO.26 is on physical 32
yes, without SD card it's also 3V.

OTOH, GPIO.23 (physical 33) is ~0V.

(BTW, who the hell has invented those weird and annoying and puzzling numbering schemes !?! )
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

Burngate
Posts: 6261
Joined: Thu Sep 29, 2011 4:34 pm
Contact: Website

### Re: weird voltage 3.0V on GPIO.26

Yes, it's confusing!

According to this (grabbed off the B+ schematic)
GPIO-B+.png (21.83 KiB) Viewed 3825 times
GPIO 26 is on physical pin 37; pin 33 is GPIO 13
GPIO 23 is on physical pin 16

None of this explains the weird volts, though.
Without SD card they should all be inputs - so no voltage. Unless there's a fault in the chip.

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

### Re: weird voltage 3.0V on GPIO.26

that's BCM26, not GPIO.26

BCM 12 == GPIO.26 == physical 32

(again, hell, what a crappy numbering!! )
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

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

### Re: weird voltage 3.0V on GPIO.26

davenull wrote:that's BCM26, not GPIO.26
What's the difference?

Unless you use the Wiring Pi names, A GPIO number is the BCM number as that is what the interfaces are really called.

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

### Re: weird voltage 3.0V on GPIO.26

#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

### Re: weird voltage 3.0V on GPIO.26

anyway,
on my 2nd Pi GPIO.26 is always oV,
and the other one has always 3V.

Also on USB there are some issues.
So it's most probably broken.
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

Burngate
Posts: 6261
Joined: Thu Sep 29, 2011 4:34 pm
Contact: Website

### Re: weird voltage 3.0V on GPIO.26

Okay,
GPIO-3B.png (25.2 KiB) Viewed 3795 times
Looks the same without my pretty colours.
Also on USB there are some issues.
So it's most probably broken.

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

### Re: weird voltage 3.0V on GPIO.26

scheme: http://www.mindstormsforum.de/viewtopic ... 689#p67777

my GPIO.x (with dot) is the /sys/class/gpio interface numbering ,
your GPIOx (no dot) is the BCM numbering

and again:
hell, what a crap!

http://wiringpi.com/reference/setup/
There are four ways to initialise wiringPi.

int wiringPiSetup (void) ;
int wiringPiSetupGpio (void) ;
int wiringPiSetupPhys (void) ;
int wiringPiSetupSys (void) ;

wiringPiSetupSys (void) ;

This initialises wiringPi but uses the /sys/class/gpio interface rather than accessing the hardware directly. This can be called as a non-root user provided the GPIO pins have been exported before-hand using the gpio program. Pin numbering in this mode is the native Broadcom GPIO numbers – the same as wiringPiSetupGpio() above, so be aware of the differences between Rev 1 and Rev 2 boards.

Note: In this mode you can only use the pins which have been exported via the /sys/class/gpio interface before you run your program. You can do this in a separate shell-script, or by using the system() function from inside your program to call the gpio program.

Also note that some functions have no effect when using this mode as they’re not currently possible to action unless called with root privileges. (although you can use system() to call gpio to set/change modes if needed)
anyway, broken is broken
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

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

### Re: weird voltage 3.0V on GPIO.26

davenull wrote:my GPIO.x (with dot) is the /sys/class/gpio interface numbering ,
your GPIOx (no dot) is the BCM numbering
The /sys/class/gpio interface uses the BCM numbering scheme.

I have no idea why you think they are different.

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

### Re: weird voltage 3.0V on GPIO.26

just look at the chart/scheme I linked to and read Gordon's statements, perhaps it's about rev 1 and rev 2 boards, maybe it's a 5th version what has not even been mentioned before here - I have no idea who invented all that crappy numbering nonsens -
but finally it does not matter any more, so no need to argue about all that .

ps, [OT]
If I had designed the pin layout and numbering, I had created a block of voltage and GND pins, then the rest of IOs grouped by simple IOs and then i2c, UART, SPI in proprietary blocks, similar to Arduino Due.
But I have not been asked, unfortunately.
[/OT]
Last edited by davenull on Sat May 14, 2016 7:10 pm, edited 4 times in total.
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

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

### Re: weird voltage 3.0V on GPIO.26

I don't see anything in Gordon's statement that disagrees with what I stated, or supports what you claimed.

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

### Re: weird voltage 3.0V on GPIO.26

ok, you are right, and I have my peace.
then the numbers GPIO.x in my linked scheme refer to sth different - who cares.

Now stop arguing or this topic will again be starting a flame war.
Last edited by davenull on Sat May 14, 2016 7:00 pm, edited 1 time in total.
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

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

### Re: weird voltage 3.0V on GPIO.26

davenull wrote:Now stop arguing or this topic will again be starting a flame war.

jojopi
Posts: 3194
Joined: Tue Oct 11, 2011 8:38 pm

### Re: weird voltage 3.0V on GPIO.26

Burngate wrote:Without SD card they should all be inputs - so no voltage.
Inputs, but with the default pulls enabled.

The default pull for GPIO26 is down, so it should read 0V. But pulls do survive a warm boot, so it is very important to remove power and all other cables, especially HDMI, and the SD card before powering back up to test this. Also, the boot ROM is different on Pi3 BCM2837, and I have never checked whether that affects the pre-boot GPIO states at all.

If the voltage on a pin is wrong, it will almost certainly read back incorrectly too. That is easy to test with nothing connected:

Code: Select all

``````[email protected] ~ \$ gpio -g mode 26 output
[email protected] ~ \$ gpio -g write 26 0
[email protected] ~ \$ gpio -g read 26
0
[email protected] ~ \$ gpio -g write 26 1
[email protected] ~ \$ gpio -g read 26
1``````

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

### Re: weird voltage 3.0V on GPIO.26

thanks, I did not test it, but unplugging all cables did not help about GPIO.26: It's still 3V, several other ones also as I observed.
Perhaps a shortcut by mistaking a GND pin by a neighboured signal pin was the reason.

It's really awfully poor that the GPIO pins are so extremly bad unsorted and messed up on the GPIO header!
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

Burngate
Posts: 6261
Joined: Thu Sep 29, 2011 4:34 pm
Contact: Website

### Re: weird voltage 3.0V on GPIO.26

From what I saw as I watched the Pi evolve, it seems to me that the "mess" comes down to history.

Having decided to use the Broadcom chip for his creation, Eben had to route the GPIOs to the header.
Almost certainly, what went where would depend on which GPIO comes out where under the chip - which would in turn depend on ease of routing inside the chip.
An extra layer on the board could have been used to route things more logically, but that would have put the price up.
He would have assumed the nitty-gritty could be hidden from the kids' view - his target audience was kids, after all - by the "blob", Linux, drivers, etc. so what the chip called things was immaterial. And if he was seeing its main aim as teaching coding rather than interfacing, you only need a keyboard and display.

And indeed a translation was forthcoming very shortly after release. We know it as WiringPi, and the names were quite straight-forward.
General purpose pins 11, 12, 13, 15, 16 & 18 are numbered 0 to 6, with handy ground and 3v3 - nice and straightforward. More complicated interfaces are spread round the ends.

Then WiringPi was extended to include those extra pins - 1-wire, I2C, SDI and UART in that order can be used as general-purpose pins if you don't want those interfaces, and got numbered 7 to 16. Still relatively straight-forward. Even with the advent of the Rev 2, with four extra pins for the PCM interface, that could be added on the end with numbers 17 to 20.

But already, people were using the Pi in ways not envisaged by Eben, including not using a translation interface.
With the release of the BCM2835 ARM Peripherals pdf, it was possible to dive right down to the bottom layer, and drive the GPIOs even in bare-metal.
So the use of Broadcom numbering became popular.

Meanwhile, calling a pin by its physical position rather than what the Powers-that-Be want to call it is always going to appeal to small boy in all of us - I can see it's the sixth pin down on the right, I've connected the LED to it, why can't I call it that in the program? When I press the button labeled Granny's phone, Granny answers, whatever BT or Eon think it's number is.

Then came the B+, with 14 extra pins and 11 extra GPIOs. So WiringPi got extended, with the additional I2C (HAT) interface on the end.
But again, the pins were connected to the GPIOs most easily reached -cost, again.

So we've got the BCM numbering - how they appear in bare-metal, physical - where they got routed, and WiringPi - most reasonable, but only if you know the details.

Here's the translation table:

Code: Select all

``````BCM	P1	WiringPi
0	27
1	28
2	03	8
3	05	9
4	07	7
5	29	21
6	31	22
7	26	11
8	24	10
9	21	13
10	19	12
11	23	14
12	32	26
13	33	23
14	08	15
15	10	16
16	36	27
17	11	0
18	12	1
19	35	24
20	38	28
21	40	29
22	15	3
23	16	4
24	18	5
25	22	6
26	37	25
27	13	2
28		17
29		18
30		19
31		20
``````

joan
Posts: 14849
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

### Re: weird voltage 3.0V on GPIO.26

The original Pi B Rev.1 schematics https://www.raspberrypi.org/documentati ... matics.pdf give the names GPIO_GEN0 through GPIO_GEN6 for GPIO17/18/21/22/23/24/25.

Burngate
Posts: 6261
Joined: Thu Sep 29, 2011 4:34 pm
Contact: Website

### Re: weird voltage 3.0V on GPIO.26

Ah ... so Eben (or at least the Foundation) had decided the numbering before WiringPi was written?

Or is my potted history actually merely historical fantasy? I wouldn't be at all surprised!

MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

### Re: weird voltage 3.0V on GPIO.26

Burngate wrote: None of this explains the weird volts, though.
Without SD card they should all be inputs - so no voltage. Unless there's a fault in the chip.
That's what I thought too... my Rasppi7 has a red LED (low power 2ma) on pin board # 29 GPIO05 that glows very dimly until the pinblock is initialized (pin # 29 set output) then it works normally after that. I supose that as an input pin (there must be some voltage on it) it is just enough to make the LED glow slightly, but I was not aware that this would happen. I assumed that all input pins would be zero volts. All of my pins function normally otherwise (have not found any anomalies other than the LED on pin # 29 glows slightly until the pinblock is initialized).
marcus

joan
Posts: 14849
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

### Re: weird voltage 3.0V on GPIO.26

Burngate wrote:Ah ... so Eben (or at least the Foundation) had decided the numbering before WiringPi was written?
...
You'd have to ask Gordon, but I seem to remember reading that wiringPi used those numbers because the Foundation used those numbers.

joan
Posts: 14849
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

### Re: weird voltage 3.0V on GPIO.26

MarkHaysHarris777 wrote:
Burngate wrote: None of this explains the weird volts, though.
Without SD card they should all be inputs - so no voltage. Unless there's a fault in the chip.
That's what I thought too... my Rasppi7 has a red LED (low power 2ma) on pin board # 29 GPIO05 that glows very dimly until the pinblock is initialized (pin # 29 set output) then it works normally after that. I supose that as an input pin (there must be some voltage on it) it is just enough to make the LED glow slightly, but I was not aware that this would happen. I assumed that all input pins would be zero volts. All of my pins function normally otherwise (have not found any anomalies other than the LED on pin # 29 glows slightly until the pinblock is initialized).
GPIO5 will have the internal (50k) pull-up to 3V3 enabled after power-up until and if it is changed. That is enough to dimly illuminate a LED.

MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

### Re: weird voltage 3.0V on GPIO.26

joan wrote: GPIO5 will have the internal (50k) pull-up to 3V3 enabled after power-up until and if it is changed. That is enough to dimly illuminate a LED.
Thanks, Joan. It dawned on me just now, I have been trying to short pin 5 to ground on boot-up to get the recovery login without the shift key/ that maybe its not supposed to be board # pin 5, but GPIO05?

Can you confirm one way or the other... one blog I read said short pin 5 with pin 6, the other said short pin 5 to ground (I really don't want to experiment with it till I know frankly, but I'm suspecting that its GPIO05 with either 6 or ground?? tnx in advance.

marcus
marcus

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

### Re: weird voltage 3.0V on GPIO.26

is what you're talking about still about me TOP questio "weird voltage 3.0V on GPIO.26" ?

davenull wrote:hello,
although there is no special program started by me I have a weird voltage signal of constant 3.0 V on GPIO.26
no power consuming devices plugged to either GPIOs.

5V pins are 4.9V, 3.3V pins are 3.3V

I would assume that my Raspi is defective, but is there a way to test?
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}