如果您有任何建议,请随时打开问题或公关。如果您发现它有用,那么您可能想访问以下链接之一:
我一直将此随机的书呆子页面用作可安全使用的ESP32引脚的参考。
但是我还没有看到ESP32 -S3的类似产品 - 所以我想我应该做一个!
这些信息的大部分来自ESP32-S3-wroom数据表,其中包含来自ESP32-S3数据表的其他信息。
您可以在此处下载此图像的高分辨率PDF版本。
以上图像是带有标记的销钉的WROOM模块。粗体表示每个PIN的默认行为。我已经介绍了一些更深奥的别针名称,但是您可以在数据表中找到完整列表。
ESP32-S3具有更大的灵活性,因此大多数销钉都可以用于任何外围。但是,仍然有一些引脚具有有趣的行为。
除非您别无选择,否则避免使用。
引脚名称 | 细节 |
---|---|
GPIO0 | 在启动期间保持此低点以输入固件下载模式。 |
GPIO3 | 结合函料控制JTAG引脚的默认行为。除非您与Efuses混在一起,否则安全使用 |
GPIO45 | VDD_SPI-最好离开此断开连接 |
GPIO46 | ROM消息打印 - 最好也离开此断开连接。引起固件下载的问题(请参阅下面的启动模式控制表) |
ESP启动后,您可以将这些引脚用作输入或输出。但是请注意上拉/下电阻器(见下文)。
如果要将它们用作输入,请确保与引导过程中的默认配置不冲突。
例如,将按钮连接到GPIO0并在代码中使用该按钮是安全的。但是,如果您在启动过程中按下按钮,它将输入固件下载模式。
如果要将它们用作输出,请注意默认的拉上下电阻器。
引导模式 | GPIO0 | GPIO46 |
---|---|---|
SPI引导(默认) | 1 | 任何值 |
下载引导 | 0 | 0 |
无效的组合 | 0 | 1 |
绑带销 | 默认配置 | 位价值 |
---|---|---|
GPIO0 | 上拉 | 1 |
GPIO3 | 漂浮的 | - |
GPIO45 | 下拉 | 0 |
GPIO46 | 下拉 | 0 |
这些可以在ESP32-S3上使用任何GPIO引脚。
GPIO19,GPIO20-这些都用于USB连接。
对于包括八倍PSRAM(具有8MB PSRAM的任何模块)的模块,您不得使用GPIO35,GPIO36或GPIO37。
GPIO39,GPIO40,GPIO41,GPIO42
这些引脚的行为是由efuss与gpio3结合使用的。默认情况下,如果您尚未燃烧任何fuses,这些引脚是安全使用的。 JTAG将通过USB提供。
如果您想将这些引脚用于JTAG,则必须燃烧一些函数,并在启动时控制GPIO3。有关完整的详细信息,请参见数据表第2.6.4节。
GPIO43,GPIO44
这些默认为UART0,直到您的代码使用它们为止。
ADC频道都在固定引脚上,如果您使用的是WiFi,则不能使用ADC Unit 2
ADC 1单元的引脚是:
GPIO编号 | ADC频道 |
---|---|
GPIO1 | ADC1_CH0 |
GPIO2 | ADC1_CH1 |
GPIO3 | ADC1_CH2 |
GPIO4 | ADC1_CH3 |
GPIO5 | ADC1_CH4 |
GPIO6 | ADC1_CH5 |
GPIO7 | ADC1_CH6 |
GPIO8 | ADC1_CH7 |
GPIO9 | ADC1_CH8 |
ESP32 -S3上没有DAC-您可以使用PWM或I2S PDM模拟模拟输出。
在电源时,以下引脚有故障。
GPIO1,GPIO2,GPIO3,GPIO4,GPIO5,GPIO6,GPIO7,GPIO7,GPIO8,GPIO9,GPIO9,GPIO10,GPIO10,GPIO11,GPIO11,GPIO12,GPIO13,GPIO14,GPIO14,GPIO14,GPIO15,GPIO15,GPIO16,GPIO16,GPIO17:GPIO17:GPIO17:GPIO17:GPIO17:GPIO17:GPIO17:GPIO17:GPIO17:GPIO17:GPIO17:GPIO17:
GPIO18:
GPIO19,GPIO20:
请参阅此处的表2-2
如果您在运行“您的”软件时会在某些引脚上看到电源的故障,但是在运行一个简单的Hello World时不会,这可能是一个常见的错误:
gpio_reset_pin ( RELAY1_SC );
gpio_set_direction ( RELAY1_SC , GPIO_MODE_OUTPUT );
可以在此处找到此语法:blink_example_main.c
而是使用此语法:
//zero-initialize the config structure.
gpio_config_t io_conf = {};
//disable interrupt
io_conf . intr_type = GPIO_INTR_DISABLE ;
//set as output mode
io_conf . mode = GPIO_MODE_OUTPUT ;
//bit mask of the pins that you want to set,e.g.GPIO18/19
io_conf . pin_bit_mask = ( 1ULL << RELAY1_SC );
//disable pull-down mode
io_conf . pull_down_en = 0 ;
//disable pull-up mode
io_conf . pull_up_en = 0 ;
//configure GPIO with the given settings
gpio_config ( & io_conf );
可以在此处找到此语法:gpio_example_main.c
在某些情况下,PIN默认情况下连接到 +3.3V或 +1.8V功率域。示例是GPIO20(D+)或GPIO48。
您可以在Bootloader的早期阶段关闭它们:
请参阅此处
使用以下代码:
void bootloader_before_init ( void ) {
/* Keep in my mind that a lot of functions cannot be called from here
* as system initialization has not been performed yet, including
* BSS, SPI flash, or memory protection. */
ESP_LOGI ( "HOOK" , "This hook is called BEFORE bootloader initialization" );
gpio_hal_iomux_func_sel ( GPIO_PIN_MUX_REG [ GPIO_NUM_20 ], PIN_FUNC_GPIO );
esp_rom_gpio_pad_select_gpio ( GPIO_NUM_48 );
gpio_ll_output_enable ( & GPIO , GPIO_NUM_48 );
gpio_ll_set_level ( & GPIO , GPIO_NUM_48 , 0 );
}
马克·诺维尔(Mark Nowell)提供了一个非常方便的电子表格,其中包含ESP32-S3模块的列表及其引脚。
引脚名称 | 引脚号 | 类型 | 描述 |
---|---|---|---|
gnd | 1,40 | p | gnd |
epad | 41 | p | gnd |
3v3 | 2 | p | 电源 |
en | 3 | 我 | 高:开启,启用芯片。低:关闭,芯片能力关闭。注意:请勿将EN PIN浮动。 |
GPIO0 | 27 | i/o/t | RTC_GPIO0, GPIO0 |
GPIO1 | 39 | i/o/t | rtc_gpio1, gpio1 ,touch1,adc1_ch0 |
GPIO2 | 38 | i/o/t | rtc_gpio2, gpio2 ,touch2,adc1_ch1 |
GPIO3 | 15 | i/o/t | rtc_gpio3, gpio3 ,touch3,adc1_ch2 |
GPIO4 | 4 | i/o/t | rtc_gpio4, gpio4 ,touch4,adc1_ch3 |
GPIO5 | 5 | i/o/t | rtc_gpio5, gpio5 ,touch5,adc1_ch4 |
GPIO6 | 6 | i/o/t | rtc_gpio6, gpio6 ,touch6,adc1_ch5 |
GPIO7 | 7 | i/o/t | rtc_gpio7, gpio7 ,touch7,adc1_ch6 |
GPIO8 | 12 | i/o/t | rtc_gpio8, gpio8 ,touch8,adc1_ch7,subpics1 |
GPIO9 | 17 | i/o/t | RTC_GPIO9, GPIO9 ,Touch9,ADC1_CH8,FSPIHD,subpihd |
GPIO10 | 18 | i/o/t | RTC_GPIO10, GPIO10 ,Touch10,ADC1_CH9,FSPICS0,FSPIIO4,subpics0 |
GPIO11 | 19 | i/o/t | rtc_gpio11, gpio11 ,touch11,adc2_ch0,fspid,fspiio5,subpid |
GPIO12 | 20 | i/o/t | rtc_gpio12, gpio12 ,touch12,adc2_ch1,fspiclk,fspiio6,subpiclk |
GPIO13 | 21 | i/o/t | rtc_gpio13, gpio13 ,touch13,adc2_ch2,fspiq,fspiio7,subpiq |
GPIO14 | 22 | i/o/t | RTC_GPIO14, GPIO14 ,Touch14,ADC2_CH3,FSPIWP,FSPIDQS,subpiwp |
GPIO15 | 8 | i/o/t | RTC_GPIO15, GPIO15 ,U0RTS,ADC2_CH4,XTAL_32K_P |
GPIO16 | 9 | i/o/t | RTC_GPIO16, GPIO16 ,U0CTS,ADC2_CH5,XTAL_32K_N |
GPIO17 | 10 | i/o/t | RTC_GPIO17, GPIO17 ,U1TXD,ADC2_CH6 |
GPIO18 | 11 | i/o/t | rtc_gpio18, gpio18 ,u1rxd,adc2_ch7,clk_out3 |
USB_D- | 13 | i/o/t | RTC_GPIO19,GPIO19,U1RTS,ADC2_CH8,CLK_OUT2, USB_D- |
USB_D+ | 14 | i/o/t | RTC_GPIO20,GPIO20,U1CTS,ADC2_CH9,CLK_OUT1, USB_D+ |
GPIO21 | 23 | i/o/t | RTC_GPIO21, GPIO21 |
SPICS1 | i/o/t | SPICS1, GPIO26 | |
GPIO33 | i/o/t | GPIO33 | |
GPIO34 | i/o/t | GPIO33 | |
GPIO35 | 28 | i/o/t | SPIIO6, GPIO35 ,FSPID,subpid |
GPIO36 | 29 | i/o/t | SPIIO7, GPIO36 ,FSPICLK,subpiclk |
GPIO37 | 30 | i/o/t | Spidqs, GPIO37 ,FSPIQ,subpiq |
GPIO38 | 31 | i/o/t | GPIO38 ,FSPIWP,subpiWP |
mtck | 32 | i/o/t | mtck ,gpio39,clk_out3,subpics1 |
mtdo | 33 | i/o/t | mtdo ,gpio40,clk_out2 |
mtdi | 34 | i/o/t | mtdi ,gpio41,clk_out1 |
mtms | 35 | i/o/t | MTMS ,GPIO42 |
U0TXD | 37 | i/o/t | U0TXD ,gpio43,clk_out1 |
U0RXD | 36 | i/o/t | u0rxd ,gpio44,clk_out2 |
GPIO45 | 26 | i/o/t | GPIO45 |
GPIO46 | 16 | i/o/t | GPIO46 |
GPIO47 | 24 | i/o/t | spiclk_p_diff, gpio47 ,subpiclk_p_diff |
GPIO48 | 25 | i/o/t | spiclk_n_diff, gpio48 ,subpiclk_n_diff |
对于喜欢视频内容的人 - 您可以在此处观看视频版本: