Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TW#17849] GPIO36 and 39 ADC noise and cross coupling #1517

Closed
jmorsap opened this issue Jan 18, 2018 · 5 comments
Closed

[TW#17849] GPIO36 and 39 ADC noise and cross coupling #1517

jmorsap opened this issue Jan 18, 2018 · 5 comments

Comments

@jmorsap
Copy link

jmorsap commented Jan 18, 2018

I am having some funny behavior when using GPIO36 and 39 as normal adc inputs. I use the following setup code

	adc1_config_width(ADC_WIDTH_12Bit);
	gpio_set_direction(MY_INPUT, GPIO_MODE_INPUT);
	adc1_config_channel_atten(MY_INPUT,ADC_ATTEN_11db);
        gpio_set_direction(MY_INPUT2, GPIO_MODE_INPUT);
	adc1_config_channel_atten(MY_INPUT2,ADC_ATTEN_11db);

and just loop either of the the following sections

`

vTaskDelay(delayms/portTICK_PERIOD_MS); //adc takes almost no time (a few uS)

printf("%d,%d \r\n",mycase ,adc1_get_voltage(MY_INPUT));`

`
vTaskDelay(delayms/portTICK_PERIOD_MS); //adc takes almost no time (a few uS)

printf("%d,%d \r\n",mycase ,adc1_get_voltage(MY_INPUT2));`

I get a pretty noisy signal, and when I check gpio39 with the scope, I can see that the line is getting pulled low. I've confirmed that this only occurs when the adc1_get_voltage is used and is not caused by the printf command. The problem is caused on both pins by using the ADC on either pin.

ds1z_quickprint4
a closer look
ds1z_quickprint5

Also, grounding GPIO36 appears to affect the noise on GPIO39.

Any thoughts on what is causing this and any solutions or workarounds? Right now the plan is to redesign our whole board to not use these pins, but we would of course prefer not to do that.

@negativekelvin
Copy link
Contributor

There is something with the LNA and SAR state machine but these are basically undocumented black boxes and the LNA got removed from the datasheet recently so who knows what is happening with it.

@costaud
Copy link
Collaborator

costaud commented Jan 22, 2018

We have found the cause of this issue, will fix this soon.

@ESP32DE
Copy link
Contributor

ESP32DE commented Jan 22, 2018

@costaud
you are alive, thought you did not exist anymore
good - same here . wait for the fix

@costaud
Copy link
Collaborator

costaud commented Jan 22, 2018

@ESP32DE Oh yeah, nice to meet you again too. Seems like I just get back from a wormhole : )

@FayeY FayeY changed the title GPIO36 and 39 ADC noise and cross coupling [TW#17849] GPIO36 and 39 ADC noise and cross coupling Jan 23, 2018
@negativekelvin
Copy link
Contributor

Bug list has been updated:

3.11. When the power switch which controls the temperature sensor, SARADC1 sensor, SARADC2 sensor, AMP sensor, or HALL sensor, is turned on, the inputs of GPIO36 and GPIO39 will be pulled down for about 80 ns.

@FayeY FayeY closed this as completed Mar 12, 2018
igrr pushed a commit that referenced this issue Apr 6, 2018
…conversion.

refactor structure of ``rtc_module.c`` to make it more clearly.

Closes #1517
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants