MATLAB: Is it possible to configure controller SFR in Simulink as a part of Autocode generation

autocode generationsimulink

I just started to learn about Autocode generation using MATLAB\SIMULINK. I have gone through some of webinar and documentation available on Mathworks website for Autocode generation.
All the time an Autocode is generated for control alorithm but none of the docs mention regarding register(SFR) setting like for I\O config, module functionality etc.
Please clarify is it possible to modify\change register(SFR) setting directly from Simulink or we have to do this part manually and then integrate autogenerated control algo.
Regards.

Best Answer

  • The best option is, write your low level code (interrupt, peripheral configuration etc) manually and integrate the autogenerated algorithm with it.
    But also there are target support packages are available which can generate the standalone code (including low level code) for a perticular target. Generated standalone code can be directly used on the target without the need of any further integration. See Simulink Supported Target Hardware. Also some packages are available from third party for different targets like RapidSTM32 blockset and Microchip dsPIC blockset
    These packages are nothing but a set of blocks implemented with S-function and TLC files. So for your own target you can create your own package to generate the standalone code. But remember, developing own package requires knowledge of s-function TLC and lots of effort.
  • Related Question