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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
BeagleBoard
  • Products
  • Dev Tools
  • Single-Board Computers
  • BeagleBoard
  • More
  • Cancel
BeagleBoard
Forum How to read the external timer counter on the BeagleBone Black?
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
BeagleBoard requires membership for participation - click to join
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 1 reply
  • Subscribers 98 subscribers
  • Views 1216 views
  • Users 0 members are here
Related

How to read the external timer counter on the BeagleBone Black?

Jhonny
Jhonny over 3 years ago

Hi everyone. I need to measure the frequency with a BeagleBone (400 kHz) and for this I would like to use the BeagleBone timers. How can I read the value of TIMER?
For example, TIMER4 is located in /sys/devices/platform/ocp/48044000.timer/, but l can't find how to read the timer value. 

Are there other ways to measure frequency with a beaglebone? I am new to Beaglebone, so I will be glad to advice and guides

PS: I would like to measure the frequency using timers without installing any additional libraries. But if it is not possible to do this with the help of timers, then please tell me how can such a frequency be measured at all?

I'm using the latest Ubuntu Linux for BeagleBone, kernel 4.

  • Sign in to reply
  • Cancel

Top Replies

  • shabaz
    shabaz over 3 years ago +1
    Hi, Short answer (typing on mobile) maybe not the best answer, you might get better answers from others: One option is to dig into the AM3359 datasheet, identify the registers that you need to program…
Parents
  • shabaz
    0 shabaz over 3 years ago

    Hi,

    Short answer (typing on mobile) maybe not the best answer, you might get better answers from others:

    One option is to dig into the AM3359 datasheet, identify the registers that you need to program and query, and google mmap which can be used to access the registers from user space I.e. your code. Personally that is the route I would take if it were me.

    Another option could be to use the PRU. There is a learning curve however. Given that you suggest there is already a timer that you may be able to use, then I'd put the PRU as a lower preference compared to directly accessing the timer (providing its not used by Linux).

    Your question has insufficient information, for instance its not clear at all why you want to measure 400 kHz. Perhaps it could be divided using external hardware and then you could even do it entirely using existing time functions in C, with some jitter that may not matter - I have no idea because you have not explained your need.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • shabaz
    0 shabaz over 3 years ago

    Hi,

    Short answer (typing on mobile) maybe not the best answer, you might get better answers from others:

    One option is to dig into the AM3359 datasheet, identify the registers that you need to program and query, and google mmap which can be used to access the registers from user space I.e. your code. Personally that is the route I would take if it were me.

    Another option could be to use the PRU. There is a learning curve however. Given that you suggest there is already a timer that you may be able to use, then I'd put the PRU as a lower preference compared to directly accessing the timer (providing its not used by Linux).

    Your question has insufficient information, for instance its not clear at all why you want to measure 400 kHz. Perhaps it could be divided using external hardware and then you could even do it entirely using existing time functions in C, with some jitter that may not matter - I have no idea because you have not explained your need.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
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