cancel
Showing results for 
Search instead for 
Did you mean: 

capture interrupt return

kounst
Associate II
Posted on July 28, 2008 at 07:26

capture interrupt return

3 REPLIES 3
kounst
Associate II
Posted on July 27, 2008 at 11:22

Hello,

I'm trying to measure out a pwm signal using the input capture of timer a.

The interrupt is triggert but the micro seems to hang up when it should return from ISR.

my code:

void TIMERA_IT_Routine(void){

unsigned char Temp;

/* Insert your code here... */

Temp = TAIC1HR;

Temp = TACSR;

Temp = TAIC1LR;

}

By now the ISR should do nothing but return.

I hope somebody can help me!

Regards

wolfgang2399
Associate II
Posted on July 28, 2008 at 06:51

Hi Kounst,

to generate an 'IRET' instead of a 'RET' at the end of your routine, you have to qualify this routine as interrupt routine. You can do it with

at COSMIC:

@interrupt void TIMERA_IT_Routine(void){...

at Metrowerks (Hiware):

#pragma TRAP_PROC or #pragma TRAP_PROC SAVE_REGS

void TIMERA_IT_Routine(void){...

Ensure that all the used registers have been saved! Read the manual to find out how to do this with your compiler.

Regards,

WoRo

kounst
Associate II
Posted on July 28, 2008 at 07:26

Danke!! 🙂

That was not really the solution but it helped me find the actual problem.

my code was:

@interrupt

...

extern int count;

void ISR{}

So ''@interrupt'' wasn't missing but ''extern int count'' may not stand in between.

Best Regards