Sign in

username:

password:



Not a member?

Search c54x



Search tips

Subscribe to c54x



c54x by Keywords

5409 | 5416 | AD5 | ADC | BIOS | Boot | Booting | Bootloader | C540 | C5402 | C5409 | C5416 | CCS | Codec | DMA | Dmad | DSK | DSKPlus | Dsplib | EVM | FFT | FIR | Flash | GPIO | HPI | Initialization | Interrupt | JTAG | LOG_printf | MCBSP | RFFT | RTDX | Sampling | STLM | UART | VC540

Ads

Discussion Groups

Discussion Groups | TMS320C54x | interrupt routine in c

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).

  

Post a new Thread

interrupt routine in c - N VINODH RATHNA - Oct 9 12:14:00 2001



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






(You need to be a member of c54x -- send a blank email to c54x-subscribe@yahoogroups.com )

Re: interrupt routine in c - Steffen Luzemann - Oct 10 13:43:00 2001

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




(You need to be a member of c54x -- send a blank email to c54x-subscribe@yahoogroups.com )

Re: interrupt routine in c - Torgeir Jakobsen - Oct 10 15:59:00 2001

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 >
>
> _____________________________________ >


Attachment (not stored)
vector.asm
Type: application/octet-stream

Attachment (not stored)
linker.cmd
Type: application/octet-stream

Attachment (not stored)
interrupt.c
Type: application/octet-stream



(You need to be a member of c54x -- send a blank email to c54x-subscribe@yahoogroups.com )