2023-10-26 12:25 AM
Hello,
i am currently working with MATLAB/Simulink and followed this tutorial: https://www.youtube.com/watch?v=535gxJa72v0.
When I tried to bring the Pulse Generator to its maximum with Digital Write, surprisingly it already stopped at 25kHz. After some research I found out that this is related to the BaseRateSampleTime and can be set in the solver. After I set this to 1e-7 still no faster frequencies than 25kHz are possible.
Has anyone had the same experience or do I still have a configuration error. Or is it because no faster code can be generated from Simulink?
Greetings,
ChRegBrg
2023-12-15 02:17 AM
Hi Ch,
I had a similar issue using ADC sampling Triggered by HRTIM. It was stuck at 50kHz using HAL (even without Embedded Coder).
I do also work with Embedded Coder Support Package for STM32 (this is based on LL library instead of HAL, so It is supposed to be faster).
If you can not choose the code generation library (not sure if it is allowed in Nucleo Boards Support Package), I would try to set Optimization level with Priority to Maximize Execution Speed:
Hardware Settings >> Code Generation >> Optimization >> Level: Maximum >> Priority: Maximize execution speed