← index #6496Issue #10585
Off-topic · high · value 0.588
QUERY · ISSUE

STM32H7 ADC inaccuracy

openby faxmachine619opened 2020-09-28updated 2024-09-10
port-stm32

Hi,

I have noticed the machine module (machine.ADC class) returns a raw ADC value that is consistently off by about 1000 counts too high. I have noticed this inaccuracy on the Nucleo_H743ZI2 and as well as my own custom board. I can definitely rule out PIN input impedance as the culprit because I am using voltage followers. This seems like an offset issue, but going through the adc.c, it looks like no offset was set:

https://github.com/micropython/micropython/blob/0fd0eb00aa5b9d311046d48d73a8cfabb30d7dd6/ports/stm32/adc.c#L346

Please advise.

CANDIDATE · ISSUE

ESP32S3 ADC Pins not working

closedby TGiles1998opened 2023-01-25updated 2023-10-23
bugport-esp32

Hi,

When trying to read an adc value from the adc pins on the esp32s3 I get the following output:

from machine import ADC
adc = ADC(machine.Pin(7, machine.Pin.IN))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: invalid bits

same error for

adc = ADC(Pin(7))

and

pin = machine.Pin(7)
adc = ADC(pin)

Looking at the C code I notice that there is a CONFIG_IDF_TARGET_ESP32S3

https://github.com/micropython/micropython/blob/master/ports/esp32/machine_adc.c

Is there a reason this shouldnt work?

Thanks,

Thomas

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied