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
2025-07-27 7:23 PM
Hi Atroi, Thanks for your reply.
So.., do you mean that I cannot call the api to get the temperature value in °C unit like what I can do in MCSDK 6.3.2?
In MCSDK 6.3.2, if I want to get the NTC temperature value, I just use
"Temp = NTC_GetAvTemp_C(&TempSensor_M1);" I have to do nothing after this, and I will see the Temp value in
°C unit.
However, in this AutoDevKit Studio for SPC560, I have to read the raw ADC value and calculate it back to °C unit using the NTC values and parameters. do you mean like this?
thank you so much for your help.
Thanks and regards,
Agga.
2025-07-28 1:28 AM
Hi Agga,
I want to suggest how to configure the ADC and read its value using AutoDevKit.
You can use your library if you want, but you must pass the ADC value to it correctly.
Alternatively, without using your library, you can read the raw ADC value and convert it to degrees Celsius (°C) using the NTC values and parameters.
hope this can help and clarify.
Thanks,
AutoDevKit Team.