2025-06-11 12:53 AM - edited 2025-06-11 2:15 AM
Hi everyone,
I’m currently working with the STM32N6570-DK board and trying to read an analog signal using the ADC1/2 INP8 channel (PB10) using the MB1280C Fanout board (Pin 13) with STMOD+ connector. However, I'm consistently getting a value around 2000 (high impedance value), regardless of whether I connect the pin to GND or a 1.8V source.
For reference, I’ve used similar code on the STM32F441-RE board where it works perfectly, so I suspect this might be related to board-specific settings.
I’m attaching my full project for reference.
2025-06-11 2:32 AM
Have you checked that the expected voltage is actually arriving at the ADC input pin on the STM32 package ?
Have you checked the board schematics and/or User Manual to check that there's nothing else on the board using your chosen pin?
2025-06-11 2:52 AM
HI @Andrew Neil,
Thank you for replying.
I have checked the User manual and schematics and also tried with INP18 which was mapped on PA5 A0 (CN7 connector). I have been using the UM3300 user manual and RM0486 Reference manual for the configurations.
Kindly help.
2025-06-11 3:19 AM - edited 2025-06-11 3:22 AM
And have you checked that the expected voltage is actually arriving at the ADC input pin on the STM32 package ?
If the voltage is not reaching the pin, then the ADC won't be able to read it!
2025-06-11 4:18 AM - edited 2025-06-11 4:22 AM
I don't know which is the PB10 pin on the STM package as it has a VFBGA structure and i can't access those pins. But I have checked that SB16 0 ohm resistor is present and it is soldered, which was necessary to enable that ADC.
2025-06-11 4:36 AM
So check at the nearest accessible point to the pin.
2025-06-11 5:42 AM
> ADC1/2 INP8 channel (PB10) using the MB1280C Fanout board (Pin 13)
Pin 13 is connected to PC9, not PB10. Or am I missing something?
2025-06-11 9:36 PM
Hello @athern27
I'm referring to UM3300 Table 13. STMod+ connector (CN4) pinout.
On the STMOD+, Pin #13 share PC9 (digital GPIO) and PB10 ADC. There are SB9 and SB16 to check.
In the MB1939 schematic, page 9, PB10 is also shared between STMOD_ADC and Arduino A5 connector.
If you need PB10 ADC on STMOD+, check if SB9 is soldered and SB16 must be open (to isolate PC9)
You can also use PB10 on the Arduino CN7 pin #6 (A5R).
https://www.st.com/en/evaluation-tools/stm32n6570-dk.html#cad-resources
You can apply an input voltage = 3.3V thank to the opamp U6B + resistor voltage divisor R83/R84 (which decrease 3.3V with ratio 0.45, the PB10 ADC input will see 1.79V)
In your code, check first your ADC conversion using fixed value (exemple 1V), read ADC1 data register. You will expect to obtain:
1.0V/VREF * 4095 * 0.45 = 1023 lsb (with VREF=1.8V)
If it doesn't work, mesure PB10 using oscilloscope or voltmeter on STMOD+ or Arduino A5 pin.
Refer and try to existing examples in STM32Cube_N6_v1.1.0
https://github.com/STMicroelectronics/STM32CubeN6/tree/main/Projects/NUCLEO-N657X0-Q/Examples/ADC
Share your code.
Good luck.
Best regards,
Romain,
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.
2025-06-11 10:48 PM
Hi @RomainR.
We desoldered SB16, and SB9 was soldered by default. We then supplied 3.3V to pin 13 of the STMOD+ connector (on the fanout board) using the 3.3V output available on the same fanout board.
Now, we are successfully measuring 3.3V on the A5 connector using a multimeter. However, the ADC values we are receiving are still around 1800–2000, which do not align with the expected values calculated using the standard ADC conversion formula.
We tried on ADC1 and ADC2 by setting PB10 as ADC1_INP8 and ADC2_INP8 respectively.I am attaching the screenshots of the connections made and attaching my project as well.
Regards.
2025-06-12 9:12 AM
Hi @athern27
After reviewing your code, there some additional thing to fix in main.c:
Include all C mandatory header (stdio.h is needed by snprintf)
/* USER CODE BEGIN Includes */
#include <stdio.h>
#include <string.h>
/* USER CODE END Includes */
You configured PLL1 to have output frequency = 1600MHz, then IC1/SYSA = 800MHz.
But this frequency can only be reached in VOSHigh. Refer to RM0486 in section 13.6.2 Voltage scaling and DS14791 in Table 24. General operating conditions.
In VOSLow, the SYSA frequency max = 600MHz. Here below the Clock configuration of PLL1 to update in your code, then regenerate the project.
Then in MX_ADC1_Init, ADC is secure, so you need to configure the RIFSC as below:
static void MX_ADC1_Init(void)
{
/* USER CODE BEGIN ADC1_Init 0 */
/* USER CODE END ADC1_Init 0 */
ADC_MultiModeTypeDef multimode = {0};
ADC_ChannelConfTypeDef sConfig = {0};
ADC_AnalogWDGConfTypeDef AnalogWDGConfig = {0};
/* USER CODE BEGIN ADC1_Init 1 */
__HAL_RCC_RIFSC_CLK_ENABLE();
RIFSC->RISC_SECCFGRx[2] |= 0x1;
/* USER CODE END ADC1_Init 1 */
Last step concern snprintf format, you need to change the %u to %d as below (ADC_RES is uint16_t type)
snprintf(buffer, sizeof(buffer), "\r\n%d", AD_RES);
With these change, you will be able to read correct ADC conversions on PB10 when applying voltage 0 to 3.3V on Arduino CN7 A5 or on STMOD+ AN #13 from 0 to 4095 decimal values (see my serial terminal)
Refer to the corrected project in attachment.
Best regards,
Romain,
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.