User manual

26
The waiting command 2 uses a parameter that contains the time in milliseconds and a
graduation of 1-2-5. In spite of the low number scope from 0 to 15, this permits execution of
delay times between one millisecond and one minute. You would have to wait even longer if you
were to programme execution of the waiting command several times, e.g. in a counting loop.
The return command 3 is particularly simple and is sufficient for any tasks where a process
should be repeated endlessly. The jump step is limited to the area up to 15. Since the jump
width is relative to the current address, programme parts can be moved to any other address
with this jump back.
The alternating flash programme only needs these three commands. It is written into the
address area from 00 here in a slightly modified form. The output bit samples and waiting times
are changed as well.
Address
Command
Data
Comment
00
1
1
A14 = 0001
01
2
7
Wait for 200 ms
02
1
4
A14 = 0100
03
2
7
Wait for 200 ms
04
3
4
Jump -4
Listing 9: Flashing programme
In short hexadecimal form, the programme now looks as follows:
11 27 14 27 34
Based on these first three commands, many simple programmes can be written. Analyse and
test the three following programmes. The objective should be to be able to intuitively use these
commands. Simple programme courses like this can even be programmed by heart and entered
directly with a little practise. One example of this is a simple running light with four output
patterns:
Address
Command
Data
Comment
00
1
1
LEDs 0001
01
2
8
Wait for 500 ms
02
1
2
LEDs 0010
03
2
8
Wait for 500 ms
04
1
4
LEDs 0100
05
2
8
Wait for 500 ms
06
1
8
LEDs 1000
07
2
8
Wait for 500 ms