Che Guevara
10.07.2008, 22:18
nein, es ist kein interrupt im prog und auf einer lcd leitung ist der taster auch nicht!!
hier das prog (weiß leider nicht, wie man das so in eine kasten bekommt):
$regfile = "m32def.dat"
$crystal = 1000000
$hwstack = 64
$swstack = 40
$framesize = 64
Declare Sub Ukommando(byval Wert As Byte)
Declare Sub Udata(byval Wert As Byte)
Declare Sub Initialisierung
Declare Sub Lcdloeschen
Declare Sub Position(byval X As Byte , Byval Y As Byte)
Declare Sub Nprint(byval Text As String)
Declare Sub Zeichenout
Declare Sub Version1
Declare Sub Version2
Config Spi = Hard , Data Order = Msb , Master = Yes , Polarity = Low , Phase = 0 , Clockrate = 4
Config Portb = Output
Config Portc = Output
Config Porta = Output
Config Portd = Input
Dim I As Word
Dim J As Word
Dim Z As Word
I = 1
J = 1
L1 Alias Porta.0
L2 Alias Porta.1
L3 Alias Porta.2
L4 Alias Porta.3
L5 Alias Porta.4
L6 Alias Porta.5
L7 Alias Porta.6
L8 Alias Porta.7
L9 Alias Portc.0
E1 Alias Portc.5
E2 Alias Portc.6
E3 Alias Portc.7
T1 Alias Pind.0
T2 Alias Pind.1
T3 Alias Pind.2
T4 Alias Pind.3
Portc.0 = 1
Portc.1 = 1
Portc.2 = 1
Portc.3 = 1
L1 = 0
L2 = 0
L3 = 0
L4 = 0
L5 = 0
L6 = 0
L7 = 0
L8 = 0
L9 = 0
E1 = 0
E2 = 0
E3 = 0
Dc Alias Portb.0
Ce Alias Portb.2
Re Alias Portb.1
Re = 0
Waitus 250
Re = 1
Spiinit
Initialisierung
Lcdloeschen
Position 7 , 2
Call Nprint( "haupt")
Wait 3
Lcdloeschen
Do
Z = J * 50
If T1 = 0 Then
Waitms 200
If I < 2 Then
I = I + 1
Else
I = 1
End If
Elseif T2 = 0 Then
Waitms 200
If I > 1 Then
I = I - 1
Else
I = 2
End If
End If
If T3 = 0 Then
Waitms 200
If J < 5 Then
J = J + 1
Else
J = 1
End If
Elseif T4 = 0 Then
Waitms 200
If J > 1 Then
J = J - 1
Else
J = 5
End If
End If
If I = 1 Then
Position 7 , 0
Call Nprint( "version 1")
Position 7 , 1
Call Nprint( "z:")
Call Version1
Elseif I = 2 Then
Position 7 , 0
Call Nprint( "version 2")
Position 7 , 1
Call Nprint( "z:")
Call Version2
End If
Loop
Sub Initialisierung
Ukommando &H21
Ukommando &HC8
Ukommando &H06
Ukommando &H13
Ukommando &H20
Ukommando &H0C
End Sub
Sub Lcdloeschen
Local O As Word
Ukommando &H20
Ukommando &H0C
Ukommando &H80
Dc = 1
For O = 0 To 503
Udata &H00
Next
End Sub
Sub Ukommando(byval Wert As Byte)
Dc = 0
Spiout Wert , 1
Dc = 1
End Sub
Sub Udata(byval Wert As Byte)
Dc = 1
Ce = 0
Spiout Wert , 1
Ce = 1
End Sub
Sub Position(byval X As Byte , Byval Y As Byte)
Local Nout As Byte
Dc = 0
Ce = 0
Nout = Y + 64
Spiout Nout , 1
Ce = 1
Ce = 0
Nout = X * 6
Nout = Nout + 128
Spiout Nout , 1
Ce = 1
Dc = 1
End Sub
Sub Nprint(byval Text As String * 14)
Local Loops As Byte
Local Laenge As Byte
Local Zeichen As String * 1
Laenge = Len(text)
For Loops = 1 To Laenge
If Loops = 1 Then
Zeichen = Left(text , 1)
Elseif Loops = Zeichen Then
Zeichen = Right(text , 1)
Else
Zeichen = Mid(text , Loops , 1)
End If
If Zeichen = "0" Then Restore 0:
If Zeichen = "1" Then Restore 1:
If Zeichen = "2" Then Restore 2:
If Zeichen = "3" Then Restore 3:
If Zeichen = "4" Then Restore 4:
If Zeichen = "5" Then Restore 5:
If Zeichen = "6" Then Restore 6:
If Zeichen = "7" Then Restore 7:
If Zeichen = "8" Then Restore 8:
If Zeichen = "9" Then Restore 9:
If Zeichen = "a" Then Restore A1:
If Zeichen = "b" Then Restore B1:
If Zeichen = "c" Then Restore C1:
If Zeichen = "d" Then Restore D1:
If Zeichen = "e" Then Restore E1:
If Zeichen = "f" Then Restore F1:
If Zeichen = "g" Then Restore G1:
If Zeichen = "h" Then Restore H1:
If Zeichen = "i" Then Restore I1:
If Zeichen = "j" Then Restore J1:
If Zeichen = "k" Then Restore K1:
If Zeichen = "l" Then Restore L1:
If Zeichen = "m" Then Restore M1:
If Zeichen = "n" Then Restore N1:
If Zeichen = "o" Then Restore O1:
If Zeichen = "p" Then Restore P1:
If Zeichen = "q" Then Restore Q1:
If Zeichen = "r" Then Restore R1:
If Zeichen = "s" Then Restore S1:
If Zeichen = "t" Then Restore T1:
If Zeichen = "u" Then Restore U1:
If Zeichen = "v" Then Restore V1:
If Zeichen = "w" Then Restore W1:
If Zeichen = "x" Then Restore X1:
If Zeichen = "y" Then Restore Y1:
If Zeichen = "z" Then Restore Z1:
If Zeichen = "A" Then Restore A:
If Zeichen = "B" Then Restore B:
If Zeichen = "C" Then Restore C:
If Zeichen = "D" Then Restore D:
If Zeichen = "E" Then Restore E:
If Zeichen = "F" Then Restore F:
If Zeichen = "G" Then Restore G:
If Zeichen = "H" Then Restore H:
If Zeichen = "I" Then Restore I:
If Zeichen = "J" Then Restore J:
If Zeichen = "K" Then Restore K:
If Zeichen = "L" Then Restore L:
If Zeichen = "O" Then Restore O:
If Zeichen = "P" Then Restore P:
If Zeichen = "Q" Then Restore Q:
If Zeichen = "R" Then Restore R:
If Zeichen = "S" Then Restore S:
If Zeichen = "T" Then Restore T:
If Zeichen = "U" Then Restore U:
If Zeichen = "V" Then Restore V:
If Zeichen = "W" Then Restore W:
If Zeichen = "X" Then Restore X:
If Zeichen = "Y" Then Restore Y:
If Zeichen = "Z" Then Restore Z:
If Zeichen = " " Then Restore Leer:
If Zeichen = "." Then Restore Punkt:
If Zeichen = "-" Then Restore Strich:
If Zeichen = ":" Then Restore Doppelpunkt:
If Zeichen = "°" Then Restore Gradzeichen:
If Zeichen = "<" Then Restore Pfeillinks:
If Zeichen = ">" Then Restore Pfeilrechts:
Call Zeichenout
Next Loops
End Sub
Sub Zeichenout
Local Count As Byte
Local Daten As Byte
Dc = 1
For Count = 1 To 6
Read Daten
Ce = 0
Spiout Daten , 1
Ce = 1
Next Count
Dc = 0
End Sub
Sub Version1
E1 = 1
E2 = 0
E3 = 1
L1 = 1
L2 = 0
L3 = 1
L4 = 0
L5 = 1
L6 = 0
L7 = 1
L8 = 0
L9 = 1
Waitms Z
E1 = 0
E2 = 0
E3 = 1
L1 = 1
L2 = 1
L3 = 0
L4 = 0
L5 = 0
L6 = 1
L7 = 1
L8 = 1
L9 = 0
Waitms Z
End Sub
Sub Version2
E1 = 1
E2 = 1
E3 = 1
L1 = 0
L2 = 0
L3 = 0
L4 = 0
L5 = 0
L6 = 0
L7 = 0
L8 = 0
L9 = 0
Waitms Z
E1 = 1
E2 = 1
E3 = 1
L1 = 1
L2 = 1
L3 = 1
L4 = 1
L5 = 1
L6 = 1
L7 = 1
L8 = 1
L9 = 1
Waitms Z
End Sub
0:
Data &H00 , &H3E , &H51 , &H49 , &H45 , &H3E
1:
Data &H00 , &H00 , &H42 , &H7F , &H40 , &H00
2:
Data &H00 , &H42 , &H61 , &H51 , &H49 , &H46
3:
Data &H00 , &H22 , &H41 , &H49 , &H49 , &H36
4:
Data &H00 , &H18 , &H14 , &H12 , &H7F , &H10
5:
Data &H00 , &H27 , &H45 , &H45 , &H45 , &H39
6:
Data &H00 , &H3E , &H49 , &H49 , &H49 , &H32
7:
Data &H00 , &H61 , &H11 , &H09 , &H05 , &H03
8:
Data &H00 , &H36 , &H49 , &H49 , &H49 , &H36
9:
Data &H00 , &H26 , &H49 , &H49 , &H49 , &H3E
A1:
Data &H00 , &H30 , &H4A , &H4A , &H52 , &H7C
B1:
Data &H00 , &H3F , &H48 , &H44 , &H44 , &H38
C1:
Data &H00 , &H38 , &H44 , &H44 , &H44 , &H28
D1:
Data &H00 , &H38 , &H44 , &H44 , &H48 , &H7F
E1:
Data &H00 , &H38 , &H54 , &H54 , &H54 , &H18
F1:
Data &H00 , &H00 , &H04 , &H7E , &H05 , &H00
G1:
Data &H00 , &H0C , &H52 , &H52 , &H4A , &H3C
H1:
Data &H00 , &H7F , &H08 , &H04 , &H04 , &H78
I1:
Data &H00 , &H00 , &H44 , &H7D , &H40 , &H00
J1:
Data &H00 , &H00 , &H40 , &H44 , &H3D , &H00
K1:
Data &H00 , &H7F , &H20 , &H10 , &H28 , &H44
L1:
Data &H00 , &H00 , &H41 , &H7F , &H40 , &H00
M1:
Data &H00 , &H7C , &H04 , &H18 , &H04 , &H7C
N1:
Data &H00 , &H7C , &H08 , &H04 , &H04 , &H78
O1:
Data &H00 , &H38 , &H44 , &H44 , &H44 , &H38
P1:
Data &H00 , &H7C , &H14 , &H24 , &H24 , &H18
Q1:
Data &H00 , &H18 , &H24 , &H24 , &H14 , &H7C
R1:
Data &H00 , &H7C , &H04 , &H04 , &H08 , &H00
S1:
Data &H00 , &H08 , &H54 , &H54 , &H54 , &H20
T1:
Data &H00 , &H04 , &H3F , &H44 , &H40 , &H00
U1:
Data &H00 , &H3C , &H40 , &H40 , &H40 , &H3C
V1:
Data &H00 , &H1C , &H20 , &H40 , &H20 , &H1C
W1:
Data &H00 , &H3C , &H40 , &H30 , &H40 , &H3C
X1:
Data &H00 , &H44 , &H28 , &H10 , &H28 , &H44
Y1:
Data &H00 , &H0C , &H50 , &H50 , &H48 , &H3C
Z1:
Data &H00 , &H44 , &H64 , &H54 , &H4C , &H44
A:
Data &H00 , &H7C , &H12 , &H11 , &H12 , &H7C
B:
Data &H00 , &H7F , &H49 , &H49 , &H49 , &H36
C:
Data &H00 , &H3E , &H41 , &H41 , &H41 , &H22
D:
Data &H00 , &H7F , &H41 , &H41 , &H41 , &H3E
E:
Data &H00 , &H7F , &H49 , &H49 , &H49 , &H41
F:
Data &H00 , &H7F , &H09 , &H09 , &H09 , &H01
G:
Data &H00 , &H3E , &H41 , &H49 , &H49 , &H3A
H:
Data &H00 , &H7F , &H08 , &H08 , &H08 , &H7F
I:
Data &H00 , &H00 , &H41 , &H7F , &H41 , &H00
J:
Data &H00 , &H20 , &H41 , &H41 , &H41 , &H3F
K:
Data &H00 , &H7F , &H08 , &H14 , &H22 , &H41
L:
Data &H00 , &H7F , &H40 , &H40 , &H40 , &H40
M:
Data &H00 , &H7F , &H02 , &H04 , &H02 , &H7F
N:
Data &H00 , &H7F , &H04 , &H08 , &H10 , &H7F
O:
Data &H00 , &H3E , &H41 , &H41 , &H41 , &H3E
P:
Data &H00 , &H7F , &H09 , &H09 , &H09 , &H06
Q:
Data &H00 , &H3E , &H41 , &H51 , &H61 , &H7E
R:
Data &H00 , &H7F , &H09 , &H19 , &H29 , &H46
S:
Data &H00 , &H06 , &H49 , &H49 , &H49 , &H30
T:
Data &H00 , &H01 , &H01 , &H7F , &H01 , &H01
U:
Data &H00 , &H3F , &H40 , &H40 , &H40 , &H3F
V:
Data &H00 , &H1F , &H20 , &H40 , &H20 , &H1F
W:
Data &H00 , &H7F , &H20 , &H10 , &H20 , &H7F
X:
Data &H00 , &H63 , &H14 , &H08 , &H14 , &H63
Y:
Data &H00 , &H03 , &H04 , &H78 , &H04 , &H03
Z:
Data &H00 , &H61 , &H51 , &H49 , &H45 , &H43
Leer:
Data &H00 , &H00 , &H00 , &H00 , &H00 , &H00
Punkt:
Data &H00 , &H00 , &H60 , &H60 , &H00 , &H00
Strich:
Data &H00 , &H18 , &H18 , &H18 , &H18 , &H00
Doppelpunkt:
Data &H00 , &H00 , &H6C , &H6C , &H00 , &H00
Gradzeichen:
Data &H00 , &H00 , &H07 , &H05 , &H07 , &H00
Pfeilrechts:
Data &H00 , &H41 , &H63 , &H36 , &H1C , &H08
Pfeillinks:
Data &H00 , &H08 , &H1C , &H36 , &H63 , &H41
gruß
chris
Powered by vBulletin® Version 4.2.5 Copyright ©2024 Adduco Digital e.K. und vBulletin Solutions, Inc. Alle Rechte vorbehalten.