1

So I'm doing a project today with the Raspberry Pi 2 Model B and I realized that some (not all) of the GPIO pins output 3.3V at startup (I mean the data pins, not the power output pins). I cannot have it output 3.3V since I'm using the RPI to control a quadcopter and that would cause a mess if the motors ran at full speed at bootup. So do you guys know which pins are 0V (off) at startup and I can control using WiringPi?

migrated from electronics.stackexchange.com Nov 10 '15 at 22:31

This question came from our site for electronics and electrical engineering professionals, students, and enthusiasts.

  • We would know if we read the datasheet. You too. – Eugene Sh. Nov 10 '15 at 22:16
  • I never worked with RPI, but, in general, MCU GPIOs start in high impedance mode. You can try a pull down resistor (10k-100k) for each motor control GPIOs. – Gabriel Rezende Germanovix Nov 10 '15 at 22:18
  • @EugeneSh. I cant seem to find any datasheets for the RPI. If you find it can you please link me to it? – Peter Zhu Nov 10 '15 at 22:20
  • everything is here. Start with the board schematic as it may contain pull ups/downs and other stuff on the GPIOs, and then look at the processor docs GPIO section – Eugene Sh. Nov 10 '15 at 22:23
  • They may start in High-Z, but may go high or low somewhere in the Linux boot sequence. Many pins have multiple functions, and some may not even be gpio, just gpo – cde Nov 10 '15 at 22:56
1

All the GPIO pins start as inputs (except the 2 used for serial console), so they may appear "high" if read with a voltmeter, but you could easily override this.

gpio readall will show state.

I believe you can change the startup state (you could search just as easily as I). In the brief period before the config is read they must be indeterminate. You need some other method if you wish to manage state.

  • If the pins are input (High-Z), the processor may have weak pull-ups automatically enabled to avoid problems with floating inputs. You can probably make them look low on startup by putting a 4.7K (or even 10K) ohm pull-down resistor to ground on each. This should easily overcome the internal weak pull-up but not interfere with using the pin as an output. – DoxyLover Nov 10 '15 at 23:10
  • So how do I use gpio readall? – Peter Zhu Nov 10 '15 at 23:15
  • @DoxyLover the GPIO does not work like this. It is years since I read the data sheets, so this may not be exactly correct, but the GPIO has an internal state e.g. if it has been used as an output, and set low, when switched to input it still reports a low value. gpio readall will show many pins as 0, even with nothing connected. – Milliways Nov 10 '15 at 23:18
  • @peterzhu2118 type gpio readall on the command line. – Milliways Nov 10 '15 at 23:19
  • @Milliways So I got that working, I understand all the columns except the "V" column. What is the supposed to mean? – Peter Zhu Nov 10 '15 at 23:25
1

I just got I2C and WiringPi installed a few hours ago. To expand on what @Milliways said, I rebooted and checked the output of gpio readall. See the attached image. It appears most all the pins start as inputs.

gpio readall output on RPi B board

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.