I've just been using the X2 timer interrupt for the first time and struck this behaviour in simulation.
I'm using PE v6.1.0.0
The simulation is run with a delay of 30ms because this allows you to see the line of code that is being executed.
The timer settings are set so that the timer interrupt happens about ever 2 sec while being simulated on my X200 laptop.
First, run this code with the "DOZE 0" command commented out to demonstrate that the timer interrupt is being triggered. On my laptop the terminal output shows: mmmmmImmmmmImmmmmImmmmmmImmmmmI
Then uncomment the "DOZE 0" command and rerun the simulation. This time the program stops at the DOZE command. The interrupt subroutine is never called.
I'm using PE v6.1.0.0
The simulation is run with a delay of 30ms because this allows you to see the line of code that is being executed.
The timer settings are set so that the timer interrupt happens about ever 2 sec while being simulated on my X200 laptop.
First, run this code with the "DOZE 0" command commented out to demonstrate that the timer interrupt is being triggered. On my laptop the terminal output shows: mmmmmImmmmmImmmmmImmmmmmImmmmmI
Code:
#NO_DATA
#NO_TABLE
#PICAXE 20X2
SETFREQ M4
; Set a polled interrupt on the timer0 overflow
SETINTFLAGS %10000000,%10000000
; Set timer0 so that it occurs frequently during simulation
SETTIMER t1s_4
timer=65534
Main:
SERTXD ("m")
; DOZE 0
GOTO Main
interrupt:
timer=65534
SERTXD ("I")
; We need to re-enable our interrupt. This won't take effect until after we return.
SETINTFLAGS %10000000,%10000000
toflag=0
RETURN