2021-05-24 05:55 AM
Hi everyone,
I have a question about MCSDK for STM32G474QE mcu.
I chose STM32G474QE in MCSDK gui software. My hardware phase sensing pins are connected to ADC1_IN5 (PB14) and ADC1_IN15 (PB0) pins. I want to use these pins for 2 insulated current sensor topology. When I checked MCSDK gui software (you can see in attachment), according to mcsdk gui ADC1_IN5 (PB14) and ADC1_IN15 (PB0) pins can only use for "phase U". How can I chose/use ADC1_IN5 for "phase U" and ADC1_IN15 for "phase V", is it possible ? If I change in source code (Uphase=adc1_in5, Vphase=iadc1_in15), will it be problem ?
Thanks in advance.
Have a nice day!
2021-05-27 07:22 AM
Hello,
Using a STM32G474 + insulated current sensor topology is a high end setup. We did not plan to use only one ADC with this MCU.
Indeed, It is more accurate to do the current sampling of both phases at exactly the same time.
To achieve this, we use 2 different ADCs.
If you want to use only one ADC, it is possible but you need to change the scheduling of the ADC to sample the two currents in a row.
I would advise you instead to select the couple ADC3/ADC4.
ADC3_IN12 is directly selectable on pin B0 from the WB.
I realized thanks to your post that ADC4_in4 on PB14 is not selectable. I will ask for fixing this issue in coming release.
As a workaround, I can propose you to select another Pin for ADC4 (E8 for instance) , and to modify the generated code afterward.
Be careful, two different things must be modified. In cubeMX, you need to apply the configuration done for channel6 (Pin E8) to ADC4_channel 4 (Pin B14).
And after code generation from cubeMX, you need to modify the file mc_parameters.c and replace the use of channel6 by channel 4.
Regards
Cedric
2021-05-29 02:04 AM
Hi Cedric,
Thanks for answering.
Actually I am using STM32G474RC mcu in my project.
MCSDK interface does not have stm32g474RC so I choose stm32g474qe.
After generating the code with mcsdk, I modify the *.ld file and pin configurations for stm32g474RC mcu.
Also I make sure that the alternate functions of the pins are compatible for both mcu.
In this scenario(converting from stm32g474qe to stm32g474RC), is there any problem ?
Thanks in advance.
Have a nice day!