Config GPIO32 as output gpio

gigijoe
Posts: 21
Joined: Wed Aug 02, 2017 10:16 am

Config GPIO32 as output gpio

Postby gigijoe » Thu Aug 24, 2017 9:10 am

Hello

I config four GPIO as output pull high (GPIO 12,13,14,32)
GPIO 12,13,14 all work well, but GPIO32 is always low ...

Code: Select all

    gpio_config_t io_conf;
    io_conf.intr_type = GPIO_PIN_INTR_DISABLE;
    io_conf.mode = GPIO_MODE_OUTPUT;
    io_conf.pin_bit_mask = GPIO_SEL_12 | GPIO_SEL_13 | GPIO_SEL_14 | GPIO_SEL_32;
    io_conf.pull_down_en = GPIO_PULLDOWN_DISABLE;
    io_conf.pull_up_en = GPIO_PULLUP_DISABLE;
    gpio_config(&io_conf);

	gpio_set_direction(GPIO_NUM_12, GPIO_MODE_OUTPUT);
	gpio_set_direction(GPIO_NUM_13, GPIO_MODE_OUTPUT);
	gpio_set_direction(GPIO_NUM_14, GPIO_MODE_OUTPUT);

	/* gpio32 route to digital io_mux */
	REG_CLR_BIT(RTC_IO_XTAL_32K_PAD_REG, RTC_IO_X32P_MUX_SEL);
	
	gpio_set_direction(GPIO_NUM_32, GPIO_MODE_OUTPUT);

	gpio_set_level(GPIO_NUM_12, 1);
	gpio_set_level(GPIO_NUM_13, 1);
	gpio_set_level(GPIO_NUM_14, 1);
	gpio_set_level(GPIO_NUM_32, 1);
The debug message show NO errors

I (4054) gpio: GPIO[12]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (4063) gpio: GPIO[13]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (4072) gpio: GPIO[14]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (4082) gpio: GPIO[32]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0

I'm working with PSRAM SDK

Any idea ?

ESP_igrr
Posts: 2071
Joined: Tue Dec 01, 2015 8:37 am

Re: Config GPIO32 as output gpio

Postby ESP_igrr » Thu Aug 24, 2017 9:40 am

Which development board are you using? In case you are working with WROVER-KIT, it has GPIOs 32 and 33 connected to 32k XTAL by default. You can change a couple of zero-ohm resistors if you want to route them to the pin headers instead (look for two unpopulated landing patterns next to the 32k XTAL).

gigijoe
Posts: 21
Joined: Wed Aug 02, 2017 10:16 am

Re: Config GPIO32 as output gpio

Postby gigijoe » Thu Aug 24, 2017 9:59 am

I'm working with WROVER-KIT

The GPIO32 is NOT connect to 32k XTAL due to R12 is NOT mount by default

Any idea ?

ESP_igrr
Posts: 2071
Joined: Tue Dec 01, 2015 8:37 am

Re: Config GPIO32 as output gpio

Postby ESP_igrr » Thu Aug 24, 2017 10:59 am

The GPIO32 is NOT connect to 32k XTAL due to R12 is NOT mount by default
R12 is the resistor between R_IO32 (the net which connects to GPIO32 on the WROVER module) and IO32 (the net which connects to the header). You seem to be confusing it with R11, which is the one between R_IO32 (i.e. module pin) and 32K_XP (XTAL pin).
Screen Shot 2017-08-24 at 18.54.56.png
Screen Shot 2017-08-24 at 18.54.56.png (77.86 KiB) Viewed 11146 times
To work with XTAL, you need to have R11 and R23 mounted. This is the default.

To connect GPIO32 and GPIO33 to the pin header, you need to have R12 and R24 mounted.

gigijoe
Posts: 21
Joined: Wed Aug 02, 2017 10:16 am

Re: Config GPIO32 as output gpio

Postby gigijoe » Thu Aug 24, 2017 11:19 am

OK, I understand. My mistake

One question, do I need 32k XTAL ? What is it for ?

I'm run out of GPIO, so change to other I/O port is not possible.

Thank you

ESP_igrr
Posts: 2071
Joined: Tue Dec 01, 2015 8:37 am

Re: Config GPIO32 as output gpio

Postby ESP_igrr » Thu Aug 24, 2017 12:47 pm

32k XTAL is used to provide RTC with precise clock source.

If you don't need to maintain precise time during deep sleep, you can keep using RTC with the internal clock source (which is the default). This internal clock source can drift up to 5%, while 32k XTAL usually drifts no more than 0.005%

Who is online

Users browsing this forum: No registered users and 358 guests