Skip to main content
Visitor II
July 4, 2003
Question

interrupts with ST72F

  • July 4, 2003
  • 4 replies
  • 941 views
Posted on July 04, 2003 at 04:40

interrupts with ST72F

    This topic has been closed for replies.

    4 replies

    vianneyAuthor
    Visitor II
    July 3, 2003
    Posted on July 03, 2003 at 11:07

    Hi,

    I'm using ST72F521, I use metrowerks compiler and I am working on interrupts management.

    I saw on ST7 datasheet that the dedicated interrupt instruction set was given on page 37.

    Has someone got the the equivalent of theese instructions in C language, please?

    I would appreciate if someone would be able to give me a sample of code please.

    Thanks you for answering.

    Best regards.

    Junior
    Visitor II
    July 3, 2003
    Posted on July 03, 2003 at 11:53

    For Hiware Compiler use

    asm RIM; // To enable interrupts

    asm SIM; // To disable interrupts

    For Cosmic Compiler use

    _asm(''RIM''); // To enable interrupts

    _asm(''SIM''); // To disable interrupts
    vianneyAuthor
    Visitor II
    July 3, 2003
    Posted on July 03, 2003 at 13:21

    Thank you!!

    So it means that if I put the instruction ''asm RIM;'' in the main function of my program and if I add a function like :

    '' interrupt void main_interrupt(void)

    {....

    }''

    The instruction in this function will be executed if an interrupt occurs?

    Junior
    Visitor II
    July 4, 2003
    Posted on July 04, 2003 at 04:40

    Don't forget that

    1) for HIWARE you need to use the #pragma TRAP_PROC

    2) for COSMIC you need to use @interrupt

    directives.

    Refer your Compiler documentation for more details.