2005-06-19 11:51 PM
2005-06-19 03:23 PM
Hi,
I have a problem working on LITE0 LT timer interrupt. I had compiled a simple program and it works initially. The timer is able to interrupt and service the routine. However, it is unable to return to the main routine after the interrupt. What could have been the problem? I have attached my main.c and vector.c Rgds, Nick ________________ Attachments : program.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0CE&d=%2Fa%2F0X0000000bV6%2F4F4eVaO_.2lmtWLIjpBNJf9kjz9WZRKfSLh3FHDSAEY&asPdf=false2005-06-19 09:54 PM
2005-06-19 11:51 PM
Hi Nick,
by the way: if you are using a Metrowerks compiler you have to declare your routine as interrupt-routine with the #pragma directive #pragma TRAP_PROC (or #pragma TRAP_PROC SAVE_REGS) void Timebase_1mS(void) ...... In addition: Parts of the vector table should be of the type void (*NAME)(void) . Wonder what the casting operator of the compiler does with a ''0'' in the vector table.... Another thing: Be careful with comments in a #define directive. Because e.g. #define RIM _asm('' rim'') //comment will substitute the string ''RIM;'' for _asm('' rim'') //comment;that means the '';'' will be ineffective after substitution. Better you use the comment with /* ... */ e.g. #define RIM _asm('' rim'') /* comment */or strictly abstain from using comments in #define directives. Regards WoRo