Reply by Brian C. Lane October 2, 20002000-10-02
On Mon, 02 Oct 2000 13:46:14 -0400, you wrote:

>Posted to comp.dsp and
>
> I've read through everything I can find on Code Composer Studio, and
>can't get
>an interrupt function to be called. It's a C function and has the proper
>#pragma
>INTERRUPT (func); before the definition.
> The documentation seems to not show how to write and compile/assemble
>source
>code that sets the vectors. The DSP/BIOS has calls to handle interrupts,

You need to write the interrupt vector code in assembly, pointing it
to your 'C' functions. The assembly guide has some examples, or you
can use this code which I modified from the DSK plus examples. I find
it safer to call a program specific assembly _processor_init routine
which then calls the 'C' initialization routine _c_int00, this way
your hardware isn't flopping about while it is initializing ram, etc.

This should work for you, but please note that it has been chopped
out of some working code without testing, and that I don't use 'C' for
any interrupts.

In your linker file:

MEMORY
{
PAGE 0 :
VECTORS : origin = 0FF80h, length = 00080h
}

SECTIONS
{
.vectors : load = VECTORS PAGE 0
} And a separate vectors.asm file

.width 80
.length 55
.title "Vector Table"

.sect ".vectors"

.ref _c_int00
.ref _timer_irq
.ref keypad_0
.ref keypad_1
.ref keypad_2
.ref keypad_3
.ref _processor_init

.mmregs

;reset goto _c_int00 ;00; RESET
reset goto _processor_init ;00; RESET
nop
nop
nmi return_enable ;04; non-maskable external interrupt
nop
nop
nop
trap2 return_enable ;08; trap2
nop
nop
nop
.space 52*16 ;0C-3F: vectors for software interrupts
18-30
int0 goto keypad_0 ;40; int0 intrrupt, keypad input line
nop
nop
int1 goto keypad_1 ;44; int1 intrrupt, keypad input line
nop
nop
int2 goto keypad_2 ;48; int2 intrrupt, keypad input line
nop
nop
tint return_enable ;4B; Timer #0 interrupt
nop
nop
nop
brint return_enable ;50; BSP receive interrupt
nop
nop
nop
bxint return_enable ;54; BSP transmit interrupt
nop
nop
nop
dmac0 return_enable ;58; DMA #0 interrupt
nop
nop
nop
tint1 return_enable ;5C; Timer #1 or DMA #1 interrupt
nop
nop
nop

int3 goto keypad_3 ;60; int3 interrupt, keypad input line
nop
nop
hpiint return_enable ;64; HPIint
nop
nop
nop

trint goto _timer_irq ;68; Run the codec and serial port
nop
nop

txint return_enable ;6C; TDM transmit interrupt
nop
nop
nop

dmac4 return_enable ;70; DMA #4 interrupt
nop
nop
nop
dmac5 return_enable ;74; DMA #5 interrupt
nop
nop
nop

.space 8*16 ;78-7F; reserved area -----------------
Brian C. Lane Programmer
www.shinemicro.com RF & Microcontroller Design


Reply by Ben Bradley October 2, 20002000-10-02
Posted to comp.dsp and

I've read through everything I can find on Code Composer Studio, and
can't get
an interrupt function to be called. It's a C function and has the proper
#pragma
INTERRUPT (func); before the definition.
The documentation seems to not show how to write and compile/assemble
source
code that sets the vectors. The DSP/BIOS has calls to handle interrupts,
but I
really don't want to to use the DSP/BIOS. It appears that TI strongly
encourages
one to write any system to use it, but I'd rather not if I can help it.
I'm familiar with how the 54x's IPTR field of the PMST register points
to the
start of the interrupt vectors, the problem is how to set these vectors.
I've had no trouble using interrupts on many other processors, including
the
Motorola 56824 and the Zilog Z89321 DSP's.
-----
http://listen.to/benbradley