cancel
Showing results for 
Search instead for 
Did you mean: 

Malfunction of ADC123_IN1 in Nucleo-F756ZG

Ryosuke
Associate II

I'm in trouble with the high err rate of ADC123_IN1 in "STM32 Nucleo-144 development board with STM32F756ZG MCU".

I've purchased two of the same thing, and both of them have trouble in ADC123_IN1.

I had tried 4 channels: ADC123_IN1, ADC123_IN4, ADC123_IN8, ADC123_IN2, but only ADC123_IN1 has high err rate.

Could you tell me how to get ADC value accurately.

I attached ADC measurement results just in case. (ADC_measurement_results.PNG)

7 REPLIES 7
SofLit
ST Employee

Hello,

You need to check first what is connected to each channels? did you check the board schematics? what is the voltage sources? what is the value of the sampling time? 

Please also review this application note AN2834 "How to optimize the ADC accuracy in the STM32 MCUs"

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Hello, thank you for your response.

1. I connected ADC123_IN1 directly to GND/3.3V on the development board via wires. Please reference attached file(Situation of Checking.pptx).
2. I had checked the board schematics, but it did not help me solve the problem. The URL of the board schematics is below.(STMhttps://www.st.com/en/evaluation-tools/nucleo-f756zg.html#cad-resources)
3. The voltage is obtained from the development board. Please reference attached file(Situation of Checking.pptx).
4. The value of the sampling time is set like below:
「sConfig.SamplingTime = ADC_SAMPLETIME_3CYCLES;」

 

I also read the document "How to optimize the ADC accuracy in the STM32 MCUs", and I tried what I can do from the document.

5. I changed sampling time, but the result did not change.

6. in order to minimize the CPU internal noise during ADC sampling, I set interrupt-enable-process and clock-stop-process before ADC sampling. But the result did not go well.

 

If you have any advise, could you please tell me.

"5. I changed sampling time, but the result did not change."

-> what value you set?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

I tried setting below:

・ADC_SAMPLETIME_3CYCLES

・ADC_SAMPLETIME_28CYCLES

・ADC_SAMPLETIME_480CYCLES

I've already suggested to check the schematics

"You need to check first what is connected to each channels? did you check the board schematics? "

From the datasheet: ADC123_IN1 corresponds to PA1.

SofLit_0-1735030536818.png

and according to the board schematics, PA1 is connected to RMII_REF_CLK!

SofLit_1-1735030756531.png

You need free IOs to measure an external voltage.

That's why you need always to check the schematics before using a board.

 

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Thank you for the information.

It looks like I already have set PA1 to ADC123_IN1 in function "HAL_ADC_MspInit()" line 94 to 97 like a picture below.

「main()→MX_ADC1_Init()→HAL_ADC_Init()→HAL_ADC_MspInit()」

Ryosuke_1-1735086156015.png

 

Furthermore, I checked the GPIOA_MODER register and confirmed that PA1 is in analog mode (0x03) just to be sure.

 

If I need any other setting, could you tell me.

Sorry I didn't understand your reply.

PA1 should not be used in this board as ADC input. RMII_REF_CLK is also injected to the ADC input according to the boards schematics I shared above. So need to use another GPIO. 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.