This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C1294KCPDT: How to use Hardware Interrupt block of ARM Cortex-M processors in Simulink

Part Number: TM4C1294KCPDT
Other Parts Discussed in Thread: EK-TM4C123GXL, ENERGIA

Hi,everyone

I have already installed

  • the ARM Cortex-M Support from Embedded Coder
  • ARM Cortex-M CMSIS Library Support from DSP System Toolbox

Then,a block called Hardware Interrupt could be seen in Simulink library browser.As shown in Figure.

Now,I want to use this block to produce a interrupt whose period is 0.1s,

but the block's document says : "This block only generates code for the specified ISR. The configuration to enable the interrupt and specific triggering options should be done in the peripheral settings."

I tried to find a PWM block which could be used to trigger a interrupt,however I could not find any relevant (PWM)blocks.

Where is the peripheral settings page of TM4C1294 or how can I enable the interrupt and set triggering options.

Can anyone give me some hints,thanks.

Regard,

TAO

  • Hello Chuang,

    We have not integrated any support for Matlab/Simulink for TM4C on our end. I am not sure if it is even possible to use the TM4C1294KCPDT with those libraries right out of the box. I suspect the hooks you need are not in place on the Simulink side.

    You're best bet is probably to use the EK-TM4C123GXL LaunchPad and the Simulink Energia support as indicated here: e2e.ti.com/.../2215005
  • Hello Ralph Jacobi,

    Thanks for your answer and advice.It is really helpful for me.

    As you said,there is no support for TM4C in Simulink. If that's true,maybe I will try to make a (S Function)block in Simulink firstly.

    I want to find some example C code about interrupt of TM4C1294,but any helpful things could not be found in data sheet.

    There are many documents on the product introduction page,I am not sure which one is what I need.

    Could you give me some advice?

    Thanks.

    Regards,

    Chuang Tao

     

  • If I may - not being Ralph - but (maybe) being able to offer (some) guidance - I suggest the following:

    • MCU's manual (far beyond "data-sheet") has an entire chapter devoted to the PWM Capability of your MCU - excellent place to start.     It is (beyond) curious that you claim, "Helpful things - NOT found - w/in the data manual!"      The entire section or chapter on PWM (must) have "escaped your attention" - is that not so?     It is INDEED - most HELPFUL!
    • Driver Library "User's Guide" details the API features & functions - filled w/great detail & explanation
    • W/in TivaWare - under "Examples/Peripherals" (or its reverse) are multiple examples - listed by Peripherals.
    • Lastly - the "Search Box" located atop this forum page - will present a "slew" of PWM examples - in response to your use of "keyword" (interestingly) "PWM"

    This should "saturate" your quest for PWM specific knowledge - at least for the next day or so...

    You've tied your learning to the PWM interrupt - yet that may not "best serve" your initial learning.    I'd suggest "holding off" on "interrupts" - until you've got the "PWM basics" well "under your belt."  (understood)...

  • Hello all,

    We have limited Simulink / Embedded Coder Support for the TM4C via our Energia Support Package.

    info with short video is here: https://www.mathworks.com/matlabcentral/fileexchange/54929-embedded-coder-target-for-energia

    Cheers,

    -Brian

  • Hello Brian,

    Thanks for your additional information.

    On the "Embedded Coder Target for Energia" page ,the introduction says “To get started, start MATLAB R2015b” .

    I want to know if Energia can be used on MATLAB R2015a or MATLAB R2015a SP1.

    Besides,I have found some information about TM4C1294 on Energia's homepage,as shown in the figure.

    Does it mean "Embedded Coder Target for Energia" has already supported Simulink example models(like ADC,PWM blocks) for TM4C1294XL currently?

    What's more,Can "Embedded Coder Target for Energia" be used for commercial products?

    Regards,

    Chuang Tao

  • Hi Chuang,

    MathWorks support for Energia is for Release R2015b and later. You can try it with R2015a or R2015aSP1, but I don't think it will work. Beyond the support package, you can MathWorks tools and Embedded Coder to generate ANSI / ISO C code of your algorithm and import that into CCS. It will take work to set-up; but this workflow is what many commercial customers use as the development process for every company is unique.

    Doc on requirements for the MathWorks support:

    https://www.mathworks.com/matlabcentral/fileexchange/54929-embedded-coder-target-for-energia?s_tid=srchtitle

    Cheers,

    -Brian