pause command seemingly ignored...

edmunds

Senior Member
Dear all,

I'm confused about this code ignoring pause 16000 between TestFWD and TestBWD subprocedures of newmain: in the file below. Can anyone spot what is wrong with it?


Thank you for your time,

/Edmunds
 

Attachments

inglewoodpete

Senior Member
I see that you have a timer interrupt activated. When an interrupt event occurs, it will be processed between execution of foreground commands OR IMMEDIATELY if currently executing a pause command.

How do I know? I've been caught out more than once (even when I should have known better).

BTW from my experience, use of the Pause command is not recommended, particularly in sophisticated programs. Better to use the Timer interrupt to increment a counter.
 

hippy

Technical Support
Staff member
I would also guess it's the interrupt prematurely terminating the PAUSE command.

The easiest way round that would be to disable interrupts then pause, re-enable interrupts after the pause or at the start of the next function which requires those.
 

AllyCat

Senior Member
Hi,
BTW from my experience, use of the Pause command is not recommended, particularly in sophisticated programs. Better to use the Timer interrupt to increment a counter.
Agreed. But if you want to be "lazy", set the PAUSE to be about the same length as the interrupt execution time (or perhaps twice as long, depending on your required timing tolerances) and put the PAUSE in a FOR .. NEXT loop to repeat for the required total "Pause" time. ;)

Cheers, Alan.
 
Top