Page 1 of 1

GPIO36 GPIO Input Glitches With BT/A2DP

Posted: Mon Jun 01, 2020 5:04 pm
by besterm
I am using GPIO36 as a button input. It normally works fine. If I enable bluetooth audio I notice very fast pull-down pulses. These pulse occur about 0.5sec rate when BT A2DP isn't connected to my phone. When it initially connects to my phone, the glitches still occur at the same rate. If I then start to stream audio from my phone, the glitches do not occur. When I pause the audio from the phone, the glitches will occur very quickly (many times per second). This continues until I start streaming audio again from the phone, then the glitches go away. I have read that Wifi and ADC peripherals can cause this type of issue. I am not using these peripherals. Any ideas on why these glitches seem to occur with my BT activity? I attached a waveform of the glitch. GPIO36 pin has an external 10K pull-up to 3.3V.

Here is the init code for GPIO36:

gpioConfig.intr_type = GPIO_INTR_NEGEDGE;
gpioConfig.mode = GPIO_MODE_INPUT;
gpioConfig.pull_up_en = GPIO_PULLUP_DISABLE;
gpioConfig.pull_down_en = GPIO_PULLDOWN_DISABLE;
gpioConfig.pin_bit_mask = 1ULL << PWR_BTN_PIN; /* GPIO36 */
gpio_config(&gpioConfig);

Re: GPIO36 GPIO Input Glitches With BT/A2DP

Posted: Tue Jun 02, 2020 4:51 am
by WiFive
I think the Bluetooth driver uses the adc power detect function.

Re: GPIO36 GPIO Input Glitches With BT/A2DP

Posted: Tue Aug 18, 2020 10:52 am
by hansBWT
Hi @besterm
I have a similar observation with GPIO36/39 in combination with bluetooth. We are using GPIO36/39 as inputs from flow sensors that basically generate pulses in a range from 100-2kHz on named inputs. Once we activate the bluetooth module and connect to the device through BLE, we can observe pulses on GPIO36/39 simultaneously. The pulses have a duration of about 13µs and a period of 30ms. If we deactivate the PCNT inputs on GPIO36/39 we can still see the pulses, once we deactivate the bluetooth module in our code, we do not see the pulses any more. Used module is ESP32-WROOM-32D. The ripple that can be seen on SCR02.PNG is related to the dcdc we are using in supply.

Re: GPIO36 GPIO Input Glitches With BT/A2DP

Posted: Wed Aug 19, 2020 12:46 pm
by ESP_Sprite
Are you using pullups on the GPIOs? If so, what value? Note that these GPIOs do not have internal pull-ups.

Re: GPIO36 GPIO Input Glitches With BT/A2DP

Posted: Tue Aug 25, 2020 8:36 am
by hansBWT
Yes I am using external pull-ups. Tested with 10k and 100k. No change in the pulses observed.
I've also tested with other modules we have in house ESP32-WROVER-B with the same observation.

Re: GPIO36 GPIO Input Glitches With BT/A2DP

Posted: Mon Sep 07, 2020 5:20 am
by hansBWT
Hi,

I managed to find more time for testing. The issue can be observed on all gpio pins on the modules. The shown glitches are only visible on GPIO39 and GPIO36 with the oscilloscope but function wise all other pins are also affected. By curiosity sake I activated the filter module https://docs.espressif.com/projects/esp ... t8uint16_t with different values 1-1023. Once activated, regardless the setting, the counter works as intended. Except for deactivating the filter with a 0 value. The observed glitches are still there but logic wise the glitches are now neglected. I think therefore this is a hardware feature/bug.