Page 1 of 1

Can ADC work while wifi is on?

Posted: Wed Apr 03, 2019 2:43 pm
by gpezzella
Hello
from document I read:
Note

Since the ADC2 is shared with the WIFI module, which has higher priority, reading operation of adc2_get_raw() will fail between esp_wifi_start() and esp_wifi_stop(). Use the return code to see whether the reading is successful.
In my code I have

Code: Select all

  WiFi.onEvent(WiFiEvent);
  ETH.begin();
or

Code: Select all

 WiFi.onEvent(WiFiEvent);
 WiFi.begin();
I will have problem?

Re: Can ADC work while wifi is on?

Posted: Thu Apr 04, 2019 2:51 pm
by e2738729
ADC 1 has 8 channels that you can use. Do you need to use more than 8 channels for ADC sampling? It is true that ADC2 does not work if you have Wifi on.
ADC2 is used by the Wi-Fi driver. Therefore the application can only use ADC2 when the Wi-Fi driver has not started.
If you really need more than 8 channels with Wifi on, you probably have to multiplex the existing channels from ADC 1. Or you could use ADC 1 and ADC 2 with Bluetooth for wireless communication.

Khoi