V6.0.8.11 multi task simulation hangs at INTERRUPTs RETURN statement.

wccronje

New Member
This problem occurs in the SIMULATOR only!
sample program below:-
Multitask program.
Start1 suspends itself.
An interrupt from pinsc.3 contains a PAUSE then: the PAUSE has no effect i.e. it runs past the pause. The simulator stop at the RETURN statement.
Remove the PAUSE and the simulation runs OK.
Remove the START1: section and the simulation runs OK with the PAUSE staement.

V5 simulator runs OK.
Load the program on a chip and it runs OK.

#picaxe 20m2
#simtask all
start0:
'********* SETUP ***************
'let dirsC = %00000011 'switch pins 0 and 1 to outputs
setint %00001000,%00001000

gosub dowhile

Main:
goto main

dowhile:
do while bit0 = 0
loop
return

start1:
suspend 1
main1:
goto main1

interrupt:
bit0 = 1
pause 1000
return
 

hippy

Ex-Staff (retired)
Welcome to the PICAXE forum.

And apologies for what seems to be odd behaviour when simulating interrupts in multi-tasking programs which we are investigating.
 

wccronje

New Member
I am now using Editor 6.0.9.2 but have much the same problem as in the original post. Simulate the following:-

#picaxe 20m2
#simtask all
'=========================================================================================
'This is to demo a "hang" condition in multi task simulation (Editor 6.0.9.2).
' CONDITION:-
'1) a PAUSE must have been encountered during an INTERRUPT process
' AND
'2) task 1 must be in SUSPENSION when the program reach the interrupt's RETURN statement
' THEN
' the sumulation will "hang" at the interrupt's RETURN statement.
' Remove the pause or resume the suspended task then the simulation will go throuh.
'=========================================================================================
start0:
init_routine:
suspend 1 ' <<<<<<<<<<<<<
Main:
do until pinc.1 = 0
loop
setint or %00000010,%00000010
goto main
end
subr:
inc b12
'pause 1 '<<<<<<<<< uncomment this pause and the simulator will get stuck at the interrupt's return below
return
start1:
main1:
pause 10
goto main1
end
interrupt:
gosub subr
pause 1 '<<<<<<<<< uncomment this pause and the simulator will get stuck at the interrupt's return below
inc b10
'resume 1 '<<<<<<<<< resume the task at least here else the simulation will hang at the RETURN.
return
 

hippy

Ex-Staff (retired)
Please accept our apologies for not having fixed things fully and thanks for your help in highlighting what causes the issue.

I guess there is some more investigation to do to figure out what the issue may be. I will make a note of that.
 
Last edited:
Top