Help to get a Overrun detection function for texas Instruments Microcontrollers
1 回表示 (過去 30 日間)
古いコメントを表示
Dear friends,
I am using Embebbed Coder to compilate a simulink code into a Texas Instruments Microcontroller (Delfino 28335 MCU).
I would like to get a way to detect overruns. I use Embebbed Coder to generates the executable file (*.out). In simulink/configuration_parameters/code_generation/Code_target there is an option to create a "call custom fucntion" which is called when an averrun is detected. I would like to switch on a led when an overrun is detected. Could you give some tips to create that "custom function" (for exampple where I have to declarate the fucntion in matlqab/simulink or if there is any simulink/block to do it)?
Thanks in advance,
Manuel
採用された回答
Antonin
2015 年 1 月 22 日
Dear Manuel,
If you are using idelink_ert.tlc as your system file, you have 2 options:
- On the coder target pane of the configuration parameters, you will find an "Overrun notification" drop-down menu that will let you specify a function to call while the code is overrunning. You can toggle a GPIO inside that function or take whatever action you need to take. Note that the function can come from your Simulink model via an atomic subsystem where you force the generated code to be inside a specific function.
- You can also turn on "Profile real-time execution" on the same menu. This will allow you to get a graphical representation of the code running in real time and detect how far you are from overrunning.
As of now there is no provision to do the same with ert.tlc, I will post again once I know more on that front.
I hope it helps,
Thanks,
Antonin.
1 件のコメント
Paul Rancuret
2016 年 2 月 5 日
Antonin,
Thank you for answering this question, this has helped me get on the right track with the same problem. However, I'm not sure I understand how to set up an atomic subsystem function to be called only from the over-run condition.
I've created a function-call subsystem and set it up with the code I would like. However, I can't set it up so that it is never called during normal simulation/run-time. The function-call generator won't let me specify zero iterations. I only want the function to be called when an over-run is detected, and not periodically. How can I do this?
I'm using Matlab R2013a (32-bit) with embedded coder and its dependencies.
Please help with this, thank you!
Paul Rancuret
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!