cancel
Showing results for 
Search instead for 
Did you mean: 

How to get PA0 connected to ADC on STM32H5?

jeremierafin
Associate II

First of all, I am not using CUBE IDE, this is a bare metal.
Second: STM32H523. ADC (continuous mode; DMA). ADC is configured on PA0 (i.e. INP1, single-ended), GPIO configuration is analog mode.

On the pin I can probe (oscilloscope) my signal (correct amplitude): a sinus. But the data (from DMA) is noise.

Configured with PA1, all works fine (so my soft is ok). Using ADC1 or ADC2 does not change anything.

Second observation: with PA0, the DC is not fixed (floating pin), but configured on PA1, the pin is DC-driven (about VDDA/2, high impedance).

=> For these reasons, I have the feeling PA0 is not connected to ADC. I can't find anything in registers/documentation/erratas explaining this (on H7 there is some analog switches, but nothing for H5).

Any clue? Thanks!

 

1 ACCEPTED SOLUTION

Accepted Solutions
NesrynELMK
ST Employee

Hello @jeremierafin 

 

Please verify that the OP0 bit in the ADC_OR register is actually set to 1 after initialization.

 

Kind regards,

 

View solution in original post

2 REPLIES 2
NesrynELMK
ST Employee

Hello @jeremierafin 

 

Please verify that the OP0 bit in the ADC_OR register is actually set to 1 after initialization.

 

Kind regards,

 

jeremierafin
Associate II

Actually, that was my missing configuration :)

Thanks a lot!!!