I have a number of subroutines that I want to run every XX seconds and want them to run only once per time schedule. So I have been messing around with the programming and have pieced together a couple of examples you all have been kind enough to share. For simplicity I have simplified the below example to just 1 test subroutine.
As far as specifics I need a time frame of 2 seconds, 15 seconds, 30 seconds, 1 minute and 5 minutes but have the below example timing at 4 seconds for testing.
I haven't been able to figure out the easiest/best way to unmark the flag one per timing cycle.
Here is what I have so far:
START
DELAY 5000
LOOP:
ROTR CTS 2 VAR1
ANDB VAR1 1 VAR1
ANDB VAR2 256
CZ TEST1
GOTO LOOP
END
TEST1:
ORB VAR2 256 VAR2
ADD VAR5 1 VAR5
RET
Var1 varies between 0 and 1 for 4 seconds each. Bit 8 of var2 is the test1 flag. Test1 runs once and the flag is set. Can't figure out the proper method to turn the flag off once per timing cycle (in this case every 4 seconds).
Any help and or suggestions or opinions would be appreciated.
Thanks,
tim
As far as specifics I need a time frame of 2 seconds, 15 seconds, 30 seconds, 1 minute and 5 minutes but have the below example timing at 4 seconds for testing.
I haven't been able to figure out the easiest/best way to unmark the flag one per timing cycle.
Here is what I have so far:
START
DELAY 5000
LOOP:
ROTR CTS 2 VAR1
ANDB VAR1 1 VAR1
ANDB VAR2 256
CZ TEST1
GOTO LOOP
END
TEST1:
ORB VAR2 256 VAR2
ADD VAR5 1 VAR5
RET
Var1 varies between 0 and 1 for 4 seconds each. Bit 8 of var2 is the test1 flag. Test1 runs once and the flag is set. Can't figure out the proper method to turn the flag off once per timing cycle (in this case every 4 seconds).
Any help and or suggestions or opinions would be appreciated.
Thanks,
tim