Setint command query

BrendanP

Senior Member
The manual states on page 149 basic comms that.....

"...When the interrupt occurs, the interrupt is permanently disabled. Therefore to
re-enable the interrupt (if desired) a SETINT command must be used within
the interrupt: sub-procedure itself. The interrupt will not be enabled until the
‘return’ command is executed...."

Does this mean that the seting command MUST be reissued in the interrupt sub procedure even if I dont want to use it right away. Can I reissue the setint in another part of the program latter on when I want to write data to the scratch pad again?

I'm struggling with the scratch pad and am trying to eliminate 'suspects'.
 

BeanieBots

Moderator
The wording does imply that it must be within the interrupt sub-routine but I've not had any problems turning interrupts on and off within the main code.
 

ciseco

Senior Member
Brendan,

I think you are right in your thoughts, from my experience its not a must, it's a case of if you need an interupt again it needs to be invoked once more, you can decide when that is

Miles
________
Chrysler air raid siren history
 
Last edited:

xzoqick

New Member
I have the problem that I don't want to Return and continue with the pre-interrupt code but Goto a new set location when continuing.
I've tried to avoid the 'return' command without success.

Is there a way?
 

BrendanP

Senior Member
Maybe have a byte value set to something in the interrupt, then when the prog returns to the point immediately after the interrupt line have a line "if b10=1 goto xyz", if the interrupt hasn't been triggered it will ignore that line because the b10 wont be 1.

Don't know if that helps! My brain is fried.
 

Jeremy Leach

Senior Member
I'm sure you don't need to re-enable the interrupt within the interrupt routine. My view of the interrupt routine is that it's just a normal subroutine EXCEPT the method it's called.

I don't think you can avoid returning to the code that was running when the interrupt was fired. So the only way, as you say, is to have a check in the code to see if the interrupt has fired. The way I've done this is just with a simple flag variable.
 
Last edited:

westaust55

Moderator
Interrupts

SETINT can be turned on and off at any time.

There is a specific SETINT OFF case to disable interrupts.

When an interrupt occurs, as per the manual the interrupt is automatically disables (basically same as SETINT OFF).

If and when you wish to act upon interrupts again at a further time, you just need to re-enable using the SETINT command whether this is at the end of the interrupt subroutine or at some other point in the program.

You cannot avoid having a RETURN command. Ommission of the return command would leave the program address where execution was up to before the interrupt on the processor stack so causing problems if there were any other prior gosubs etc as program execution/sequence would/may be altered.

Unless you have a small loop efefctively waiting for the interrupt, there is no way of knowing where in your program an interrupt will occur and thus you would need many checks for a flag at various points in the program to try and achieve what you wish to do.
 
Last edited:
Top