Configuring Peripheral ADC Issue
- March 18, 2025
- 4 replies
- 982 views
Hello Everybody,
MCSDK:6.3.0
CubeMX: 6.3.0
Workbench : 6.3.0
CubeIDE : 1.15.0
I encountered an issue after generating FOC code using Workbench v6.3.0.
I then used CubeMX to configure PB15 as ADC2_IN15 to read the torque sensor voltage.
However, after regenerating the code in CubeMX, I observed two problems:
1) The configuration for ADC2_IN15 was not automatically generated by CubeMX. I had to manually set it up. Is this expected behavior?
2) During initialization, I first measured PIN PB15 using a multimeter, and its voltage level was 0.7V (which is the correct baseline voltage for the torque sensor).
However, once the program executes MX_MotorControl_Init();, this pin is pulled up to 3.3V.
I checked Workbench, and this pin does not appear to be used by the FOC configuration.
How can I resolve this issue? Please help me...
Note: In the FOC code generated by Workbench, ADC2 uses injection mode, while the additional ADC I configured uses regular mode.
