MSP430 programming with Stateflow

I am trying to program a msp430 with state flow and wanted to ask whether there is a possibility to write directly to memory or to I / O ports. Next I would like to write an interrupt routine. Can I do this with Stateflow?

2 件のコメント

Björn
Björn 2012 年 5 月 10 日
I work with IAR Workbench, and have defined variables in the header for the port. It would be perfect for me if I could access them via Stateflow
TAB
TAB 2012 年 5 月 10 日
Please see edited part of my answer.

サインインしてコメントする。

 採用された回答

TAB
TAB 2012 年 5 月 10 日

2 投票

Whether there is a possibility to write directly to memory or to I / O ports ?
Set the signal's storage class in simulink to "GetSet". In this way generated code will use a GetFunction to read the signal and SetFunction to write the signal. You can implement these GetFunction and SetFunction as per your need.
I would like to write an interrupt routine. Can I do this with Stateflow ?
I don't think it is possible with stateflow. But, it is possible with simulink. To generate ISR like custom routines from your model, you can write S-function and it's wrapper TLC.
In both the above cases, I will suggest to keep the low level code and application code separate. Implement only application part in stateflow and use variables or function call to communicate between generated application code & low level code.
[EDITED]
I will suggest you to follow below strategy.

2 件のコメント

Björn
Björn 2012 年 5 月 22 日
I want to write more than one time per step in the memory. I can not even with your solution, right?
After one step, I can also use a memory block to write to the memory
TAB
TAB 2012 年 5 月 23 日
Sorry, but I didn't got your concern.
Can you elaborate?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeEmbedded Coder についてさらに検索

質問済み:

2012 年 5 月 10 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by