User manual

13
gone through. The programme uses variable A for a simple addition and for output to the digital
outputs as well as the PWM-output. Commands 7 and 5 have subfunctions that are written as
data.
Address
Command
Data
Comment
25
7
1
A = A + 1
26
5
4
Port = A
27
5
9
PWM = A
28
2
6
Wait for 100 ms
29
3
4
Jump –4
Listing 2: Binary counter with LEWD and PWM output
The counting programme can be used as a practice programme for reading binary counters that
you must master for your own programming. Each of the four LEDs represents one bit. All in all,
a 4-bit number can therefore be displayed. The LEDs are called 8, 4, 2 and 1 according to their
value in the circuit diagram. Addition of the respective values results in the decimal figure.
Written hexadecimally, the numbers 10 to 15 are represented by capital letters A to F.
8
4
2
1
Hexadecimal
0
0
0
0
0
0
0
0
1
1
0
0
1
0
2
0
0
1
1
3
0
1
0
0
4
0
1
0
1
5
0
1
1
0
6
0
1
1
1
7
1
0
0
0
8
1
0
0
1
9
1
0
1
0
A
1
0
1
1
B
1
1
0
0
C
1
1
0
1
D
1
1
1
0
E
1
1
1
1
F
The programme can be used as a flashing encoder for different frequencies as well.
The next-higher output has half the frequency or twice the period duration each: