Issue with External Mode in Simulink when using ADC Injected Mode synchronized with PWM on STM32G4
15 次查看(过去 30 天)
显示 更早的评论
Hello,
I’m working with Simulink and an STM32G4 series microcontroller. I’ve successfully set up PWM generation and configured the ADC in injected mode, synchronized with the PWM timer (TIM1).
However, when I enable External Mode in Simulink (for real-time parameter tuning and signal monitoring), the connection fails. Interestingly, everything works fine when I trigger the ADC using a different timer — the issue only occurs when TIM1 is used to trigger the injected ADC.
My setup:
- Target: STM32G4 (e.g., STM32G4)
- PWM generated using TIM1
- ADC in injected mode, triggered by TIM1
- External Mode communication over STLink (USB)
Question:
Is there a known limitation or conflict between External Mode and using injected ADC mode synchronized with PWM (via TIM1) on STM32 targets in Simulink?
Could this be related to timing/resource conflicts?
Do you have any suggestions or workarounds to maintain synchronized ADC injection while using External Mode?
Thanks in advance for your support!
0 个评论
回答(1 个)
Adit Kirtani
2025-7-8
Hi,
You may refer to our motor control examples to understand how we configure the timer to trigger the ADC.
Kindly contact Technical Support for further assistance:
Ensure that the Simulink model (scaled down model for easy reproduction) as well as the STM32CubeMX IOC file are attached.
Thank you,
Adit Kirtani.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!