ESP32-S3 ADC1 drop down the voltage when read value (NuttX only)

shizacat
Posts: 1
Joined: Sat Nov 16, 2024 7:16 am

ESP32-S3 ADC1 drop down the voltage when read value (NuttX only)

Postby shizacat » Sat Nov 16, 2024 8:17 am

Hello!
Please help me. I don't understand what happen.
I'm reading the value from ADC1, but at the moment I'm trying to read the value, the voltage on the pin to be dropping.
Usage os NuttX: 12.7.0. On Arduino all work fine.

I tried to compare registers with arduino, but all same...

Board: ESP32-S3 devkit
OS: NuttX
adc mode: one short

Link on driver adc on nuttx: https://github.com/apache/nuttx/blob/ma ... 32s3_adc.c
I add only this code into 441 line (adc_samplecfg function):
  1.   /* Select RTC control */
  2.   regval = getreg32(SENS_SAR_MEAS1_MUX_REG);
  3.   regval &= ~(SENS_SAR1_DIG_FORCE_M);
  4.   // regval |= (0 << SENS_SAR1_DIG_FORCE_S);  // 1: Select digital control; 0: Select RTC control.
  5.   putreg32(regval, SENS_SAR_MEAS1_MUX_REG);
Output from console:
  1. nsh> adc -n 2
  2. Sample:
  3. 1: channel: 0 value: 1727
  4. Sample:
  5. 1: channel: 0 value: 1534
Attachments
img2.jpeg
Level after read value
img2.jpeg (282.05 KiB) Viewed 313 times
img3.jpeg
Level before read value
img3.jpeg (252 KiB) Viewed 313 times
img1.jpeg
Connection the board
img1.jpeg (297.83 KiB) Viewed 313 times

Who is online

Users browsing this forum: No registered users and 61 guests