This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Generate Timer interrupts in dspbios without the PRD settings in the tcf-file

Hi,

I´m using the C6747 (OMAP137) and have a couple questions regarding the timer interrupts in DSP BIOS.

In DSP BIOS you can set up a number of timer interrupts via the Periodic Function Manager. I would like to set up a number of single timer interrupts in my code based on certain events and I don´t know when they occur in time. So the questions are:

- It is possible to set up a timer that generates an interrupt after a certain time period with one or several registers in Timer 1? In that case, which registers do I need to configure/change in run-time?

- Is it possible to use the "compare-match" (CMP0 - CMP7 for timer 1, Linux on GPP uses timer 0) registers for the wanted interrupts?

  • I am not sure I understand what exactly you are trying to accomplish here. The purpose of the timer in BIOS is to set up interrupts that occur at specific moments in time. This interrupts is synchronous by definition. What you are describing is an asynchronous interrupt system which is contradictory to how a timer works.

    Perhaps you can elaborate as to what you mean by "certain events." When I hear the term event I typically think of one of the peripherals receiving a word or a GPIO pin getting toggled by an external device. To answer your specific questions...

    Marcus said:
    - It is possible to set up a timer that generates an interrupt after a certain time period with one or several registers in Timer 1? In that case, which registers do I need to configure/change in run-time?
    You can set up the timer(s) in a "traditional" sense where the counter counts and generates an interrupt whenever it equals the contents of the period register. Additionally...

    Marcus said:
    - Is it possible to use the "compare-match" (CMP0 - CMP7 for timer 1, Linux on GPP uses timer 0) registers for the wanted interrupts?
    Yes, the CMPn registers can be used to generate additional interrupts without resetting the value of the timer's counter register. Per Section 2.4 of the Timer User Guide the CMPn registers can be set and will generate separate interrupts as long as TGCR.PLUSEN = 1; however, I do not know whether or not the CMPn registers can be modified dynamically while the timer is running.

  • It is tricky to describe...but assume that I have set up an interrupt with the Peridic function manager of 40ms (every new slot in a radio system). So, depending on if my application is in transmit or receive mode I would like to do different things in the actual slot. If the application is in receive mode then I would like to generate a single timer interrupt after perhaps 2ms to be able to start the function "search for frame sync" pattern in the received bitpattern. The system is syncronised by the time stamps of the received messages so in the next receiver slot I perhaps need to have a timer interrupt of 2.5ms for the "search for frame sync". So how can I accomplish this with the timers in DSP BIOS? Is it possible to write to one of the several registers to get an interrupt with the wanted function call?

  • This sounds like a "one-shot" PRD (as opposed to continuous).  Your granularity would be limited to the granularity of your system tick in this case.  For example with a 1ms tick (typical value) you would have to choose a PRD that is a multiple of 1ms.  You can do this with a timer if you'd rather but it will be more work to setup the timer and corresponding interrupt.

    Brad

  • I have tried a different way to solve my problem.  Now I'm using the CHIPSIG and CHIPSIG-register to get a HWI-interrupt from inside my code and it seems to work properly. Unfortunately, the CHIPSIG-registers are used by another part of the SW application and now I wonder if you can suggest another similar register for the "interrupt signalling"?

    Is it possible to "reset" the CLK_getltime counter so it restarts the counting?

    I have tried to use the following code (below) to change the frequency in my system ("test case") but it will only change the timerinterrup "lengths" once even though I call this code once every second. Any suggestions?

     frequency = GBL_getFrequency();

      // SWI_disable(); or HWI_disable
     HWI_disable();

     GBL_setFrequency(frequency*0.9);

     CLK_stop();    

     CLK_reconfig();

     CLK_start();

     // SWI_enable(); or SWI_disable
     HWI_enable();