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.

Compiler/TM4C1230H6PM: WTimer0 Interrupt CCS 7.2

Part Number: TM4C1230H6PM


Tool/software: TI C/C++ Compiler

All,

I´d like to code in plain C, no TI APIs or sys control functions.

But I am struggling with setting up an interrupt for WTimer0 on reload / time out.

Basically, my code looks like this:

main(void)
{

... <timer init etc, works fine, timer is running>

}

???

void timer_ISR ()               // ISR for timer running out / reload (WTimer periodic mode)

{

...

}

Question is: How to set up the right declaration for the ISR (interrupt service routine)? #pragma?

Thanks for your help,

Gunter

  • Please search for the section titled The INTERRUPT Pragma in the ARM compiler manual.  Note this does not address configuring the device to pass control to this function when the interrupt is raised.  That detail remains your responsibility.

    Thanks and regards,

    -George

  • Hi George,

    I have seen this already for sure, but still struggling.
    Could you pls send me a c code snippet for the ISR routine?
    Timer configuration is done for sure, no probs

    Thanks for your help,
    Gunter
  • Gunter Heuer said:
    pls send me a c code snippet for the ISR routine?

    Unfortunately, I lack the expertise to do that.  This thread is being given to the TM4C device experts.

    Thanks and regards,

    -George

  • Hello Gunter,

    We only support applications that use TivaWare. If you wish to do this without 'TI APIs or sys control functions' then please consult the device datasheet.
  • Gunter Heuer said:
    I´d like to code in plain C, no TI APIs or sys control functions.

    While (that) "like" may (seem) to meet your needs (at this moment) have you considered the impact such would impose upon the forum if "many/most" sought this (extra) level of support?     (it would be huge - and the number of posters assisted would plunge...)

    Do understand that this vendor's API is, "Tried, true, tested" - and "well supported" by vendor staff and some few "outsiders."      Rejecting the API "culls you from the herd!"      This (gravely) reduces tech support, requires far higher (and longer) effort on your part, and your unique implementation is unlikely to prove as robust as vendor's "proven" API.     (this is not to demean you - it "is" a statement of fact!)

    While you list your "like" - you fail to describe (at all)  the "why" of your motivation!     (further reducing sympathy for your quest.)

    There (may) be a "compromise position" - that being use of "Direct Register Manipulation" or simply, "Assembler."     Note that neither are "vendor supported" here - will require substantially more time/effort from you - and the resulting code can never be, "Tried & Tested" to the extent of the "long existing" API.     (you may wish to search upon "Test Driven Design" if you're not already well familiar w/those powerful techniques)

    Your (seeming) rejection of the API may have caused you to neglect "focused study" of the (fully supplied) API source code.    Via contrast/comparison of the API - versus your own C code - you gain substantial "code modeling" aid - do you not?    

    It is unfortunate that (some) universities "reject the spectacular efficiencies gained thru the API."    As a small tech biz owner - almost never would we allow new staff to "invest (really waste) great time/effort" to pursue "highly inefficient means" to produce code which proves, "Untried, often untrue, and minimally/marginally tested!"    (our doors/those of others - are unlikely to "remain open" following that path...)

    Firm/I participate in several ARM/other tech venues - this vendor is NOT being "mean/unkind" - their charter is to, "Deliver the most good to the many!" And that is achieved ONLY via the API...

  • @cb1 - **LIKE** (not to be confused with "like")
  • Thank you, Sir.    Although SO MANY here would much prefer "officialdom" restoring the powerful/rewarding/eased (original) **LIKE** mechanism.

    Posters must recognize the need for the "greater good" - which rarely results from, "forum's diversion to (highly) unique poster, "likes!"'

  • Gunter Heuer said:
    I´d like to code in plain C, no TI APIs or sys control functions.

    Don't do that. Seriously don't.

    There are no disadvantages to using the API and little to no support available. Just about the only support would be to reverse engineer from the TIVAWare source.

    Gunter Heuer said:

    void timer_ISR ()               // ISR for timer running out / reload (WTimer periodic mode)

    {

    ...

    }

    Question is: How to set up the right declaration for the ISR (interrupt service routine)? #pragma?

    With or without TIVAWare the correct prototype for an interrupt vector on a Cortex M is

    void function(void);

    You have to place the function in the interrupt table (in the startup) just as on other processors. Or TIVAWare has a registering function that updates a RAM copy of the interrupt table with the appropriate pointer.

    I chose to modify the startup to use weak definials so I didn't have to modify the startup to add a new interrupt function, just name it correctly.

    Robert

  • All,

    thanks for your advice.
    Will implement the APIs over weekend, curious on the result.

    Thanks,
    Gunter
  • May we note that, "We are curious how the "plan" to implement APIs" somehow earns/deserves a "Verify?" What has been verified - how does a "future plan" benefit follow-on readers? (clearly - it does/can NOT!)