Forums

Problems with external interrupt at TMS320LF2407

Started by Taylor April 7, 2005
Hi,
i want to initiate an interrupt with XINT1. I work with C2xx Code Composer
Studio. 
When i run the mainprogramm,it ends in a continuous loop and waits for the
interrupt. If i enable the external interrupt, the interrupt-flag in the
XINT1CR - Register is set but the pogramm doesn�t jump to my defined
subroutine.


I set the XINT1CR = 0x8003; 

//0x0001 enable
//0x0002 low priority ( vector address 0Ch ) int6 
//0x0004 polarity ( interrupt on falling edge )
//0x8000 clear int flag by writing a 1 

in my "vectors.asm" i defined my subroutine like 

ref _c_int0, _xint1_isr
sect    "vectors" 
rest:    B     _c_int0          ;00h   reset
..
..
int6:    B     _xint1_isr       ;0Ch   INT6
..

 

my subroutine is named "interrupt void xint1_isr (void){}"

Did i forget something? Where is the mistake?  I currently train myself in
programming this DSP. 

thnx for your help.

Taylor

		
This message was sent using the Comp.DSP web interface on
www.DSPRelated.com

Taylor wrote:
> Hi, > i want to initiate an interrupt with XINT1. I work with C2xx Code Composer > Studio. > When i run the mainprogramm,it ends in a continuous loop and waits for the > interrupt. If i enable the external interrupt, the interrupt-flag in the > XINT1CR - Register is set but the pogramm doesn�t jump to my defined > subroutine. > > > I set the XINT1CR = 0x8003; > > //0x0001 enable > //0x0002 low priority ( vector address 0Ch ) int6 > //0x0004 polarity ( interrupt on falling edge ) > //0x8000 clear int flag by writing a 1 > > in my "vectors.asm" i defined my subroutine like > > .ref _c_int0, _xint1_isr > .sect "vectors" > rest: B _c_int0 ;00h reset > .. > .. > int6: B _xint1_isr ;0Ch INT6 > .. > >
Do you reach the branch? If not I would say the interrupt is not enabled.
> > my subroutine is named "interrupt void xint1_isr (void){}" >
We write it: void interrupt xint1_isr(){} As "interrupt" is a attribute of a function maybe this matters.
> > >Taylor wrote: >> Hi, >> i want to initiate an interrupt with XINT1. I work with C2xx Code
Composer
>> Studio. >> When i run the mainprogramm,it ends in a continuous loop and waits for
the
>> interrupt. If i enable the external interrupt, the interrupt-flag in
the
>> XINT1CR - Register is set but the pogramm doesn�t jump to my defined >> subroutine. >> >> >> I set the XINT1CR = 0x8003; >> >> //0x0001 enable >> //0x0002 low priority ( vector address 0Ch ) int6 >> //0x0004 polarity ( interrupt on falling edge ) >> //0x8000 clear int flag by writing a 1 >> >> in my "vectors.asm" i defined my subroutine like >> >> .ref _c_int0, _xint1_isr >> .sect "vectors" >> rest: B _c_int0 ;00h reset >> .. >> .. >> int6: B _xint1_isr ;0Ch INT6 >> .. >> >> > >Do you reach the branch? If not I would say the interrupt is not
enabled.
> >> >> my subroutine is named "interrupt void xint1_isr (void){}" >> > >We write it: >void interrupt xint1_isr(){} > >As "interrupt" is a attribute of a function maybe this matters. > >
Yes, you're right. I've forgotten to set the maskbit in IMR for the interrupt. The way of writing the subroutine doesn't make any difference. The programm works quite well with both definitions. thnx Taylor This message was sent using the Comp.DSP web interface on www.DSPRelated.com