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.

how to generate interrupts timely using timer in dm6446

Hi all,

i need to run a subroutine for a every fixed amount of time i thougt of using timer to generate the interrupt so as to service my subroutine

i have configured  timer0 as  64bit timer which runs contiounsly these are the registers i have set for timer0

TGCR0 = 0X0

TIM12 = 0X0

TIM34 = 0X0

PRD12 = 0X100

PRD34 = 0X0

TCR0 = 0X80

TGCR0 = 0X3

then i have set interrupt controller registers as

INTMUX3 = 0X0

INTMUX3 = 0X04000000

EVTMASK0 = 0X10

ISTP = FUNTOEXEC

CSR = 0X1| CSR

IER = 0X8003

i have mapped event4 of dsp which is TINT0 as per document on 6446 to interrupt 15 and i have my service routine at INT15 in my func

I could see the timer getting incremented but the interrupt is not getting generated and my service routine is never getting executed. have i missed  somethings which have to be done .  please  suggest  a way to generate interrupt using timer and  to map the events to the interrupts.

thanking you,

Manoj Gupta

 

 

  • Are you wanting this to happen on the DSP or on the ARM? If you are running a typical system with Linux on the ARM and DSP/BIOS on the DSP than you can use a periodic function (PRD) on the DSP as discussed in SPRU403o, or on the ARM you could use standard pthread APIs, for example nanosleep() to delay for a particular time interval. This way the OS will handle configuring the timers and interrupts for you.

  • I want it to happen on DSP side. My prog is working now .the changes i have made are setting  SUSPSRC reg for the timer0  ( though i am not yet sure that it was the prob )since my timer counter is not getting increamented. after setting it i could see my counter getting incremented and the other error i have done is alignment of my isr since last 10 bits of the ISTP reg are reserved my ISR is not getting correct address and going some junk location now i have made my ISR aligned and my porg is working.

    Is there a way to increase the no of interrupts that can be generated right now the no of interrupts generated for me was far less than what i want i have modified the PRD to a low value but yet its not suffiecent yet is a way to generate more no of interrupts

    thanks for the help

    manoj

  • manoj said:
    Is there a way to increase the no of interrupts that can be generated right now the no of interrupts generated for me was far less than what i want i have modified the PRD to a low value but yet its not suffiecent yet is a way to generate more no of interrupts

    If you still want to use the PRD functionality if BIOS you can increase the rate at which PRDs can happen. Typically PRDs are driven by the CLK module of BIOS, and the CLK module can be adjusted to have a higher rate of timer interrupts for faster PRDs. In particular you can adjust CLK.MICROSECONDS to a lower value and BIOS will configure the timer to go faster, the smaller the number the more overhead you have servicing the interrupt but the finer the granularity you have in timing PRDs. This is discussed in section 2.4 of SPRU403g.