Adresse |
Befehl |
Daten |
Kommentar |
00 |
1 |
1 |
Port=0001 |
01 |
2 |
9 |
Warte 1s |
02 |
1 |
0 |
Port=0000 |
03 |
4 |
1 |
A=1 |
04 |
2 |
5 |
Warte 50ms |
05 |
7 |
1 |
A=A+1 |
06 |
C |
C |
Skip if S1=0 |
07 |
3 |
3 |
Springe-3 |
08 |
5 |
9 |
A=PWM |
09 |
2 |
C |
Warte 10s |
0A |
3 |
10 |
Springe-10 (Anfang) |
0B |
|
|
|
0C |
|
|
|
0D |
|
|
|
0E |
|
|
|
0F |
|
|
|
Adresse |
Befehl |
Daten |
Kommentar |
00 |
4 |
3 |
A=3 maximal Spannung 1 NiMH >=1,25V |
01 |
5 |
1 |
B=A |
02 |
4 |
F |
A=15
-> Pwm volle Pulle |
03 |
5 |
9 |
Pwm1=A |
04 |
2 |
0 |
Wait 1ms, siehe
Anmerkung |
05 |
6 |
9 |
A=Adc1 holen |
06 |
5 |
4 |
Spannung anzeigen |
07 |
C |
1 |
Jr+1,A>B?, >1,25V
-> 09 |
08 |
3 |
6 |
Jr-6 = weiterladen -> 02 |
09 |
4 |
0 |
A=0 Pwm ausschalten |
0A |
5 |
9 |
Pwm1=A |
0B |
3 |
7 |
Jr-7 = weitermessen -> 04 |
0C |
|
|
|
0D |
|
|
|
0E |
|
|
|
0F |
|
|
|
Adresse | Befehl | Daten | Kommentar |
00 | C |
E |
Taster S1=? |
01 |
7 |
1 |
A=A+1 |
02 |
5 |
9 |
PWM=A |
03 |
2 |
6 |
Warte 100ms |
04 |
3 |
4 |
Springe -4 |
05 |
|
|
|
06 |
|
|
|
07 |
|
|
|
08 |
|
|
|
09 |
|
|
|
0A |
|
|
|
0B |
|
|
|
0C |
|
|
|
0D |
|
|
|
0E |
|
|
|
0F |
|
|
|
Adresse | Befehl | Daten | Kommentar |
00 |
1 |
15 |
1111 |
01 |
2 |
0 |
1 ms |
02 |
1 |
9 |
1001 |
03 |
2 |
2 |
5 ms |
04 |
1 |
15 |
1111 |
05 |
2 |
0 |
1 ms |
06 |
1 |
0 |
0000 |
07 |
2 |
2 |
5 ms |
08 |
1 |
1 |
0001 |
09 |
1 |
2 |
0010 |
0A |
1 |
4 |
0100 |
0B |
1 |
8 |
1000 |
0C |
1 |
0 |
0000 |
0D |
2 |
5 |
5 ms |
0E |
3 |
E |
Springe -13 |
0F |
|
|
|
ooooo o ooooo o ooooo
o o o o o o o o
o o o o o o o o
ooooo o ooooo o ooooo
Durchgangsprüfer |
||||
Zeile |
Befehl |
Daten |
Beschreibung |
Kommentar |
00 |
6 |
9 |
A=AD1 |
|
01 |
5 |
2 |
C=A |
|
02 |
5 |
4 |
Ausgabe
A |
|
03 |
2 |
7 |
Warte
200 ms |
|
04 |
8 |
0 |
Page0 |
|
05 |
9 |
8 |
jump
8 |
|
06 |
1 |
C |
Ausgabe
12 |
|
07 |
9 |
A |
jump
10 |
|
08 |
4 |
0 |
A=0 |
|
09 |
5 |
4 |
Ausgabe
A |
|
0A |
6 |
9 |
A=AD1 |
|
0B |
5 |
1 |
B=A |
|
0C |
6 |
2 |
A=C |
|
0D |
C |
1 |
Skip
if A>B |
Hoher
Widerstand? |
0E |
9 |
8 |
jump
8 |
|
0F |
4 |
0 |
A=0 |
|
10 |
C |
3 |
Skip
if A=B |
Niedriger
Widerstand? |
11 |
9 |
6 |
jump
6 |
|
12 |
1 |
3 |
Ausgabe=3 |
|
13 |
9 |
A |
jump
10 |
|
Adresse |
Befehl |
Daten |
Kommentar |
00 |
1 |
15 |
alle LEDs an = Funktionstest |
01 |
2 |
14 |
warte 1/2 min |
02 |
1 |
0 |
schalte LEDs aus |
03 |
2 |
15 |
warte 1 min |
04 |
1 |
8 |
schalte Port 1000 ein |
05 |
2 |
15 |
warte 1 min |
06 |
1 |
12 |
schalte Port 1100 ein |
07 |
2 |
15 |
warte 1 min |
08 |
1 |
14 |
schalte Port 1110 ein |
09 |
2 |
15 |
warte 1 min |
0A |
1 |
15 |
schalte Port 1111 ein |
0B |
2 |
14 |
warte ½ min |
0C |
7 |
2 |
A=A-1 |
0D |
5 |
9 |
PWM =
A „Ton“ + LED flackern |
0E |
3 |
2 |
springe -2 |
0F |
|
|
|
Bit 1 |
Bit 0 |
Phase |
0 | 0 | Grün |
0 | 1 | Gelb |
1 | 0 | Rot |
1 | 1 | Rot/Gelb |
Ampel |
||||
Adresse |
Befehl |
Daten |
Kommentar |
|
00 |
1 |
10 |
Port=10 |
rot-rot |
01 |
2 |
11 |
wait=5s |
|
02 |
1 |
11 |
Port=11 |
rot-rot/gelb |
03 |
2 |
10 |
wait=2s |
|
04 |
1 |
8 |
Port=8 |
rot-grün |
05 |
2 |
11 |
wait=5s |
|
06 |
6 |
9 |
A=AD1 |
|
07 |
5 |
3 |
D=A |
|
08 |
2 |
9 |
wait=1s |
|
09 |
11 |
8 |
D*
8 |
|
0A |
1 |
9 |
Port=9 |
rot-gelb |
0B |
2 |
10 |
wait=2s |
|
0C |
1 |
10 |
Port=10 |
rot-rot |
0D |
2 |
11 |
wait=5s |
|
0E |
1 |
14 |
Port=14 |
rot/gelb-rot |
0F |
2 |
10 |
wait=2s |
|
10 |
1 |
2 |
Port=2 |
grün-rot |
11 |
8 |
1 |
page=1 |
|
12 |
2 |
11 |
wait=5s |
|
13 |
6 |
10 |
A=AD2 |
|
14 |
5 |
3 |
D=A |
|
15 |
2 |
9 |
wait=1s |
|
16 |
11 |
5 |
D*
5 |
|
17 |
1 |
6 |
Port=6 |
gelb-rot |
18 |
2 |
10 |
wait=2s |
|
19 |
8 |
0 |
page=0 |
|
1A |
9 |
0 |
jump
0 |
|
Eingebaut habe ich das ganze (damals noch ohne TPS aber schon
mit ATMega und BASCOM) in ein Leuchtfeuer für einen Modellhafen. Die originale
Barke gab alle 5 Sekunden 3 Blitze aus. Die Ansteuerung der weißen LEDs ist
nicht ganz normal. Jede LED wird mit 100 mA betrieben (LED Daten weiß, 3,3 V,
20 mA) und somit oberhalb der Spezifikation, aber durch die Kürze der Pulse
vertragen das die LEDs recht gut. Hier der analoge TPS Code. (Hätt mir damals viel Mühe gespart) Adresse Befehl Daten Kommentar 00 1 1 LED ein, Blitz 1 starten 01 2 5 50ms warten 02 1 0 LED aus 03 2 7 200 ms warten 04 2 5 50 ms warten 05 1 1 LED ein, Blitz 2 starten 06 2 5 50ms warten 07 1 0 LED aus 08 2 7 200 ms warten 09 2 5 50 ms warten 0A 1 1 LED ein, Blitz 3 starten 0B 2 5 50ms warten 0C 1 0 LED aus 0D 2 A 2s warten 0E 2 A 2s warten 0F 2 7 200ms warten (4200ms) 10 2 6 100ms warten (4300ms) 11 2 5 50ms warten (4350ms) 12 9 0 Jump 00 |
Adresse |
Befehl |
Daten |
Kommentar |
00 |
1 |
5 |
Blitz 0101 |
01 |
2 |
4 |
20ms |
02 |
1 |
0 |
Aus |
03 |
2 |
6 |
100ms |
04 |
1 |
5 |
Blitz 0101 |
05 |
2 |
4 |
20ms |
06 |
1 |
0 |
Aus |
07 |
2 |
7 |
200ms |
08 |
1 |
10 |
Blitz 1010 |
09 |
2 |
4 |
20ms |
0A |
1 |
0 |
Aus |
0B |
2 |
6 |
100ms |
0C |
1 |
10 |
Blitz 1010 |
0D |
2 |
4 |
20ms |
0E |
1 |
0 |
Aus |
0F |
2 |
7 |
200ms |
10 |
9 |
0 |
Zurück zu 00 |
Adresse | Befehl | Daten | Kommentar |
00 |
1 |
6 |
Frontblitzer |
01 |
2 |
4 |
20ms an |
02 |
1 |
0 |
LEDs aus |
03 |
2 |
7 |
Warten
200ms |
04 |
1 |
8 |
Rundum
links Doppelblitz |
05 |
2 |
4 |
20ms an |
06 |
1 |
0 |
LEDs aus |
07 |
2 |
6 |
Warten
100ms |
08 |
1 |
8 |
Rundum
links Doppelblitz |
09 |
2 |
4 |
20ms an |
0A |
1 |
0 |
LEDs aus |
0B |
2 |
7 |
Warten
200ms |
0C |
1 |
1 |
Rundum
rechts Doppelblitz |
0D |
2 |
4 |
20ms an |
0E |
1 |
0 |
LEDs aus |
0F |
2 |
6 |
Warten
100ms |
10 |
1 |
1 |
Rundum
rechts Doppelblitz |
11 |
2 |
4 |
20ms an |
12 |
1 |
0 |
LEDs aus |
13 |
2 |
7 |
Warten
200ms |
14 |
9 |
0 |
Zurück zu
00 |
Adresse | Befehl | Daten | Kommentar |
00 |
4 |
8 |
mittlere Helligkeit = Grundhelligkeit |
01 |
C |
F |
S2 = 1 ? |
02 |
7 |
2 |
A = A – 1 , Helligkeit vermindern |
03 |
C |
E |
S1 = 1 ? |
04 |
7 |
1 |
A = A + 1 , Helligkeit erhöhen |
05 |
5 |
4 |
Dout = A |
06 |
5 |
9 |
PWM = A |
07 |
2 |
8 |
warte
½ s |
08 |
3 |
7 |
Springe - 7 |
09 |
4 |
8 |
mittlere Helligkeit = Grundhelligkeit |
0A |
C |
F |
S2 = 1 ? |
0B |
7 |
2 |
A = A – 1 , Helligkeit vermindern |
0C |
C |
E |
S1 = 1 ? |
0D |
7 |
1 |
A = A + 1 , Helligkeit erhöhen |
0E |
|
|
|
0F |
|
|
|
Adresse | Befehl | Daten | Kommentar |
00 |
1 |
1 |
Ampel:0001 |
01 |
2 |
A |
2s an |
02 |
1 |
0 |
Aus |
03 |
1 |
3 |
Ampel:0011 |
04 |
2 |
A |
2s an |
05 |
1 |
0 |
Aus |
06 |
1 |
7 |
Ampel:0111 |
07 |
2 |
A |
2s an |
08 |
1 |
0 |
Aus |
09 |
1 |
F |
Ampel:1111 |
0A |
2 |
A |
2s an |
0B |
2 |
9 |
1s an |
0C |
1 |
0 |
Aus ->
START!! |
0D |
2 |
C |
10s warten |
0E |
9 |
0 |
Springe
zu 00 |
0F |
|
|
|
Adresse | Befehl | Daten | Kommentar |
00 |
1 |
F |
LEDs an |
01 |
2 |
8 |
Warten 200ms |
02 |
1 |
0 |
LEDs aus |
03 |
2 |
8 |
Warten 200ms |
04 |
1 |
F |
LEDs an |
05 |
2 |
8 |
Warten 200ms |
06 |
1 |
0 |
LEDs aus |
07 |
2 |
8 |
Warten 200ms |
08 |
1 |
F |
LEDs an |
09 |
2 |
8 |
Warten 200ms |
0A |
1 |
0 |
LEDs aus |
0B |
2 |
9 |
Warten
500ms |
0C |
1 |
F |
LEDs an |
0D |
2 |
9 |
Warten
500ms |
0E |
1 |
0 |
LEDs aus |
0F |
2 |
9 |
Warten
500ms |
10 |
1 |
F |
LEDs an |
11 |
2 |
9 |
Warten 500ms |
12 |
1 |
0 |
LEDs aus |
13 |
2 |
9 |
Warten 500ms |
14 |
1 |
F |
LEDs an |
15 |
2 |
9 |
Warten 500ms |
16 |
1 |
0 |
LEDs aus |
17 | 2 | 8 | Warten 200ms |
18 | 1 | F | LEDs an |
19 |
2 |
8 |
Warten 200ms |
1A |
1 |
0 |
LEDs aus |
1B |
2 |
8 |
Warten 200ms |
1C |
1 |
F |
LEDs an |
1D |
2 |
8 |
Warten 200ms |
1E |
1 |
0 |
LEDs aus |
1F |
2 |
8 |
Warten 200ms |
20 |
1 |
F |
LEDs an |
21 |
2 |
8 |
Warten 200ms |
22 |
1 |
0 |
LEDs aus |
23 | 2 | 8 | Warten 200ms |
24 | 9 | 0 | Zurück zu 00 |
Adresse | Befehl | Daten |
Kommentar |
00 |
6 |
9 |
Starte den AD1-Wandler |
01 |
2 |
4 |
kleine Pause |
02 |
5 |
4 |
gib AD-Wert am PortA aus |
03 |
3 |
3 |
Sprung -3 |
Adresse | Befehl | Daten | Kommentar |
00 | C | 5 | Din.1 = 1 ? |
01 | 1 | 1 | schalte Dout.0 aus / Dout.3 an |
02 | C | 6 | Din.2 = 1 ? |
03 | 1 | 8 | schalte Dout.3 aus / Dout.0 an |
04 | 3 | 4 | springe - 4 |
05 |
|
|
|
Adresse |
Befehl |
Daten |
Kommentar |
||
0 |
0 |
8 |
1 |
page=1 |
|
0 |
1 |
1 |
0 |
Dout=0 |
|
0 |
2 |
C |
4 |
skip if Din.0=1 |
|
0 |
3 |
9 |
0 |
jump 0 |
|
0 |
4 |
C |
5 |
skip if Din.1=1 |
|
0 |
5 |
9 |
2 |
jump 2 |
|
0 |
6 |
C |
6 |
skip if Din.2=1 |
|
0 |
7 |
9 |
4 |
jump 4 |
|
0 |
8 |
C |
7 |
skip if Din.3=1 |
|
0 |
9 |
9 |
6 |
jump 6 |
|
0 |
A |
3 |
8 |
jump-8 |
|
0 |
B |
C |
C |
skip if S1=0 |
|
0 |
C |
3 |
1 |
jump-1 |
|
0 |
D |
C |
E |
Skip if S1=1 |
|
0 |
E |
3 |
1 |
jump-1 |
|
0 |
F |
3 |
E |
jump-14 |
|
1 |
0 |
1 |
1 |
Dout=1 |
|
1 |
1 |
3 |
6 |
jump-6 |
|
1 |
2 |
1 |
2 |
Dout=2 |
|
1 |
3 |
3 |
8 |
jump-8 |
|
1 |
4 |
1 |
4 |
Dout=4 |
|
1 |
5 |
3 |
A |
jump-A |
|
1 |
6 |
1 |
8 |
Dout=8 |
|
1 |
7 |
3 |
C |
jump-C |
|
1 |
8 |
|
|
|
|
Adresse |
Befehl |
Daten |
Kommentar |
||
0 |
0 |
4 |
2 |
A=2 |
:intro |
0 |
1 |
5 |
2 |
C=A |
|
0 |
2 |
1 |
3 |
port=3 |
|
0 |
3 |
2 |
7 |
wait=200ms |
|
0 |
4 |
1 |
5 |
port=5 |
|
0 |
5 |
2 |
7 |
wait=200ms |
|
0 |
6 |
1 |
9 |
port=9 |
|
0 |
7 |
2 |
7 |
wait=200ms |
|
0 |
8 |
1 |
C |
port=C |
|
0 |
9 |
2 |
7 |
wait=200ms |
|
0 |
A |
1 |
A |
port=A |
|
0 |
B |
2 |
7 |
wait=200ms |
|
0 |
C |
1 |
6 |
port=6 |
|
0 |
D |
2 |
7 |
wait=200ms |
|
0 |
E |
A |
2 |
C* 2 |
|
0 |
F |
8 |
1 |
page 1 |
:start |
1 |
0 |
D |
3 |
call 3 |
|
1 |
1 |
5 |
4 |
port=A |
|
1 |
2 |
3 |
3 |
jump-3 |
|
1 |
3 |
8 |
2 |
page=2 |
:auswertung |
1 |
4 |
6 |
9 |
A=AD1 |
|
1 |
5 |
5 |
1 |
B=A |
|
1 |
6 |
4 |
A |
A=10 |
|
1 |
7 |
C |
2 |
skip if A<B |
|
1 |
8 |
9 |
F |
jump 15 |
+3 dB |
1 |
9 |
4 |
B |
A=11 |
|
1 |
A |
C |
2 |
skip if A<B |
|
1 |
B |
9 |
D |
jump 13 |
0 dB |
1 |
C |
4 |
C |
A=12 |
|
1 |
D |
C |
2 |
skip if A<B |
|
1 |
E |
9 |
B |
jump 11 |
-3 dB |
1 |
F |
4 |
D |
A=13 |
|
2 |
0 |
C |
2 |
skip if A<B |
|
2 |
1 |
9 |
9 |
jump 9 |
-6 dB |
2 |
2 |
4 |
E |
A=14 |
|
2 |
3 |
C |
2 |
skip if A<B |
|
2 |
4 |
9 |
7 |
jump 7 |
-10 dB |
2 |
5 |
4 |
3 |
A=3 |
-20 dB |
2 |
6 |
E |
1 |
rts |
|
2 |
7 |
4 |
5 |
A=5 |
-10 dB |
2 |
8 |
E |
1 |
rts |
|
2 |
9 |
4 |
9 |
A=9 |
-6 dB |
2 |
A |
E |
1 |
rts |
|
2 |
B |
4 |
C |
A=12 |
-3 dB |
2 |
C |
E |
1 |
rts |
|
2 |
D |
4 |
A |
A=10 |
0 dB |
2 |
E |
E |
1 |
rts |
|
2 |
F |
4 |
6 |
A=6 |
+3 dB |
3 |
0 |
E |
1 |
rts |
|