Is it possible to disable ADC?

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
shaoziyang
Posts: 363
Joined: Sun Apr 17, 2016 1:55 pm

Is it possible to disable ADC?

Post by shaoziyang » Thu Apr 08, 2021 4:47 am

Is it possible to disable ADC function after use ADC to reduce power in sleep mode?

User avatar
OlivierLenoir
Posts: 126
Joined: Fri Dec 13, 2019 7:10 pm
Location: Picardie, FR

Re: Is it possible to disable ADC?

Post by OlivierLenoir » Thu Apr 08, 2021 7:36 am

Did you try to deinit ADC and Pin?

Code: Select all

from machine import ADC

pin_adc = Pin(32)
adc = ADC(pin_adc)

# your code

adc.deinit()
pin_adc.deinit()
or maybe this method:

Code: Select all

from machine import ADC

adc = ADC(Pin(32))

# your code

adc.deinit()

shaoziyang
Posts: 363
Joined: Sun Apr 17, 2016 1:55 pm

Re: Is it possible to disable ADC?

Post by shaoziyang » Thu Apr 08, 2021 8:02 am

There is no deinit() method in ESP32's ADC now.

shaoziyang
Posts: 363
Joined: Sun Apr 17, 2016 1:55 pm

Re: Is it possible to disable ADC?

Post by shaoziyang » Thu Apr 08, 2021 8:35 am

Finally I found a way to disable ADC by set registry 0x3FF4880C.

Code: Select all

def disableADC():
    mem32[0x3FF4880C] &= 0xFFF3FFFF
    mem32[0x3FF4880C] |= 0x00020000

Post Reply