2021-03-13 10:32 AM
Hi!
i am using STM32F401CCU6 for BLDC/FOC motor control application.For foc application requirements, i need sampling 3 phase current in inject mode, vbus and motor temperature in regular mode.However, there is only 1 adc available for sampling. i tried lots of way to config my cubemx to get it work but i only did successed sampling in inject mode(regular mode not funtional). did i missed something or they just can't work together on the same adc?
Best wishes!
Harry.
PS: after i generated code, i did add HAL_ADC_Start_DMA() and HAL_ADCEx_InjectedStart_IT() in main() function. But only inject mode is avaliable for me.
Solved! Go to Solution.
2021-03-18 09:58 AM
I found solution by myself.I have to set "Clock Prescaler" to "PCLK2 divided by 8" and everything going well! However I still can't understand why the MCU is not working at the division of 2? Is DMA clock problem or ADC can't handle that fast?
2021-03-18 09:58 AM
I found solution by myself.I have to set "Clock Prescaler" to "PCLK2 divided by 8" and everything going well! However I still can't understand why the MCU is not working at the division of 2? Is DMA clock problem or ADC can't handle that fast?