Page 1 of 1

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

Posted: Sat Nov 16, 2024 8:17 am
by shizacat
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