-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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#12146] ADC2 driver (IDFGH-845) #461
Comments
@FFtust study the register and compare the thing with adc1. then check the header for adc right, you see, there is just in time only support adc1 then look up in the c file for , where adc is at home if you can not wait for official support adc2 then you must do this steps:
... everything too much trouble?, then here you are welcome to test this repo
like this - and in the followed PR is a demo code for you - and an output that the adc2 is working for you - how cool is that ? 👍 pullrequest is done. hope this helps |
Well done, just need it. |
For me adc2 works fine until I enable wifi. adc2 stops working then. Same issue when using the esp32-arduino libraries. Could this be the reason why adc2 isn't available in esp-idf? |
Exactly! WiFi driver uses some of the ADC2 circuitry. So the code in the PR can indeed be used when WiFi/BT are disabled, otherwise controlling ADC2 from software may interfere with WiFi. Supporting simultaneous WiFi and ADC2 operation is not something we have plans to support, for now. We will however add an ADC2 driver which may be used if WiFi is not in use. |
Quoting @20leunam: "Then we will chop off the antenna, and plug an external bluetooth module to TX/RX!" :) Do you think it may at least be possible to live-disable WiFi momentarily, in order to measure ADC2, and re-enable wireless it afterwards? Or is the adc2 locked at boot time? |
Yes, this should be possible. We'll need to make sure that WiFi/PHY initialization code resets all the ADC2 registers into the expected state during initialization (this may not be the case now), but aside from that, disabling WiFi (using esp_wifi_stop/esp_wifi_deinit) to do the measurement should be possible. |
Would like to do that very much, too. |
Yes possibly down to two if you use pre amp and 32khz. Would be nice to have even low rate async adc2 read possible in cooperation with the WiFi driver. |
I am trying to read from ADC2 after enabling and disabling wifi. So far I've tested multiple combinations of esp_wifi_stop, esp_wifi_deinit, esp_phy_rf_deinit to disable the wifi driver. Since @igrr mentioned restoring back ADC registers to default state, I've also force re-run the ADC initialization routines in Arduino-ESP32, after wifi had been disabled. I've run out of ideas. Please let me know if you think of other ways to achieve this. I'd be happy to test them! |
I'm making a connected sensor that uses most of the ADC pins, and for the moment my approach is going to consist in:
This is very ugly. So I am hoping it will be possible to achieve it in a clean way at some point :) |
Can we have a clarification about ADC2, please? Is it a matter of an hardware limitation and WiFi cannot work together with ADC2, or simply there's no support for ADC2 right now? Can we expect to have ADC2 available in the future or it's simply impossible? |
ADC2 can be used together with WiFi on a time sharing basis. I.e. WiFi stack uses ADC2 for its own purposes, but also allows the application to poll ADC2 using some API. Such scheme is not implemented yet, and will not be part of the upcoming release. |
What about using esp_wifi_stop/esp_wifi_deinit to do the measurement, do you advise to wait until the proper driver is ready? |
Hello,
The answer will influence my project design. Waiting for a feedback! |
Hello, |
None of the ADC2 channels connected to external pads are used by WiFi driver. There is a mux which is used to connect other internal signals to ADC2 input. Digital pins connected to ADC2 pins should not have any effect on WiFi. |
|
Hi, i want to use the adc1 and adc2 channels from esp32 integrated with the bluetooth, i'm using the spp_counter from bluekitchen as a base code, this is the repo with the code: Best Regards |
Sorry if this is a stupid question, but d30f3e7 only contains test code as far as I see. Are there further changes to use adc2 in connection with wifi? |
Doesn't seem like what would expected from coexistence |
That's not coexistence with WiFi yet. This just allows using ADC2 when WiFi
is disabled, and prevents collisions between app and wifi driver if someone
tries to use ADC2 with WiFi enabled. Full coexistence is still being
developed.
…On Tue, Oct 31, 2017, 13:02 negativekelvin ***@***.***> wrote:
Doesn't seem like what would expected from coexistence
<espressif/esp32-wifi-lib@a3c8f34>
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#461 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEJceqRvm-6F2GNP5ZVjY3hPUdcE6JhDks5sxqndgaJpZM4Mpx1H>
.
|
Is there another issue I can watch to get notified on coexistence? |
Let's keep this one open until coexistence with WiFi is available. |
Thanks a lot @igrr |
I know it's annoying, but: Is there a time-estimate on when coexistence will be available? |
I'm finding my use limited by this issue too. I wasn't using WiFi for my project but BLE, and apparently it runs into the same problem. |
Anything new here? Would be a nice christmas present ;) |
I'm also very interested in an estimated release date of this feature (ADC2 and WiFi at once). Additionally, I don't think this limitation is documented in the datasheet at the moment. It would be great if it could be! I've got an otherwise production ready design on my desk that I'm going to have to re-route as I didn't notice this limitation ahead of time. EDIT: As per this forum post: https://www.esp32.com/viewtopic.php?f=2&t=4220&p=19084 it's likely to be supported in version 3.1, releasing around early/mid March. Hurrah! |
Hi! I've just got stuck with exactly the same problem with BLE. I have 16 ADCs running from ADC1 and ADC2 banks. They all work as expected till the moment when I initialize BLE - then suddenly all 10 ADCs from bank ADC2 stop working but ADCs from 1st bank work as usual. It is crucial to me to have 16 ADCs and BLE to function alltogether. Is there any chance to get them work simultaniously? |
Anything new on this topic? |
Hi, I have a problem like this one... |
@liuzfesp Hi, would you help share if any updates? Thanks. |
* Update esp32-hal-uart.c * Two Stop Bit Workaround see https://github.com/espressif/esp-idf/blob/master/components/driver/uart.c lines 118-127
In order to fix espressif/arduino-esp32#102 (comment) we would just need a method that allows to reset the ADC2 without having to reset the whole board. Any chance to achieve this, or is it a silicon bug? |
The Issue ** still exist until 2021 ** more than 4 year.. void setup() { while (WiFi.status() != WL_CONNECTED) {
} void loop() { ` |
As this issue is still open and the fact that I needed both the wifi and the ADC2 on my ESP32 project, I started testing on some of the ESP-IDF examples. I wanted to sample on the ADC2, start and communicate on the wifi, close and cleanup the wifi and then start all over. The aim was not having to re-boot the system when switching from analog to digital conversion, on ADC2, to communicating on wifi and vice versa. |
The text was updated successfully, but these errors were encountered: