2021-07-04 02:22 AM
Anyone willing to share an example of such an application? Tried one myself by reading 2 ADC channels coming from 2 LM35 Analog sensors. However, I cannot make the injected ADC readings work.
I use CubeMX to configure the registers and Keil to build and flash the app. Could share my trials if anyone is willing to make some debugging.
Thanks in advance!
Note: The final application is the reading of 2 shunt resistor currents for a BLDC motor.
2021-07-04 02:24 AM
Tried dual injected conversions (combined with regular conversions or not) but couldn't make it work. Can't see if the program is entering the complete injected conversion interrupt cuz it doesn't let me put a breakpoint there.
2021-07-04 06:32 AM
What chip?
Did you look at CubeMX examples?
2021-07-04 06:57 AM
Thanks TDK for the fast reply!
Chip: STM32F407 (Discovery board). Where can I find these CubeMX examples?
Just made some progress - seems that I forgot to check the global interrupts for ADCs checkbox in order to trigger the injected readings (attached img). Inside the ISR, the injected ADCx values can be stored in a buffer and used later on for the PI controllers. Curios to see if one could use DMA instead of IT to read the injected conversions. Anyone who tried this before and is willing to share some ideas?
I'll try next to work out the simultaneous injected mode where ADC1 works as a master for triggering the ADC2 injected readings. As of right now only the ADCs independent mode is working.
Note: HAL APIs used till this point: HAL_ADC_Start_DMA() and HAL_ADCEx_InjectedStart_IT().
2021-07-04 07:08 AM
> Where can I find these CubeMX examples?
Here is one example. Different board but the code should be similar if not the same.
I don't see any examples for dual simultaneous mode.
The example selector in CubeIDE can also import these examples.