18

So question is: Does all Raspberrys GPIO have a internal pull-up/pull-down resistor which can be enabled from program, in my case Java language with PiJ4?

I have Raspberry Model B+.

13

Yes, all of the B+'s GPIO pins have internal pull-up or pull-down resistors that can be controlled from your code.

Pull-up is 50K min – 65K max. Pull-down is 50K min – 60K max.

More info on the GPIO can be found here and here.

Example usage frm the PI4J documentation:

// provision gpio pin #02 as an input pin with its internal pull down resistor enabled
// (configure pin edge to both rising and falling to get notified for HIGH and LOW state
// changes)
GpioPinDigitalInput myButton = gpio.provisionDigitalInputPin(RaspiPin.GPIO_02,             // PIN NUMBER
                                                             "MyButton",                   // PIN FRIENDLY NAME (optional)
                                                             PinPullResistance.PULL_DOWN); // PIN RESISTANCE (optional)
  • 5
    To round off your answer it might be worth mentioning that pins 3 and 5 have hard-wired 1k8 pull-ups to 3V3. These pull-ups are needed for the proper operation of the I2C bus. A consequence is that the internal pull-downs have no effect on these pins (the internal pull-downs are much weaker than the external pull-ups). – joan Dec 12 '15 at 14:43
  • @Ghanima Is this the datasheet for Model B+? raspberrypi.org/documentation/hardware/raspberrypi/bcm2835/… – Redex Dec 15 '15 at 10:37
  • @redex, this is the datasheet for the Broadcom SOC chip used in the B+, the "reduced" schematics of the full board are here. For the internal workings of the BCM your link is for sure worth a visit (it's quite exhaustive, and well, 200 pages long). – Ghanima Dec 15 '15 at 11:32

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.