2020-09-25 07:29 AM
Hi ST Community
I am having a MotorControl setup with the B-G431B-ESC1 board.
The default project generated with MotorControl Workbench uses the OPAMP1, 2 and 3 and their outputs are set to pin A2, A6 and B1. These output pins are then fed to the ADC: ADC1_IN3 (A2), ADC2_IN3 (A6) and ADC1_IN12 (B1).
In my setup, I need to use the pins A2, A6 and B1 for other GPIO purposes (already used all the other pins). I am having a hard find figuring out whether it is possible to route the OPAMP outputs internally to the corresponding ADC without wasting uC pins. Does anyone know if this is possible?
Edit:
In the document: AN5310 Guideline for using analog features of STM32G4 Series versus STM32F3 Series devices, table 10 shows the overview of "Internal OPAMP to ADC connection without external pin occupancy". So it must indeed be possible. I must figure out how to set this up in the CubeMX project.
Solved! Go to Solution.
2020-09-28 02:36 AM
Hello,
You can free PA2 and PA6 with the attached files. OPAMP3 is already connected internally and also externally through PB1 because we need to have phase W on both ADCs. There is maybe an issue with current cubeMX version to configure this use case but this need to be confirmed.
Best regards
2020-09-28 12:57 AM
@DB.7ERGANTIN Seems to me you might be the right one to ask. :)
2020-09-28 02:36 AM
Hello,
You can free PA2 and PA6 with the attached files. OPAMP3 is already connected internally and also externally through PB1 because we need to have phase W on both ADCs. There is maybe an issue with current cubeMX version to configure this use case but this need to be confirmed.
Best regards
2020-09-28 03:08 AM
So, am I understanding this right:
2020-09-28 07:57 AM
Concerning the following points:
1.1: This is strange, I created a new project B-G431B-ESC1 and unzipped directly the files in the Src directory, I faced no issues during the project build and the motor spun.
2: It seems so but it needs to be confirmed
3.1: OPAMP1/OPAMP2 is not a valid configuration in case of B-G431B-ESC1 and should be forbidden. The board is designed to use OPAMPs in differential mode then in this configuration I don't see a way to free PB1.
Best regards
2020-09-29 12:09 AM
It might be that I've chosen a hall-sensor as the speed sensing element. It worked with me uncommenting the M1_OPAMP1_INT_GAIN_Pin and M1_OPAMP1_OUT_Pin.
Thank you for pointing me in the right direction. I guess I have to change the package type in order to get more pins available.
2021-06-21 01:15 PM
The question has been set only to the "STM32 Motor Control" topic (the question is only about the STM32 MC SDK).
Best regards
2024-10-08 12:45 AM - edited 2024-10-08 02:10 AM
Hello,
I have the same question. Since the accepted solution is already quite old I ask again for usage with MCSDK v6.3.1:
Best regards