element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Smart Spaces Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Smart Spaces Design Challenge
  • More
  • Cancel
Smart Spaces Design Challenge
Forum Configuring LPTMR0 on MCXA153
  • Forum
  • Projects
  • DC
  • Leaderboard
  • Files
  • Members
  • More
  • Cancel
  • New
Join Smart Spaces Design Challenge to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 5 replies
  • Subscribers 38 subscribers
  • Views 102 views
  • Users 0 members are here
Related

Configuring LPTMR0 on MCXA153

yamanoorsai
yamanoorsai 13 days ago

I am trying to configure LPTMR0 for a 1-second interval. I followed the lptmr example in the SDK examples to configure my timer. The interval at which the interrupt is generated never correct. 

Here are the steps I followed:

  • Configure the LPTMR0 clock source to 96MHz with a divider of 16. The clock frequency for LPTMR0 is 6MHz. 
  • After code generation, I set the timer count to 6,000,000 for 1 second interval.

I confirmed that the timer is a 32 bit timer. The timer does work but the interval duration is not 1 second. It is something else. 

Did I skip a step in configuring the timer? 

  • Sign in to reply
  • Cancel

Top Replies

  • balajivan1995
    balajivan1995 13 days ago +2 verified
    If you want an accurate 1s interrupt, use utick component with 1mhz clock source in repeating mode. If you don't want to use another clock source and fine with few ms lapse, you can use systick. You…
  • yamanoorsai
    yamanoorsai 13 days ago in reply to misaz +1
    This is how I confirmed that the clock frequency is 6MHz. I took the 96MHz clock and divided it to 6 MHz.
  • misaz
    misaz 13 days ago in reply to yamanoorsai +1
    Just for curiosity. Try swap 16 and 1 dividers:
  • misaz
    0 misaz 13 days ago

    According to Technical Reference Manual, LPTMR support up to 25 MHz on input. How do you know that "clock source is 96MHz"? Do you see it somewhere in GUI config in development environment? Could you post screenshot? If not in GUI, could you post code?

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • balajivan1995
    +1 balajivan1995 13 days ago

    If you want an accurate 1s interrupt, use utick component with 1mhz clock source in repeating mode.

    If you don't want to use another clock source and fine with few ms lapse, you can use systick. 

    You can refer this link for how to use systick as reference time.

    community.element14.com/.../231676

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
  • yamanoorsai
    0 yamanoorsai 13 days ago in reply to misaz

    This is how I confirmed that the clock frequency is 6MHz. I took the 96MHz clock and divided it to 6 MHz. 

    image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • misaz
    0 misaz 13 days ago in reply to yamanoorsai

    Just for curiosity. Try swap 16 and 1 dividers:

    image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • yamanoorsai
    0 yamanoorsai 13 days ago in reply to balajivan1995

    I ended up using utick timer. Thanks. 

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube