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.

Timer Configuration for 1msec without Interrupt.

Hi All,

I'm using vision SDK 2.12.3 and TDA2EX  hardware . I want to configure GP Timer2 as 1ms timer without interrupt .20Mhz system clock is used for time tick.

I have configured the timer in auto reload mode , emulation free mode and with initial count as 0xFFFFB1DFU and reload count value as 0xFFFFB1DFU . 

When I'm debugging it in CCS 7.1.0.00016  timer is starting when the ST bit of TCLR timer is made equals to 1 but  timer is not incrementing periodically(sometimes incrementing sometimes decrementing) and it’s not able to attained 0xFFFFFFFF value.

Please help me in resolving this issue.

  • Hi Ashish,

    I have forwarded your question to an expert for comment.

    Regards,
    Yordan
  • Thanks for your reply Yordan,

    Now I have tried using the Timer 2 as on shot timer , in emulation free mode with Initial count as 0xFFFFB1DFU. I'm continuously monitoring the ST bit of TCLR register and whenever its becoming zero after overlap I'm again reloading the timer intial value to 0xFFFFB1DFU. The system clk used for this 20MHz. But with this I'm able to achieve 2.75ms as minimum Timer duration. How I can get 1msec in this mode, can anyone help in the same.
  • Hi Ashish,

    How to generate a 1 ms tick is well documented in section "1-ms Tick Generation (Only TIMER1, TIMER2 and TIMER10)" in "General-Purpose Timers" chapter of TDA2Ex TRM. Can you please refer to it. Thanks

    Regards,
    Rishabh
  • Thanks for the reply Rishabh,

    I've gone through the TRM manual in that it is mentioned that we have to configure the TPIR ,TNIR and TLDR registers, to do this I'm using Vision SDK 12.2.3 code but in the code TPIR and TNIR registers are not configured. 

    Please give your feedback on the same.

    And please give your suggestion that how we can configure a Timer as one shot timer, without interrupt .

    Thanks and Regards,

    Ashish   

  • Ashish

    VSDK alreday has this configured for each core, for example, for DSP1, please refer - \vision_sdk\src\main_app\tda2ex\dsp1\Dsp1.cfg
    Its configured using Bios API.
    one timer for the TimestampProvider and another for Bios clock ticks

    regards, Shiju
  • Hi Shiju and Rishabh ,

    Below mentioned are the configurations which we have done for our timer:
    1)Configured the timer as 1 msec ,one shot timer ,free run emulation timer with count value as 0xFFFFB1E0. The timer is working on 20MHz clock frequency.
    2) We are continuously monitoring the ST bit of TCLR reg as when ever overflow happens the timer will stop and ST will become zero.
    Once the over flow happens we are again initializing the count value and stating the timer.
    As I have gone through the TRM timer module I didn't fine any bit which I can monitor in auto reload mode for overflow WITHOUT any INTERRUPT ENABLED.

    We needs to configure for timer :
    1) The timer needs to be configured as auto reload Timer with all the interrupts disabled as our bootloader scheduler is working on polling method.
    2) We need one bit which can be monitor for overflow for timer without any interrupt enable.

    Please help us for the same.

    Thanks and Regards,
    Ashish Harit
  • Hi Ashish,

    Any CPU will not receive the interrupt if the particular interrupt is not enabled on CPU side.
    You can enable the Timer interrupt and poll on the Timer overflow interrupt bit.

    Regards,
    Rishabh