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.

Using TIMER0 & TIMER1 simultaneously using DSP/BIOS on a C5505 etc.

Hi,

I would like to configure both timers, TIMER0 & TIMER1 in DSP/BIOS 5.41 on a C5505 DSP. There is a CLK-Clock Manager which allows for the setup of the DSP system clock, however we also require an independent timer that is activated deactivated occasionally and with a much smaller granularity (of the order of 100s of us rather than ms). So TIMER1 seems like a good contender as it is currently not used for anything.

DSP/BIOS graphic configuration does not appear to allow for the the setup and use of TIMER1 as straight-forward as for TIMER0, except that I see there is a function that may be called for TIMER1 etc. perhaps this could be use ?!? However, the configuration of TIMER1, does it need to be done manually using the CSL libraries etc. ?? Or can it be done in DSP/BIOS just like for TIMER0 system clock ??

Basically how can the TIMER1 be set-up and configured using DSP/BIOS 5.41 so that an ISR function is called periodically, say every 100us ? As I mentioned the other TIMER0 needs to work independently and has a lower granularity etc. so I cannot use it for the 100us interrupts.

Many thanks in advance for any info.

Regards, M MARIN

 

 

  • Hi,

    Ok no probs, it's been sorted. Works just fine. Thanks anyways.

    M MARIN

  • Sorry for late reply, but there's an appendix in the C55x API manual (SPRU404P) that summarizes the C5505 timer use.   We program one of the 3 timers for the BIOS tick.  We don't support programming the other 2 timers, but we do support the shared timer ISR.  There's a single ISR for all 3 timers and we have a dispatcher that checks which one(s) are pending so we can call the appropriate function.

    -Karl-

  • Karl Wechsler said:

    Sorry for late reply, but there's an appendix in the C55x API manual (SPRU404P) that summarizes the C5505 timer use.   We program one of the 3 timers for the BIOS tick.  We don't support programming the other 2 timers, but we do support the shared timer ISR.  There's a single ISR for all 3 timers and we have a dispatcher that checks which one(s) are pending so we can call the appropriate function.

    -Karl-

    Hi,

    thanks for the quick reply. Yes I've figured that this may be the case. We are currently using the dispatcher to treat the TIMER1 in another function, however if two timer interrupts occur at the same instance which one will be serviced first TIMER0 or TIMER1 for instance ??

    Regards, M

     

  • Simultaneous timer interrupts are serviced in timer number order (ie 0, 1, 2).

    Below is the timer interrupt dispatcher code:

    Void CLK_dispatch(Arg arg)
    {
        if (CLK_timerIAFR & 0x1) {
            CLK_timer0func(CLK_timer0arg);
        }
        if (CLK_timerIAFR & 0x2) {
            CLK_timer1func(CLK_timer1arg);
        }
        if (CLK_timerIAFR & 0x4) {
            CLK_timer2func(CLK_timer2arg);
        }
    }

    Alan

  • This is a good explanation and I understand now how dispatching of various timer works, but I'm not sure how to set the timer periods. For example I want to set timer1 and timer 2 to have different periods. Do I do that in Bios config somehow, or I need to use CSL GPT timer fuctions?

     

     

  • In general, BIOS provides configuration parameters only for the timer it uses for its CLK tick. Configuring other timers is considered an application issue.

    Due to the fact that  the C5505 timers all share a common interrupt, in order for BIOS to gracefully share this interrupt, a C5505-unique timer interrupt dispatcher mechanism was developed that allows the user to configure an ISR function for the timers not being used by BIOS. No additional support for configuring the other timers is provided within BIOS.

    Alan