• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Microcontrollers » Stellaris® ARM® Microcontrollers » Stellaris® ARM® LM3S Microcontrollers Forum » Output Compare on Timer Channel
Share
Stellaris® ARM® Microcontrollers
  • Forum
Options
  • Subscribe via RSS
Helpful Stellaris® LM4F Series Links
  • LM4F Series
  • Stellaris PinMux Utility
  • Stellaris® LM4F120 LaunchPad
  • LM4F MCU Applications
  • LM4F MCU Video
  • ARM Cortex-M4F Whitepaper
  • Stellaris MCU Brochure
  • LM4F232 Eval Kit
  • Output Compare on Timer Channel

    Output Compare on Timer Channel

    This question is not answered
    Rajah
    Posted by Rajah
    on Apr 13 2012 12:41 PM
    Intellectual300 points

    Hi Guys,

    I am using an LM3S1P51 for my design. I have read the datasheet multiple times to confirm I am not missing anything, however, I am unable to find an output compare feature on the Timer channels. This basic feature is available on 8 bit controllers I have used. What I am looking for is to change the state of a Timer channel pin when the timer count expires. On 8 bits, I can set up the count, the timer expires and the output compare pin for the associated timer channel automatically toggles or pulls high/low (can be configured during initial setup). However, with the 1P51, I have to set the GPIO to a state in the timer interrupt (causing a slight delay on GPIO). Anyone know if I am missing something? Thanks for your time.

    Rajah

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • cb1_mobile
      Posted by cb1_mobile
      on Apr 13 2012 14:13 PM
      Guru21640 points

      Rajah
      Re: "Missing Timer Direct-Toggle Pin."  Anyone know if I am missing something?

      Believe your finding to be correct - recall that the ARM was never intended to "maintain all similarities" with near-dead/dying 8 bit devices. 

      Stellaris response time to interrupts is excellent and quite predictable (deterministic).  Further - as the timers reach to 32 bits (even 64 bits on new M4s) and the MCU System clock exceeds that of 8 bit ones - you may be able to "tune out" any interrupt response time "delay" via lessening of Timer match value.  You may want to employ a high priority for this timer interrupt as well...

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Rajah
      Posted by Rajah
      on Apr 13 2012 15:01 PM
      Intellectual300 points

      Thanks for your reply cb1_mobile. I have multiple interrupts that HAVE to be at a higher priority than the timer channel interrupt. I see a little jitter when I probe the GPIO on to a scope. While, I can live with the jitter, I wanted to know if I was missing something on the data sheet (because timer channel implementations from ST and Freescale ARM offerings have the output compare feature). While I agree that 8-bits are being replaced, I would argue that output compare feature is a very useful regardless of the data bus widths/processor architecture.

      Thanks,

      Rajah

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • cb1_mobile
      Posted by cb1_mobile
      on Apr 13 2012 16:08 PM
      Guru21640 points

      Can't argue your point - many have raised same - protested.  Historically LMI was very underserviced in GPIO dept.  (may explain why timer GPIO link went bye-bye)  Way improved w/new M4 - very nearly reach "holy grail" of 80% GPIO/Pin Total.

      On a lighter note (re your avatar) met, knew Matt G. - we both lived in Hermosa Beach, CA - few blocks apart.  His early drawings bore very slight visual resemblance to the polished artwork pumped now from Korea.  (you would not recognize "original" Bart/Homer in dark alley - LA Times would not accept - appeared only in "throw-away" Easy Reader...)  Wonder if slight timer jitter would impede Springfield reactor...

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Stellaris John
      Posted by Stellaris John
      on Apr 13 2012 17:07 PM
      Intellectual2110 points

      Rajah,

      The timer PWM mode may have the functionality you're looking for. In PWM mode you can configure a CCP GPIO to go high or low depending if a timer is above or below a certain value. I know you can configure the CCP output for periodic mode, but I don't know if it would still work if you wanted do to a one-shot count. If you have Stellarisware installed, there's some example code in Stellarisware/examples/peripherals/timer/pwm.c.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • cb1_mobile
      Posted by cb1_mobile
      on Apr 13 2012 17:59 PM
      Guru21640 points

      Rajah (aka Bart) - Stellaris John has totally outclassed me with his, "Timer in PWM Mode" suggestion.  This does not "invade" your formal PWM Module use (should your MCU be so equipped) but is an option w/in your Timer - and directly controls that particular GPIO (confined to CCP pin).  This output is rock stable - if you set it up for 50% PWM suspect that you'll get precisely what you sought.  As a fringe benefit you can "tweak" the PWM width if desired.  (frequency will remain constant)  We've used this mode at (and beyond) 20KHz (out of human hearing range).  The formal PWM modules are more complex - such use would probably be bad application of a precious resource - but the Timer in PWM Mode should fulfill your requirement nicely.  Good job Stellaris John...

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    TI E2E™ Community
    • Support Forums
    • Blogs
    • Videos
    • Groups
    • Site Support & Feedback
    • Settings
    TI E2E™ Community Groups
    • TI University Program
    • Make the Switch
    • Microcontroller Projects
    • Motor Drive & Control
    Other Communities
    • Deyisupport
    • Designsomething.org
    • beagleboard.org
    • TI on Element 14
    • TI on TechXchangeSM
    Other Technical & Support Resources
    • WEBENCH® Design Center
    • Product Information Centers
    • Technical Documents
    • TI Design Network
    • TI Technical Articles
    • TI Training

    All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

    Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

    Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
    TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

    TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
    embedded processors, along with software, tools and the industry’s largest sales/support staff.

    © Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
    Trademarks | Privacy Policy | Terms of Use