cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 direct channel

A.Caliskan
Associate II

i am using stm32h723zg nucleo board, I'm using adc's direct channe, h723zg have only PC2_C,PC3_C,.

Firs ı use this function and no noise>LL_SYSCFG_CloseAnalogSwitch(LL_SYSCFG_ANALOG_SWITCH_PC2|LL_SYSCFG_ANALOG_SWITCH_PC3);

second ı use this function and ıts have noise->

 LL_SYSCFG_OpenAnalogSwitch(LL_SYSCFG_ANALOG_SWITCH_PC2|LL_SYSCFG_ANALOG_SWITCH_PC3);

What is the reason for the noise in the second function?,

I can only resolve the noise in the second one by increasing the resolution ratio.

no noise at low resolution in the first

7 REPLIES 7
TDK
Guru

Noise is not a binary thing. How much noise do you see in each case? What signal are you monitoring? Adding capacitance on the line, which is a side of effect of closing the switch, will act to stabilize the value.

If you feel a post has answered your question, please click "Accept as Solution".

I'm reading pc2_c and pc3_c with the timer, when I use the first function it returns 4095 at 3.3v on both channels.,

when I use the second function. At 3.3v pc2_c returns 4095 and pc3_c returns 4086. This only happens when I use the second function

resulation 12 bit

TDK
Guru

> At 3.3v pc2_c returns 4095 and pc3_c returns 4086.

Okay, so zero counts of noise? Same exact value every time you call the ADC? How are PC2 and PC3 configured? How is the ADC configured? Lots of missing data here.

Read:

https://www.st.com/resource/en/application_note/cd00211314-how-to-get-the-best-adc-accuracy-in-stm32-microcontrollers-stmicroelectronics.pdf

If you feel a post has answered your question, please click "Accept as Solution".

no missing information,,

yes it gives more or less the same values, You don't need an extra definition for direct channels, they are already defined as analogue. What I don't understand here is that the noise changes with the switch state. it seems to me that there should be no noise in the second function

ADCs are not perfect measurement devices and are subject to the circuit around them. If you don't want to provide that, I'm not interested in guessing. I will only say that the configuration and capacitance of PC2 and PC3 will affect the measurement when the switch is closed. Good luck.
If you feel a post has answered your question, please click "Accept as Solution".

You're commenting without even understanding what I'm asking. good luck