This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Hardware simulation problems with embedded loops

I have a problem with hardware simulation using the Cygnal JTAG adaptor. I have code with the following structure:


bit mState = False;
void main (void)
{
[Configuration Code]
while(True)
{
if (mState)
{
[Execute some code]
}
}
}

void ISR_Routine (void) interrupt INT_EX0 using 3
{
mState = True;
}

This works fine for hardware simulation. However, when I add a second-level 'while' loop:

bit mState = False;
void main (void)
{
[Configuration Code]
while(True)
{
if (mState)
{
while (!Condition1)
{
[Execute some code]
}
}
}
}

void ISR_Routine (void) interrupt INT_EX0 using 3
{
mState = True;
}

Now, in hardware simulation, the interrupt doesn't fire when the external interrupt is active. However, if I stop the simulation and cycle the power to the processor, the code runs fine. Is there a way I can get this structure to execute in hardware simulation?

Thanks for your help!

0