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.

TM4C123GH6PM: Documentation on Timers, Analog Input, PWM Output, and Interrupts

Part Number: TM4C123GH6PM

My goal is to create a PID control for a heater.

It seems to me from reading the TivaWare API that this is doable via interrupts.

I have been trying to find an example or a discussion on how to configure timers with analog input and with PWM output and use interrupts as well.

Several of the sites I have read complain about the confusion of connecting a timer to the analog input.

Are there app notes or examples on PID control with interrupts using the Stellaris API? or just examples on reading analog inputs via interrupts.

  • Hi Keith,
    I will suggest that you start with the several timer examples provided in the TivaWare. Please go to TivaWare installation such as C:\ti\TivaWare_C_Series-2.1.3.156\examples\peripherals\timer. Some of the examples make use of the interrupt mode. Hopefully, you can reference these examples and with some modification extend to your application.
  • Keith Smith said:
    how to configure timers with analog input and with PWM output and use interrupts

    Perhaps a more detailed response proves of (greater) use...

    Your MCU manual has dedicated chapters focused upon: Timers, MCU's A-D Converter, and the sophisticated PWM Output Stage.   Your read/review of each is required.

    Now your language directs the "configuration of Timer" via analog.   I doubt that's what you meant - it appears that you intended to (instead) "Trigger" the Timer via an analog signal reaching some (unstated) signal level.    MCU's Timers may be triggered by a: Signal Edge or Level - alas these are "DIGITAL" not analog.   (understand/accept that an analog signal can represent/traverse far more signal levels than a digital signal - thus the choice of DIGITAL (most always) for "Timer Trigger.")    Should you (really) require an analog signal level to trigger a Timer - would not the imposition of an analog comparator - placed between the analog signal and the Timer's (specified) MCU pin - meet your requirement?   (many MCUs here include an analog comparator - easing this implementation)

    Your short posting fails to note any mechanism to halt the Timer.

    Two PWM Modules appear on many MCUs here.    Again - you provide little (i.d. NO) linkage between the Timer and PWM Output - I doubt any reader can "divine" your desire.

    The post ends w/PID control (w/Interrupts) yet ALL of the required detail of the earlier parts (Timer, PWM Outputs, Analog) are insufficient to provide reasonable guidance to your remote helpers...