Hi
I did a quick search on this but did't really turn up anything
but it's probably all been done before.
When using interrupts sometimes you don't want the program
to return to where it was before the interrupt occured, you just
want to stop everything that was happening and perform some
function in the interrupt routine and then return to the start
of the program and wait for a new command. I've removed the
SETINT and RETURN commands and replaced them with POKE 02,0
to set the program counter at the reset address 0x00.
I've tested this and it appears to be working as intended, anybody
see any problems doing this ???.
I did a quick search on this but did't really turn up anything
but it's probably all been done before.
When using interrupts sometimes you don't want the program
to return to where it was before the interrupt occured, you just
want to stop everything that was happening and perform some
function in the interrupt routine and then return to the start
of the program and wait for a new command. I've removed the
SETINT and RETURN commands and replaced them with POKE 02,0
to set the program counter at the reset address 0x00.
I've tested this and it appears to be working as intended, anybody
see any problems doing this ???.
Code:
#Picaxe 18x
setint %00000001, %00000001 ;Set interrupt to pin0
do
high 0 ;Pin0 high while waiting for interrupt
loop
Interrupt:
low 0 ;Pin0 low on interrupt
high 1 ;Pin1 high, will go low on reset
pause 1000 ;1 second delay before reset
poke $02,0 ;Put the program counter at reset vector 0x00