2024-12-15 04:00 PM - last edited on 2024-12-23 07:36 AM by Andrew Neil
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)
2024-12-23 07:12 AM
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"
2024-12-24 12:25 AM
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.
2024-12-24 12:27 AM
"5. I changed sampling time, but the result did not change."
-> what value you set?
2024-12-24 12:33 AM
I tried setting below:
・ADC_SAMPLETIME_3CYCLES
・ADC_SAMPLETIME_28CYCLES
・ADC_SAMPLETIME_480CYCLES
2024-12-24 01:00 AM
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.
and according to the board schematics, PA1 is connected to RMII_REF_CLK!
You need free IOs to measure an external voltage.
That's why you need always to check the schematics before using a board.
2024-12-24 04:37 PM
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()」
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.
2024-12-25 12:17 AM - edited 2024-12-25 05:51 AM
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.