-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
ESP32S3 ULP and ADC reads #10904
Comments
ULP is not supported when using Arduino. |
@Jason2866 the FSM 4bit one can be used @astrogene1000 please ask in the ESP-IDF repo. They know more about the FSM ULP and can help better |
Thx, for the info ULP FSM! Always forget S3 has the old FSM ULP too. |
@me-no-dev I have checked the ESP-IDF repo, the attached is a direct take converted to ESP ULP Macro for loading the ULP. Basically this example simplified to just wake periodically versus on thresholds It is working, just the values out of the ADC are way out of what is expected. The ULP Macro language is shown here My 'workaround' in the actual application is to just read in the INO code in order to BLE advertise to BThome the battery voltage and relegate the ULP to just pulse counting's for the rest of the features that get advertised. At first thought it may be the power domain's being shut down as BLE enabled/disabled programatically as it goes into/out of deep sleep for power consumption so then just pared app down to the attached which basically does not much of anything. Gene. |
Seems the doc's do not match up with the MACRO definitions for ULP adc_idx selects ADC (0 or 1). pad_idx selects ADC pad (0 - 7) But looking at the macro itself, it auto adds + 1 to the pad Compared to IDF assembler for the ULP, From IDF example: adc r1, 0, adc_channel + 1 |
Board
ESP32S3-Zero
Device Description
ESP32S3-Zero
Board Setting: ESP32S3 Dev Module
Hardware Configuration
GPIO 7 = ULP ADC 6
Voltage divider to GPIO 7
5V->10k->GPIO7->3.7k->GND
Version
v3.0.7
IDE Name
Arduino 1.8.14
Operating System
W11
Flash frequency
40Mhz
PSRAM enabled
yes
Upload speed
921600
Description
If I do not attempt reading the ADC using the ULP but rather use Arduino analogRead I get expected results
In attached sketch, see
#define DO_ARDUINO_ADC
To switch from Arduino analogRead to ULP read of ADC
Results Arduino analogRead
Not ULP wakeup
ADC Value in Setup = 1624
ADC Value in Loop = 1627
ADC Value in Loop = 1620
ADC Value in Loop = 1623
...
When running the sketch with the ULP doing the read's of the ADC
Results ULP reading ADC
Not ULP wakeup
I= 0 V= 11
I= 1 V= 10
I= 2 V= 13
I= 3 V= 11
I= 4 V= 12
ULP Wakeup
Val= 18
Val= 19
Val= 19
Val= 18
Val= 19
Sketch
Debug Message
Other Steps to Reproduce
Sketch:
ulp1-2-test.zip
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: