element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Odd PRU interrupt behavior
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join BeagleBoard to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 3 replies
  • Answers 2 answers
  • Subscribers 101 subscribers
  • Views 859 views
  • Users 0 members are here
Related

Odd PRU interrupt behavior

ivangalysh
ivangalysh over 5 years ago

I want to determine if I can use the PRUs to interact with an instrument for a satellite payload. I am able to get rpmsg-proc working and can move blocks of data quickly enough. I added the IEP timer and want to set it up to generate a 1 second interrupt so I can set a flag in the data indicating end of 1 second integration. My test code is supposed to send a message once a second triggered by the timer. Instead I am getting two messages every two seconds. I modified resource_table1.h to map event 7, IEP compare event, to host 1 which is R31 bit 31. I am using PRU1. Attached is the code. Any help would be appreciated.

 

I'm hoping to use the BBB industrial version in two space missions.

 

Ivan

Attachments:
main.c.zip
resource_table_1.h.zip
  • Sign in to reply
  • Cancel

Top Replies

  • shabaz
    shabaz over 5 years ago +1 suggested
    Hi Ivan, I didn't check all the code, but at first glance this looks incorrect: CT_IEP.TMR_CMP0 = 0x20000000; // set compare to 1 second at 200 MHz At 200 MHz clocking, this would be a delay of just over…
  • ivangalysh
    ivangalysh over 5 years ago +1 verified
    I finally figured it out. I needed to set CT_INTC.SICR = 7 to clear out the event. After line 117, CT_INTC.SECR0 = 0x80; I added CT_INTC.SICR_bit.STS_CLR_IDX = 7; This took care of it. I have my code working…
  • ivangalysh
    ivangalysh over 5 years ago in reply to shabaz +1 suggested
    I caught that too. It's the interrupt process that was not well described anywhere. I finally muddled through it.
  • shabaz
    0 shabaz over 5 years ago

    Hi Ivan,

     

    I didn't check all the code, but at first glance this looks incorrect:

    CT_IEP.TMR_CMP0 = 0x20000000; // set compare to 1 second at 200 MHz

     

    At 200 MHz clocking, this would be a delay of just over 2 seconds (2.68 seconds). If you wish it to be 1 second then this is not the right value.

    It should be 200000000 (or just type (int)2E8 it is easier to follow or (int)200E6), not 0x20000000

    Also, for space stuff (or any coding), these constants should be defined elsewhere, not in the function, and someone can then check each one.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • ivangalysh
    0 ivangalysh over 5 years ago

    I finally figured it out. I needed to set CT_INTC.SICR = 7 to clear out the event.

    After line 117,

    CT_INTC.SECR0 = 0x80; I added

    CT_INTC.SICR_bit.STS_CLR_IDX = 7;

     

    This took care of it.

     

    I have my code working. Now to work on the physical interface.


    Ivan

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • ivangalysh
    0 ivangalysh over 5 years ago in reply to shabaz

    I caught that too.

     

    It's the interrupt process that was not well described anywhere. I finally muddled through it.

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