I can not control the gpio 11

Troy Mitchell
Posts: 16
Joined: Fri Aug 16, 2024 1:55 am

I can not control the gpio 11

Postby Troy Mitchell » Mon Sep 02, 2024 12:54 pm

Chip: esp32c3 FN4

I set gpio11 to switch the level once every second, but in the end I only got a voltage of about 3v3 to 3v0.

I think the code is ok because I changed 11 to 21 (21 is connected to an led) and everything works fine.

BTW: On the chip, gpio11 is the VDD_SPI identifier.

Code:

```c
gpio_config_t cfg;
cfg.mode = GPIO_MODE_OUTPUT;
cfg.pull_up_en = GPIO_PULLUP_ENABLE;
cfg.pull_down_en = GPIO_PULLDOWN_ENABLE;
cfg.pin_bit_mask = 1ull << GPIO_NUM_11;
gpio_config(&cfg);

while (1) {
s_led_state = !s_led_state;
gpio_set_level(GPIO_NUM_11, s_led_state);
vTaskDelay(CONFIG_BLINK_PERIOD / portTICK_PERIOD_MS);
}
```

MicroController
Posts: 1734
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: I can not control the gpio 11

Postby MicroController » Wed Sep 04, 2024 10:54 am

From the C3's datasheet:
By default VDD_SPI is the power supply pin for in-package and off-package flash. It can be reconfigured as a GPIO pin, if the chip
is connected to an off-package flash, and this flash is powered by an external power supply
As the FN4 has in-package flash powered via VDD_SPI/"GPIO11" you cannot use GPIO11.

Who is online

Users browsing this forum: No registered users and 70 guests