cancel
Showing results for 
Search instead for 
Did you mean: 

strange interrupt behavior

perryliu
Associate II
Posted on July 12, 2004 at 00:28

strange interrupt behavior

2 REPLIES 2
perryliu
Associate II
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?
perryliu
Associate II
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.