>from the help line
>Can you advise whether I can still depend on times now? Thank you.
Actually string functions, PRINT is normally one of them, should not be placed
inside an interrupt routine. It can be useful to throw one in just to see if
the interrupt happens, but they are not re-entrant and the string accumulator is
not saved on entry to an interrupt.
So that is most likely your problem.
In your example, why not use the built in RTC ??
-------------------------CODE:-----------------------
sbr:
mi=mi+1
if mi=60 then
ho=ho+1
mi=0
end if
if ho=24 then
ho=0
da=da+1
end if
print da;\" \";ho;\":\";
if min>9 then print mi else print \"0\";mi
return
main:
rpt:
on timer 60000 sbr
stop
-----------------
0 0:01
0 0:02
Prefetch Abort ea64
allowed operations inside interrupts in BASIC
-
YahooArchive
- Posts: 1462
- Joined: Fri Oct 19, 2012 5:11 am
-
YahooArchive
- Posts: 1462
- Joined: Fri Oct 19, 2012 5:11 am
Re: allowed operations inside interrupts in BASIC
In addition, while sbr: functions as a subroutine, the compiler doesn't know
that when it compiles it. And the code for subroutine entry may not be correct,
and the ON TIMER requires that code to be there. So for ON TIMER it should be
SUB sbr
...
END SUB
Just like INTERRUPT SUB must be used when trying to tie a hardware interrupt to
a routine.
> In your example, why not use the built in RTC ??
>
> -------------------------CODE:-----------------------
> sbr:
> ...
> return
> main:
> rpt:
> on timer 60000 sbr
> stop
>
> -----------------
>
> 0 0:01
> 0 0:02
> Prefetch Abort ea64
>
that when it compiles it. And the code for subroutine entry may not be correct,
and the ON TIMER requires that code to be there. So for ON TIMER it should be
SUB sbr
...
END SUB
Just like INTERRUPT SUB must be used when trying to tie a hardware interrupt to
a routine.
> In your example, why not use the built in RTC ??
>
> -------------------------CODE:-----------------------
> sbr:
> ...
> return
> main:
> rpt:
> on timer 60000 sbr
> stop
>
> -----------------
>
> 0 0:01
> 0 0:02
> Prefetch Abort ea64
>