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 |
|
interrupt routine in c
Started by ●October 9, 2001
Reply by ●October 10, 20012001-10-10
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 |
Reply by ●October 10, 20012001-10-10
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 > > > _____________________________________ > Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer. You need to do a "reply all" if you want your answer to be distributed to the entire group. > > _____________________________________ > About this discussion group: > > To Join: Send an email to > > To Post: Send an email to > > To Leave: Send an email to > > Archives: http://www.yahoogroups.com/group/c54x > > Other Groups: http://www.dsprelated.com > ">http://docs.yahoo.com/info/terms/ | |||
| |||
| |||
|