【Raspberry pi】GPIO注意事项

本文详细介绍了树莓派GPIO引脚的两种编码方法,包括BOARD和BCM,并提供了具体的引脚编号对照表。此外,还阐述了各引脚的电气特性,如最大允许电流等关键参数。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、GPIO编码的方法

  1. 第三列是树莓派板子上的自然编号(左边引脚为1-15,右边引脚为2-26),RPi.GPIO.setmode(GPIO.BOARD)采用这列编号
  2. 树莓派主芯片提供商Broadcom的编号方法,相当于调用了WiringPiSetupGpio()RPi.GPIO.setmode(GPIO.BCM)采用这列编号
wiringPi PinNameBoard PinBCM GPIO
0GPIO 01117
1GPIO 11218
2GPIO 21321
3GPIO 31522
4GPIO 41623
5GPIO 51824
6GPIO 62225
7GPIO 774
8SDA30
9SCL51
10CE0248
11CE1267
12MOSI1910
13MISO219
14SCLK2311
15TXD814
16RXD1015

Rev.2 新增的引脚:

wiringPi PinNameBoard PinBCM GPIO
17GPIO 8 28
18GPIO 9 29
19GPIO10 30
20GPIO11 31

2、GPIO的电气特性

Also from the wiki the "maximum permitted current draw from the 3v3 pin is 50mA" and the "maximum permitted current draw from the 5v pin is the USB input current (usually 1A) minus any current draw from the rest of the board." The current draw for Model B is stated as 700mA so with a 1A power supply this leaves about 300mA to play with.

对于3.3伏的线路科承受的电流上限是50mA,对于5V的是700mA,

There will also be an issue with trying to draw to much power form the pins, according to the data-sheet each pin programmed to current drive between 2mA and 16mA, and it has been warned that trying to draw 16mA from several pins at once could also lead to a damaged Pi.

 

对于其他针脚可承受的上限是16mA,对3.3V的话至少要接入210欧的元器件总电阻。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值