Raspberry Pi 備忘録 / Mbedもあるよ!

Raspberry Pi であれこれやった事の記録

プルアップ/ダウン抵抗 について

プルアップ/ダウン抵抗がどうなっているのか。

pinout.xyz

https://www.raspberrypi.org/wp-content/uploads/2012/10/Raspberry-Pi-R2.0-Schematics-Issue2.2_027.pdf

を眺める。

PIN GPIO コメント
3 2 SDA (i2c Data) is one of the i2c pins on the Pi, learn more about i2c.
SDA includes a fixed, 1.8 kohms pull-up to 3.3v, which means this pin is not suitable for use as a general purpose IO where no pullup resistor is desired.
5 3 SCL (i2c Clock) is one of the i2c pins on the Pi, learn more about i2c.
SCL includes a fixed, 1.8 kohms pull-up to 3.3v, which means this pin is not suitable for use as a general purpose IO where no pullup resistor is desired.

f:id:pongsuke:20160804110812j:plain

GPIO2,3 は 1.8kΩ固定、その他は、制御可能な 50KΩ らしい。

GPIO.setup(pin, GPIO.IN, pull_up_down=GPIO.PUD_UP);
GPIO.setup(pin, GPIO.IN, pull_up_down=GPIO.PUD_DOWN);

など。

初期状態・・・も、調べよう。