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.

PWM Timer interrupt



LM4F120H5QR

If you write your own routines to manage PWM and you require interrupts then be aware that the documentation in the datasheet is not quite complete.  In order to get interrupts you need also to set CAEIM (if using Timer A) or CBEIM (if using timer B) in GPTMIMR for the counter you are using.  You also need to complete the steps listed in the data sheet.  Don't forget to set bit 21 in the EN0 register and put the address handler in vector 21.  Hope this helps someone.

  • Frank Duignan1 said:
    If you write your own routines to manage PWM and you require interrupts

    Surely your intent is to assist - however, "Culling oneself from the herd" - whether the plain be silicon or Serengeti - too often exposes subject person/beast to harm.

    Vendor's Peripheral Driver Library has long proven successful - saves great time & effort - and shields users from "excessive" detail.  (such detail is freely available w/in the library's source - should the user wish to, (& have time," to drill down.")

    Those, "writing their own" separate themselves from the PDL's (the herd's) safety & robustness - register intricacies &  (sometimes) even the order of register transactions (predators) - stand ready/waiting the lone beast's first (& possibly last) misstep...

    And - even if "home-grown" code "appears to run" - can it ever receive the depth & poking/prodding (i.e. test/verifying) which vendor's PDL has long withstood?  Some (many) organizations seek quick/complete/tested delivery from their SW staff.  The desire to, "write your own" may be noble - but may defy the reality of today's, driven tech-landscape...