2025-07-25 1:39 AM
Dear ST team,
Currently, I'm testing SPC560P50L5 MCU with AutoDevKit Studio, and it is going well by importing the sample project. I have noticed that I can enable "User ADC Regular Conversions" in "Application Configuration." Now, I'm trying to control the motor's speed with a potentiometer. So, I enable GPIO-E2, which corresponds to the ADC0_AN[5] pin. Then I generate the code. After that, I can't find how to get that ADC reading in the main.c.
Please help me to suggest on it to get the ADC reading from E2 GPIO.
Moreover, I declare the variables (uint16_t Bus_Voltage and uint16_t Temp) in the main.c and I would like to assign it as the Bus voltage value and Temperature value from on board NTC. But I can't find the API or functions in the files to call to get those values.
For example, in SDK6.3.2, I can use
2025-07-25 3:07 AM
Hi Agga,
To solve the problem you highlighted, please import the demo "SPC56xx_RLA ADC Test Application for Discovery".
It shows how to use the ADC with the SPC56 microcontroller. You can compare your ADC configuration with the one in the demo
and refer to the main.c file to see how to read data from the ADC.
Thanks,
AutoDevKit Team