| Author | beginning argument ( Replies received: 2 ) |
| kounst |
Posted 27-07-2008 at 14:52   |

Registered on : 07-27-2008
Messages : 2
OFF-Line
|
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
|
|
|
Profile
Quote
|
| woro |
Posted 28-07-2008 at 10:21   |

Registered on : 07-17-2003
From Germany
Messages : 189
OFF-Line
|
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
|
|
|
Profile
Quote
|
| kounst |
Posted 28-07-2008 at 10:56   |

Registered on : 07-27-2008
Messages : 2
OFF-Line
|
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
|
|
|
Profile
Quote
|