Skip to main content
Visitor II
June 20, 2005
Question

Problem with ST7LITE0 interrupt

  • June 20, 2005
  • 3 replies
  • 896 views
Posted on June 20, 2005 at 08:51

Problem with ST7LITE0 interrupt

    This topic has been closed for replies.

    3 replies

    Visitor II
    June 19, 2005
    Posted on June 20, 2005 at 00:23

    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=false
    Visitor II
    June 20, 2005
    Posted on June 20, 2005 at 06:54

    change

    void Timebase_1mS(void)

    with

    @interrupt void Timebase_1mS(void)

    Regards,

    Luca (Cosmic)

    Visitor II
    June 20, 2005
    Posted on June 20, 2005 at 08:51

    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