2024-05-07 04:23 AM
Our project uses an external ADC reference voltage of 3.03V.
This value is properly set up inside the json I use to generate the inital project code ("amplifyingNetworkVm": 3.03, "polarizationOffset": 1.515).
Now I found in the generated code that inside paramters_converison.h, the ADC_REFERENCE_VOLTAGE is set to 3.3V.
Where am I supposed to set up the correct value so that it gets used by the code generator and stays when regenerating the project in CubeMX? Can I just manually set it?
Solved! Go to Solution.
2024-06-24 02:10 AM
Hello DMeie.2,
Currently ADC reference voltage is fixed to 3.3V regardless the settings in your board description. The quickest work around to avoid ADC_REFERENCE_VOLTAGE modification after each cubeMX generation is :
- open the *.ioc file in your project directory with your favorite text editor.
- search MotorControl.ADC_REFERENCE_VOLTAGE and set to the desired value.
- save your *.ioc file
- reload your *.ioc file with cubeMX and generate your project
ADC_REFERENCE_VOLTAGE should be set to the correct value in parameters_conversion.h file.
Please note this work around works only if you regenerate your project with CubeMX. If you regenerate the project with STMCWorkbench, the *.ioc will be overwritten and your modification will be lost.
Best regards
2024-06-24 02:10 AM
Hello DMeie.2,
Currently ADC reference voltage is fixed to 3.3V regardless the settings in your board description. The quickest work around to avoid ADC_REFERENCE_VOLTAGE modification after each cubeMX generation is :
- open the *.ioc file in your project directory with your favorite text editor.
- search MotorControl.ADC_REFERENCE_VOLTAGE and set to the desired value.
- save your *.ioc file
- reload your *.ioc file with cubeMX and generate your project
ADC_REFERENCE_VOLTAGE should be set to the correct value in parameters_conversion.h file.
Please note this work around works only if you regenerate your project with CubeMX. If you regenerate the project with STMCWorkbench, the *.ioc will be overwritten and your modification will be lost.
Best regards