• 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 » C2000™ Microcontrollers » C2000 32-bit Microcontrollers Forum » 2812 timer interrupt urgent !
Share
C2000™ Microcontrollers
  • Forums
  • Announcements
  • E2E Wiki
Options
  • Subscribe via RSS
C2000 Resources
  • Product Folder
  • C2000 Training Portal
  • C2000 Technical Training Catalog
  • C2000 Datasheets, App Notes, User Guides
  • C2000 Hardware Design Kits
  • controlSUITE for C2000 Software Library


  • InstaSPIN Resources
  • What is InstaSPIN?
  • Videos and Support


  • InstaSPIN-FOC and InstaSPIN-MOTION Resources
  • What is InstaSPIN-FOC?
  • What is InstaSPIN-MOTION?
  • InstaSPIN Simulation Tool
  • Product Folder: F28069F, F28068F, F28062F, F28068M, F28069M
  • User’s Guide
  • Technical User’s Manual
  • Tools
  • 2812 timer interrupt urgent !

    2812 timer interrupt urgent !

    This question is answered
    shashank mani
    Posted by shashank mani
    on Apr 10 2012 08:55 AM
    Prodigy170 points

    Hello

    I was trying to write an assembly program to run an ISR during a timer period interrupt. I had configured all my timer control registers and peripheral clocks required for this. I had also populated the PIE vector table with ".sect directive".  When an interrupt occurs, I can see the interrupt vector ID in the PIECTRL register but the service routine is not getting executed. I suspect it is not at all entering into the ISR. I had been trying this for so long. Kindly help me in this regard.

    Regards

    Sashank Mani

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Trey German
      Posted by Trey German
      on Apr 10 2012 09:26 AM
      Genius14800 points

      Shashank,

      Are you sure you have all of the interrupts enabled?  Keep in mind that both the global interrupt flag, the global IER register, and the PIE IER register must be setup for an interrupt to execute.

      Trey

      Trey German

      C2000 Applications

      If a post answers your question, please mark it with the "verify answer" button.
      Visit these helpful C2000 Links!
      C2000 TI Wiki Pages
      TI Forum Sitemap
      ControlSUITE
      C2000 Getting Started
      CLA FAQs
      Workshop Material!
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • shashank mani
      Posted by shashank mani
      on Apr 10 2012 09:40 AM
      Prodigy170 points

      Yes I had initially disabled all the interrupts. I made IER = 0x0000 and disabled PIECTRL. then initialized all sys control registers. initialized timers and then enabled PIEIER. I had followed the flowchart as given in the interrupts reference guide. I was just trying to increment the contents of auxilary register during a period interrupt. Coukd you please give me a sample assembly language program so that I'll get some idea?

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Trey German
      Posted by Trey German
      on Apr 10 2012 09:45 AM
      Genius14800 points

      Shashank,

      While the F2812 isn't really supported within controlSUITE there is still some example software laying around.  I'm not sure if this package will have exactly the assembly code you are looking for, it should have some C examples of how to setup the interrupts.  Take a look at sprc097:

      http://www.ti.com/litv/zip/sprc097

      Trey

      Trey German

      C2000 Applications

      If a post answers your question, please mark it with the "verify answer" button.
      Visit these helpful C2000 Links!
      C2000 TI Wiki Pages
      TI Forum Sitemap
      ControlSUITE
      C2000 Getting Started
      CLA FAQs
      Workshop Material!
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Santosh Athuru
      Posted by Santosh Athuru
      on Apr 10 2012 09:49 AM
      Expert7660 points

      Shashank,

      try defining the ISR function in assmebly as     .sect ".Isr", when we write ISRs in C we have to use interrupt key word, I would assume you will have to do that for assembly routines as well.

      Let us know if it works.

       

      Best Regards

      Santosh

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • shashank mani
      Posted by shashank mani
      on Apr 10 2012 09:49 AM
      Prodigy170 points

      I had already seen the mixed source of many c languages to get an idea but unfortunately I couldnt make out anything. Could you please tell me the procedure that has to be followed to service an interrupt in an assembly language? I had initialized the PIE vector table with . sect  and .long directives. Do we need to  follow a sequence while writing these directives. If yes, how does the interrupt source identify that it has to go to a particular offset in the table?

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • shashank mani
      Posted by shashank mani
      on Apr 10 2012 09:56 AM
      Prodigy170 points

      I had defined the reset vector with .sect ".reset"  vectors with .sect ".vectors" and Pie vectors with .sect ".pievect". And then using .long directive I had initialized all the interrupt. All the interrupts except the one I am using are made dummy. and then I wrote a MAIN loop. At the end of the main loop, I had USED B MAIN instruction

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Santosh Athuru
      Posted by Santosh Athuru
      on Apr 10 2012 10:00 AM
      Expert7660 points

      Shashank,

      along with enabling all the interrupt enabled bits (at PIE level, at CPU level (IER) and the EINT) as Trey suggested, you will have to register the handler with PIE (look at examples Trey pointed out at) . As I said along with all above we define ISRs in C with an interrupt key word, so that the assembler can put the right instructions for stack save and return.

      I would suggest to look at the generated assembly for a C-style declared/defines ISR and follow the same in your assembly interrupt routine defnition.

       

      Best Regards

      santosh

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • shashank mani
      Posted by shashank mani
      on Apr 10 2012 10:04 AM
      Prodigy170 points

      In the mixed assembly source, He was changing the stackpointer at every interrupt. I thought initializing a PIE vector table and defining an ISR would be an easier task than to manually handle the interrupts

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • shashank mani
      Posted by shashank mani
      on Apr 10 2012 12:07 PM
      Prodigy170 points

      This is how I had initialized the table. Kindly tell me what should be the instructions after this if I want to execute Timer1 Period Interrupt.

      VECT:   .sect "vectors"
      .long INIT
      .long ISR1
      .long ISR2
      .long ISR3
      .long ISR4
      .long ISR5
      .long ISR6
      .long ISR7
      .long ISR8
      .long ISR9
      .long ISR10
      .long ISR11
      .long ISR12
      .long ISR13
      .long ISR14

      .sect "pievt"
      PIEVT:
      .long ISR1_1
      .long ISR1_2
      .long ISR1_3
      .long ISR1_4
      .long ISR1_5
      .long ISR1_6
      .long ISR1_7
      .long ISR1_8
      .long ISR2_1
      .long ISR2_2
      .long ISR2_3
      .long SINE
      .long ISR2_5
      .long ISR2_6
      .long ISR2_7
      .long ISR2_8
      .long ISR3_1
      .long ISR3_2
      .long ISR3_3
      .long ISR3_4
      .long ISR3_5
      .long ISR3_6
      .long ISR3_7
      .long ISR3_8
      .long ISR4_1
      .long ISR4_2
      .long ISR4_3
      .long ISR4_4
      .long ISR4_5
      .long ISR4_6
      .long ISR4_7
      .long ISR4_8
      .long ISR5_1
      .long ISR5_2
      .long ISR5_3
      .long ISR5_4
      .long ISR5_5
      .long ISR5_6
      .long ISR5_7
      .long ISR5_8
      .long ISR6_1
      .long ISR6_2
      .long ISR6_3
      .long ISR6_4
      .long ISR6_5
      .long ISR6_6
      .long ISR6_7
      .long ISR6_8
      .long ISR7_1
      .long ISR7_2
      .long ISR7_3
      .long ISR7_4
      .long ISR7_5
      .long ISR7_6
      .long ISR7_7
      .long ISR7_8
      .long ISR8_1
      .long ISR8_2
      .long ISR8_3
      .long ISR8_4
      .long ISR8_5
      .long ISR8_6
      .long ISR8_7
      .long ISR8_8
      .long ISR9_1
      .long ISR9_2
      .long ISR9_3
      .long ISR9_4
      .long ISR9_5
      .long ISR9_6
      .long ISR9_7
      .long ISR9_8
      .long ISR10_1
      .long ISR10_2
      .long ISR10_3
      .long ISR10_4
      .long ISR10_5
      .long ISR10_6
      .long ISR10_7
      .long ISR10_8
      .long ISR11_1
      .long ISR11_2
      .long ISR11_3
      .long ISR11_4
      .long ISR11_5
      .long ISR11_6
      .long ISR11_7
      .long ISR11_8
      .long ISR12_1
      .long ISR12_2
      .long ISR12_3
      .long ISR12_4
      .long ISR12_5
      .long ISR12_6
      .long ISR12_7
      .long ISR12_8

      ; Pie control register. Required to enable PIE
      PIECTRL .set 0x00000CE0

      ; Pie acknowledge register
      PIEACK .set 0x00000CE1

      ; Pie Interrupt Enable Registers
      PIEIER1 .set 0x00000CE2
      PIEIER2 .set 0x00000CE4
      PIEIER3 .set 0x00000CE6
      PIEIER4 .set 0x00000CE8
      PIEIER5 .set 0x00000CEA
      PIEIER6 .set 0x00000CEC
      PIEIER7 .set 0x00000CEE
      PIEIER8 .set 0x00000CF0
      PIEIER9 .set 0x00000CF2
      PIEIER10 .set 0x00000CF4
      PIEIER11 .set 0x00000CF6
      PIEIER12 .set 0x00000CF8

      ; Pie Interrupt flag registers
      PIEIFR1 .set 0x00000CE3
      PIEIFR2 .set 0x00000CE5
      PIEIFR3 .set 0x00000CE7
      PIEIFR4 .set 0x00000CE9
      PIEIFR5 .set 0x00000CEB
      PIEIFR6 .set 0x00000CED
      PIEIFR7 .set 0x00000CEF
      PIEIFR8 .set 0x00000CF1
      PIEIFR9 .set 0x00000CF3
      PIEIFR10 .set 0x00000CF5
      PIEIFR11 .set 0x00000CF7
      PIEIFR12 .set 0x00000CF9
      INIT:
      SETC AMODE
      CLRC OBJMODE
      AND IER, #0x0000
      AND IFR, #0x0000
      //* device peripheral initialization*//
      //*timer initialization*//
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Santosh Athuru
      Posted by Santosh Athuru
      on Apr 10 2012 13:13 PM
      Expert7660 points

      Shashank,

      where are you placing 'sect  "pievt"' in your memory?

      Best Regards

      santosh

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

      I did not place it anywhere as such. I had just written the vector table. I learnt that the vector table is already there in ROM and after power ON it is loaded to RAM

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Santosh Athuru
      Posted by Santosh Athuru
      on Apr 10 2012 13:39 PM
      Expert7660 points

      when PIE is enabled interrupt vector table is located from 0xD00, all interrupt handlers are fetched from this offset to service respective interrupt, refer to your device system control guide -there is a table given. When PIE is disabled interrupt vector table is located in ROM, when PIE is disabled you cannot enable any interrupts shown within the PIE MAP.

      I guess thats the problem, you should link your PIE Vector table to the memory begining at 0xD00. After that you will have to worry about the stack push/pop and return from isr.

       

      Best Regards

      santosh

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • shashank mani
      Posted by shashank mani
      on Apr 10 2012 21:58 PM
      Prodigy170 points

      But I guess it is atleast fetching the vector ID of the interrupt. As i told you I am working on timer period interrupt, I could see 0XD56 in the 0-15 bits of PIE control register.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Santosh Athuru
      Posted by Santosh Athuru
      on Apr 11 2012 10:56 AM
      Expert7660 points

      Sashank

      that looks good - because you are enabling the PIE interrupt and the interrupt is getting triggered, you see those values in the register - CPU Is trying ot fetch interrupt handler at address 0xD56. But your ISR is not getting called because the handler's address is not registered in the PIE Vector table (base starting at 0xD00), once you link your PIE vector table base to address 0xD00 you will see that your interrupt is being called.

      I see that you posted another question in the forum http://e2e.ti.com/support/microcontrollers/tms320c2000_32-bit_real-time_mcus/f/171/t/181805.aspx - if it is the same question, can you please update if you have modified your code as suggested in this forum post. If you have already made the suggested code changes please update us with the details.

      please let us know if you need more clarifications in the above.

      Best Regards

      Santosh

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • shashank mani
      Posted by shashank mani
      on Apr 11 2012 11:28 AM
      Prodigy170 points

      Yes I posted the same thing in the forum. I did not make any changes from yesterday. This is how the code was written but the problem still persists. How do I link my PIE vector table with that base address. This will solve my problem completely. I have al my routines ready. I just have to integrate them into one code. I suppose you have understood  my query correctly now. Thanks a lot for showing ur interest. Kindly help me with this one thing.

      Regards

      Sashank

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    12
    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