GPIO36 GPIO Input Glitches With BT/A2DP

besterm
Posts: 14
Joined: Tue Nov 12, 2019 1:44 pm

GPIO36 GPIO Input Glitches With BT/A2DP

Postby besterm » Mon Jun 01, 2020 5:04 pm

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);
Attachments
NewFile0.png
NewFile0.png (2.74 KiB) Viewed 6277 times

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: GPIO36 GPIO Input Glitches With BT/A2DP

Postby WiFive » Tue Jun 02, 2020 4:51 am

I think the Bluetooth driver uses the adc power detect function.

hansBWT
Posts: 5
Joined: Tue Aug 18, 2020 10:43 am

Re: GPIO36 GPIO Input Glitches With BT/A2DP

Postby hansBWT » Tue Aug 18, 2020 10:52 am

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.
Attachments
SCR02.PNG
SCR02.PNG (41.81 KiB) Viewed 6034 times
SCR01.PNG
SCR01.PNG (41.75 KiB) Viewed 6034 times

ESP_Sprite
Posts: 9772
Joined: Thu Nov 26, 2015 4:08 am

Re: GPIO36 GPIO Input Glitches With BT/A2DP

Postby ESP_Sprite » Wed Aug 19, 2020 12:46 pm

Are you using pullups on the GPIOs? If so, what value? Note that these GPIOs do not have internal pull-ups.

hansBWT
Posts: 5
Joined: Tue Aug 18, 2020 10:43 am

Re: GPIO36 GPIO Input Glitches With BT/A2DP

Postby hansBWT » Tue Aug 25, 2020 8:36 am

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.

hansBWT
Posts: 5
Joined: Tue Aug 18, 2020 10:43 am

Re: GPIO36 GPIO Input Glitches With BT/A2DP

Postby hansBWT » Mon Sep 07, 2020 5:20 am

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.

Who is online

Users browsing this forum: Google [Bot] and 97 guests