• 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 » Embedded Software » BIOS » BIOS forum » C5505 w/DSP-BIOS - can another GP timer be used?
Share
BIOS
  • Forum
  • Announcements
Options
  • Subscribe via RSS

C5505 w/DSP-BIOS - can another GP timer be used?

C5505 w/DSP-BIOS - can another GP timer be used?

This question is answered
Todd Anderson78572
Posted by Todd Anderson78572
on Apr 30 2012 16:27 PM
Expert2780 points

All:

I have the C5505 running at 65.536 MHz, with DSP-BIOS (5.41.11.38), which by default uses general purpose timer 0 and generates a clock tick every 1 millisecond.

Can GP timer 1 be used as well?

If I want to generate an interrupt, how do I do this if general purpose timer 0 is being used by DSP-BIOS?

I need to generate an interrupt every 8.33 msec. With gp timer 1, it looks like I can do that if I set the prescale to 5 and timer period of 109225. However, I am unsure of how to set up the interrupt, because it looks like it is also shared with the timer 0 Bios interrupt. Do I create a new interrupt service routine that distinguishes between a BIOS interrupt and the timer 1 interrupt?

 

Regards,

Todd Anderson

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Todd Anderson78572
    Posted by Todd Anderson78572
    on Apr 30 2012 17:18 PM
    Expert2780 points

    All:

    Just spotted a flaw in my logic - the PSCDIV does not allow for divide by 5, it works in powers of 2 from divide-by-2 to divide-by-8192...

     

    Regards,

    Todd Anderson

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Steven Connell
    Posted by Steven Connell
    on Apr 30 2012 18:27 PM
    Mastermind20540 points

    Todd Anderson,

    Have you seen the BIOS PRD module?  PRD is for "periodic" and will let you create a function that runs periodically.  You can configure how often you want it to run (period) as well as which function to run.

    You can create a new PRD from within the BIOS config file (*.tcf).  Just right click on "PRD - Periodic Function Manager" and then select "insert new PRD".  Then, you can configure the PRD instances' properites:

    Steve

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Todd Anderson78572
    Posted by Todd Anderson78572
    on May 01 2012 08:06 AM
    Expert2780 points

    Steve:

    Thanks for your input!

    Yes, I am aware of the PRD module, but to get the granularity needed to go 8.33 msec between periods would mean that the "usual" tick of 1 msec would suffer. I actually found another way of doing the precedure, so I do not need the timer. However, the question remains - if using a general purpose timer for the DSP-BIOS timer tick, are other GP timers available? OR is it assume that everything will be done under the Bios umbrella?

    If I choose to use one of the other GP timers, how do I handle interrupts?

     

    Regards,

    Todd Anderson

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Steven Connell
    Posted by Steven Connell
    on May 03 2012 19:53 PM
    Mastermind20540 points

    Todd Anderson,

    Did you enable the GP timer interrupt?

    If so, then you should be able to map that interrupt to a HWI in BIOS.  You would configure the HWI whose number matches the GP timer interrupt to run the function (ISR) you define.

    Also, I not sure if you've already seen this but it came up in a Google search: http://www.ti.com/lit/ug/spru595c/spru595c.pdf

    Steve

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Todd Anderson78572
    Posted by Todd Anderson78572
    on May 04 2012 08:13 AM
    Expert2780 points

    Thanks Steve.

    However, I see some problems yet. In the DSP-BIOS GUI, I have a choice of 3 timers to use. If I pick one for DSP-BIOS (say Timer 0), BIOS creates the necessary interrupt service routine to use when servicing "timer ticks." It then looks like I have the choice to use the other 2 timers, if necessary.

    If I use Timer 1, AND I also need to have associated interrupts, then I need to be able to create an interrupt service routine that will distinguish between Timer0 interrupts and Timer1 interrupts, because of the "timer interrupt aggregation." In that interrupt service routine, I would need to "Branch" to the Timer0 interrupt service routine if it was a Timer0-associated interrupt or "Branch" to the Timer1 interrupt service routine for the Timer1-associated interrupt.

    Why is it necessary to use a general purpose timer if I can use PRDs inside of DSP-BIOS? Usually, BIOS events are clocked at a rate of around 1 msec timer ticks, and the PRDs can be set up for larger timings, around increments of milliseconds. There are times that a specific rate is needed - like 8.33 msec - to create a timer tick that would get to that would probably complicate larger timings, create more code, and add additional overhead in terms of interrupt timings.

    All of this assumes that I can use Timer1 when Timer0 is being used for DSP-BIOS. The question I still need answered:

    If Timer0 is being used by DSP-BIOS, do I have access to Timer1 and Timer2?

     

    Regards,

    Todd Anderson

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Steven Connell
    Posted by Steven Connell
    on May 07 2012 19:45 PM
    Verified Answer
    Verified by David Friedland
    Mastermind20540 points

    Hi Todd,

    I found the following in the BIOS API guide for C5000, I think this may be what you need.

    This property lets you specify the function that should run for Timer 0 - 2, as well as the argument to that function and is specific to your h/w (5505).

    (Note: looking at this, I think the value for "Tconf Name: INPUTCLK" may be incorrect and is a bug in the document.  Based on the description, I think what's shown in the Example part is what you need [bios.CLK.TIMER0FUNC]...)

    Timer 0-2 Function. Specifies the function to be executed when the
    corresponding timer interrupt occurs. (’C5505 only.)
    Tconf Name: INPUTCLK Type: Numeric
    Example: bios.CLK.TIMER0FUNC =
    prog.extern("timer0Fxn");
    ❏ Timer 0-2 Argument. Specifies the argument to be passed to the
    timer function when the corresponding timer interrupt occurs.
    (’C5505 only.)
    Tconf Name: INPUTCLK Type: Numeric
    Example: bios.CLK.TIMER0ARG = 0

    Steve

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Todd Anderson78572
    Posted by Todd Anderson78572
    on Jan 16 2013 14:25 PM
    Expert2780 points

    Steve:

    Thanks for you past answer. I noticed that the DSP/BIOS 5.42.00.07 inserts a call to _CLK_dispatch into HWI_4.

    Because it is grayed out, I cannot set up a different routine that would distinguish between the 3 interrupt sources. So, it looks like I cannot use timer interrupts for timer1 or timer2 if I am using timer0 as a BIOS timer tick.

    Regards,

    Todd Anderson

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Todd Anderson78572
    Posted by Todd Anderson78572
    on Jan 16 2013 17:58 PM
    Verified Answer
    Verified by Todd Anderson78572
    Expert2780 points

    I managed to get it working. I can now run timer0 as the DSP/BIOS timer and also set up timer1 to give independent interrupts. I turns out that the key was setting up the pointer to the timer1_isr routine in the CLK - clock manager. With timer0 set up for the BIOS, I was able to point at timer1 tab and set up the pointer to the isr.

    I was then able to set up the GPT functions to get timer1 going - one of the keys is to make sure that the timer1_isr function has two instructions:

        IRQ_clear(TINT_EVENT);    

       CSL_SYSCTRL_REGS->TIAFR = 0x02; // Clear Timer Interrupt Aggregation Flag Register (TIAFR)

    So far, so good. No defined need for the general purpose timers (1 & 2) yet, but there may be an independent time-out that will become necessary.

    Regards,

    Todd Anderson

    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