wernert
Posts: 10
Joined: Fri Jul 25, 2014 11:45 am
Location: New Zealand
Contact: Website

Strange behaviour of Rpi pin12

Sun Aug 23, 2015 5:22 am

I have designed a PCB that uses most of the Rpi 2 pins. On my PCB, I have physical pin 12 connected to an LED.
The problem is when I try to turn the LED on, it only goes on for less than a second before turning off again.
All my other pins that is also simple I/O behaves as expected. It just this darn pin 12 that misbehaves

I use WiringPi to interface with the IO and the code looks simply like this:

Code: Select all

pinMode(1, OUTPUT);       // RPi physical pin 12
digitalWrite(1, HIGH);
When above mentioned code run, the LED flashes on briefly but then goes off again by itself.

I realize this same pin 12 can also have several other functions like PCM_CLK, SDA / MOSI,SPI1_CE0_N, PWM0 and I suspect there is something else I have to do before I can use this pin a general I/O pin. Problem is I do not know what?

Does anyone have any advice for me?

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

Re: Strange behaviour of Rpi pin12

Sun Aug 23, 2015 8:51 am

You have done what you need to do.

Presumably there is another program running which switches the gpio off at regular intervals or your code does later on.

Return to “Troubleshooting”