← index #8336Issue #6496
Related · high · value 2.054
QUERY · ISSUE

STM32H7: PA0 and PA1 ADC returning incorrect values

openby EdgarTheEEopened 2022-02-22updated 2022-02-22
port-stm32

Hello community,
I have a custom stm32H7 board running v1.17 of micropython.
I have noticed that PA0 and PA1 return incorrect ADC values:

from machine import ADC, Pin
adc = ADC(Pin.cpu.A0)
adc.read_u16()

The return value is 5763 (we are expecting ~61722 with a 3.3Vref) the first time "adc.read_u16()" is called. Calling "adc.read_u16()" will then consistently return ~800 after the first call. PA3 and PA4 are working as expected. Are these two pins reserved for a specific function?

CANDIDATE · 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.

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