Malfunction of ADC123_IN1 in Nucleo-F756ZG
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-12-15 4:00 PM - last edited on 2024-12-23 7: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)
Solved! Go to Solution.
- Labels:
-
ADC
-
STM32F7 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-12-27 12:13 AM
Because MDIO is bidirectional and when you you did the measure, it's not forcing the voltage of PA2 but need also to remove SB160.
So please remove SB13 and redo the test on PA1 and tell what you found.
Apart of forcing the voltage from outside of the pin there is also the impedance that will influence the ADC impedance input.
So please remove all the connections to these pins for a good ADC conversion.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-12-23 7: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"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-12-24 12:27 AM
"5. I changed sampling time, but the result did not change."
-> what value you set?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-12-24 12:33 AM
I tried setting below:
・ADC_SAMPLETIME_3CYCLES
・ADC_SAMPLETIME_28CYCLES
・ADC_SAMPLETIME_480CYCLES
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-12-24 1: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-12-24 4: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-12-25 12:17 AM - edited 2024-12-25 5: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-12-26 9:16 PM
Do you mean that PA1 of "STM32 Nucleo-144 development board with STM32F756ZG MCU" always works as RMII_REF_CLK, and we cannot select any other function than RMII_REF_CLK?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-12-26 11:46 PM - edited 2024-12-26 11:47 PM
Please review the schematics.
You can't use PA1 unless you remove the solder bridge SB13 to disconnect RMII_REF_CLK. SB13 is closed by default.
