just can't figure out why this 1 second interrupt doesn't work on my 20X2. And neither can Chat GPT.
Help GREATLY appreciated - I'm an interrupt newbie....
#picaxe 20x2
#no_table
#no_data
symbol seconds = b0 ; Variable to hold elapsed seconds
setfreq m4 ; Set operating frequency to 4 MHz
settimer t1s_4 ; Configure timer for 1-second intervals
setintflags %10000000, %10000000 ; Enable interrupt on timer overflow
main:
do
sertxd(#seconds, 13, 10) ; Send elapsed time to terminal
pause 1000 ; Prevent terminal flooding
loop
interrupt:
inc seconds ; Increment seconds counter directly
toflag = 0 ; Clear the timer overflow flag
setintflags %10000000, %10000000 ; Re-enable interrupt
return
Help GREATLY appreciated - I'm an interrupt newbie....
#picaxe 20x2
#no_table
#no_data
symbol seconds = b0 ; Variable to hold elapsed seconds
setfreq m4 ; Set operating frequency to 4 MHz
settimer t1s_4 ; Configure timer for 1-second intervals
setintflags %10000000, %10000000 ; Enable interrupt on timer overflow
main:
do
sertxd(#seconds, 13, 10) ; Send elapsed time to terminal
pause 1000 ; Prevent terminal flooding
loop
interrupt:
inc seconds ; Increment seconds counter directly
toflag = 0 ; Clear the timer overflow flag
setintflags %10000000, %10000000 ; Re-enable interrupt
return