Skip to main content
Visitor II
July 11, 2004
Question

strange interrupt behavior

  • July 11, 2004
  • 2 replies
  • 773 views
Posted on July 12, 2004 at 00:28

strange interrupt behavior

    This topic has been closed for replies.

    2 replies

    perryliuAuthor
    Visitor II
    July 10, 2004
    Posted on July 10, 2004 at 06:22

    I have a lite timer 1 interrupt to control pulse width. But after several pulse are produced the interrupt is disabled unexpected. If I add ''_asm(''nop'')'' or any other codes to ISR this is not going to happen. Why would _asm(''nop'') affect my routine ?

    My ISR codes:

    {

    iSoftMCount++;

    if(iSoftMCount>=3000) // Overflow

    {

    StaticFlag = 1;

    ucHallFlag = 0;

    LITE1_disableINT;

    iSoftMCount = 0;

    }

    LTCSR1 &= 0xf7;

    _asm(''nop'');

    }

    Some judgement in MAIN:

    LITE1_disableINT; // Disable INT when compare

    if(iSoftMCount>=iStopCount) // Stop

    {

    iSoftMCount = 0;

    ucStep = 0;

    PBDR |= 0x02; // produce pulse

    }

    LITE1_enableINT;

    Any one has any ideas?
    perryliuAuthor
    Visitor II
    July 11, 2004
    Posted on July 12, 2004 at 00:28

    I've changed C compiler (COSMIC) to an old version and the problem seemed to get resolved.

    I am so worried about those compilers.