User manual

33
9
9
1 s
9
9
PWM =
A
A =
AD1
A = A
Xor B
9
9
9
Din.1 = 0
9
1
2
3
4
5
6
7
8
9
A
B
C
D
E
A
10
2 s
10
10
A =
AD2
A = Not
A
A
A
A
Din.2 = 0
A
B
11
5 s
11
11
B
B
B
Din.3 = 0
B
C
12
10 s
12
12
C
C
C
S1 = 0
C
D
13
20 s
13
13
D
D
D
S2 = 0
D
E
14
30 s
14
14
E
E
E
S1 = 1
E
F
15
60 s
15
15
F
F
F
S2 = 1
F
14 Counting Loops
A process is to be performed, e.g. five times. For this, a count loop is formed. A jump command
is performed five times in this case, and then no longer. The count variable is called C. The
count value 5 must be loaded in A first, and from there in C. The command A2 performs an
absolute count to 02 and at the same time reduces the content of the variable C by 1. When C
has reached the value 0, the jump is no longer performed. The absolute jump address refers to
the indicated page. For a programme on page 0, the page command 80 may also be left out.
However, it s necessary when jumping to any other page.
Address
Command
Data
Comment
00
4
5
A = 5
01
5
2
C = A
02
1
5
Port = 0101
03
2
8
500 ms
04
1
A
Port = 1010
05
2
8
500 ms
06
8
0
Page 0
07
A
2
C-times 02
08
3
0
End
45 52 15 28 1A 28 80 A2 30
Listing 17: A count loop
Test the programme. The LEDs show the patterns 0101 and 1010 at each pass. However, this
programme part is obviously not gone through five times but precisely six times. The jump
command in address 07 is performed precisely five times, but to get to this point for the first
time, a flashing process is performed. Therefore, the programme will flash six times in total.