Technical discussions about the TI C54x DSPs (including the c5401, c5402, c5402a, c5404, c5407, c5409, c5409a, c5410, c5410a, c5416, c5420, c5421, c5441, c549, c5470 and c5471).
|
Subject: interrupt routine in c ** Proprietary ** hi can anyone tell me how to write an interrupt service routine in c like i tried cc help but it is not very clear suppose if i want to handle int0 then interrupt void int0() { } now how will the code run to the corresponding interrupt location thank u |
|
|
|
Hi N VINODH, > can anyone tell me how to write an interrupt service routine in c > like i tried cc help but it is not very clear > suppose if i want to handle int0 then > > interrupt void int0() > { > } > > now how will the code run to the corresponding interrupt location Very simple. You need to include and edit the file vecs.asm in your project (i.e. comes with C5402 DSK and should be available anywhere in Code Composer directory). Customize the file like this: .title "Vector Table" ; file name .ref _int0 ; reference to int0 interrupt [...] trap2 goto #88h ;08; trap2 nop nop .space 52*16 int0 dgoto _int0 ;40; external interrupt int0 nop nop int1 return_enable ;44; external interrupt int1 nop nop int2 return_enable ;48; external interrupt int2 nop nop nop [...] Hope it helps regards Steffen -- Steffen Luzemann (DL4ALB), emsys GmbH, #+49 3677 / 668253 ax25: dl4alb@db0erf.#thr.deu.eu http://www.emsys.de, http://www.tu-ilmenau.de/~df0hq |
|
Hi I have included three example files which I have taken from one of my C5402 projects. First of all you have to make an assembly file where the interrupt vectors are placed (vectors.asm). This file has references to the interrupt functions ( interrupt.c). Finally the .vectors section has to be placed from the beginning of a 128 byte page ( linker.cmd). Best regards Torgeir Jakobsen Senior Engineer, Technology Department Aanderaa Instruments AS e-mail: web: www.aanderaa.com phone; +47 55 10 99 00 direct: +47 55 10 99 77 fax: +47 55 10 99 10 ----- Original Message ----- From: "N VINODH RATHNA" <> To: <> Sent: Tuesday, October 09, 2001 2:14 PM Subject: [c54x] interrupt routine in c > Subject: interrupt routine in c > > ** Proprietary ** > > hi > > can anyone tell me how to write an interrupt service routine in c > like i tried cc help but it is not very clear > suppose if i want to handle int0 then > > interrupt void int0() > { > } > > now how will the code run to the corresponding interrupt location > > thank u > > > _____________________________________ > | |||
| |||
| |||
|