DSPRelated.com
Forums

Interrupts with timer (TMS320C5402)

Started by jjnews2000 June 8, 2004
Hi everybody,

I'm trying to realise an interrupt generated by the timer but
unfortunately the code lines included in the interrupt program (i
hope
this is clear enough)are never done.
I read the documentation about the timer and also about interrupts,
but i don't succeed in understanding how i must tell the DSP to go to
my interrupt program whenever the interrupt generated by the timer
happens.
Can someone give me a code example (in C if it's possible) so that i
understand (with explanations too). Thank you very much.

Here is a sample of my code. I f you see something wrong please tell
me about it.

"
void main(void)
{
brd_init(100);

*(volatile unsigned int *)0x0007 |=0x0800;
*(volatile unsigned int *)0x0007 &=0xFEFF;
*(volatile unsigned int *)0x001D =0x00F8;
*(volatile unsigned int *)0x0000=0x0000;
*(volatile unsigned int *)0x0001=0xFFFF;

*(volatile unsigned int *)0x0026 |=0x0010;
*(volatile unsigned int *)0x0025=0xC34F;
*(volatile unsigned int *)0x0026 |=0x0001;
*(volatile unsigned int *)0x0026 |=0x0020;
*(volatile unsigned int *)0x0000 |=0x0010;
*(volatile unsigned int *)0x0007 &=0xF7FF;
*(volatile unsigned int *)0x0026 &=0xFFEF;
for(;;);

}

interrupt void toz (void) /* Here i don't know how to declare this */
{

*(volatile unsigned int *)0x0007 &=0xDFFF; /* bit
XF=0 */
*(volatile unsigned int *)0x0007 |=0x2000; /* bit
XF=1 */

}
"

I removed the comments because they were in French.

Hope someone can help me once again.

Thanks.

Jerome