upigors
Geowizard
Hallo zusammen, ich hab jetzt echt 4h versucht einen Bug zu finden - erfolglos. Nun meine Hoffnung das hier jemand sagt "bist du doof, das liegt da dran....."
Also, ich hab seit Jahren mal wieder einen MEGA8 mit ner 16 Segment Anzeige verbastelt. Code hatte ich noch, also schnell gelötet (lose Verdrahtung, 1 Vorwiderstand), Controller beschrieben, fertig.
Leider nein. Im Grunde funktioniert (fast) alles. Probleme machen die "C-Ports" Also PC 1- PC3 (ob PC0 auch weiß ich nicht, den brauch ich bei meinem Text nicht).
PC2 funktioniert gar nicht.
PC1 und PC3 funktionieren bedingt. Warum bedingt? Die beiden sind für die 2 senkrechten in der Mitte der Anzeige zuständig.
Beim "I" werden die gebraucht und schalten.
Beim "T" werden die auch gebraucht, schalten aber nicht. Auch beim "D" nicht.
Fehler im Code schließ ich aus, der lief schon x-mal problemlos.
Controller hab ich schon nen anderen getestet in meiner Verzweiflung. Gleiches Verhalten.
Nun finde ich den alten Tread nicht mehr, mussten in den Lock- an Fuse-Bits irgendwas umgestellt werden beim MEGA8?
Gibt's da irgend ne Einstellung die die C-Ports "verwirren" kann? Ich kapier dieses verhalten nicht.
Oder hat irgend jemand ne Idee dazu? Ich verzweifle und das dauert lange bei mir ;-)
Ich hänge mal Bild und Code an. Vielleicht gibt's hier nen Engel der mal drauf guckt - ich bin overload
Code: (geht leider nicht als .txt)
Also, ich hab seit Jahren mal wieder einen MEGA8 mit ner 16 Segment Anzeige verbastelt. Code hatte ich noch, also schnell gelötet (lose Verdrahtung, 1 Vorwiderstand), Controller beschrieben, fertig.
Leider nein. Im Grunde funktioniert (fast) alles. Probleme machen die "C-Ports" Also PC 1- PC3 (ob PC0 auch weiß ich nicht, den brauch ich bei meinem Text nicht).
PC2 funktioniert gar nicht.
PC1 und PC3 funktionieren bedingt. Warum bedingt? Die beiden sind für die 2 senkrechten in der Mitte der Anzeige zuständig.
Beim "I" werden die gebraucht und schalten.
Beim "T" werden die auch gebraucht, schalten aber nicht. Auch beim "D" nicht.
Fehler im Code schließ ich aus, der lief schon x-mal problemlos.
Controller hab ich schon nen anderen getestet in meiner Verzweiflung. Gleiches Verhalten.
Nun finde ich den alten Tread nicht mehr, mussten in den Lock- an Fuse-Bits irgendwas umgestellt werden beim MEGA8?
Gibt's da irgend ne Einstellung die die C-Ports "verwirren" kann? Ich kapier dieses verhalten nicht.
Oder hat irgend jemand ne Idee dazu? Ich verzweifle und das dauert lange bei mir ;-)
Ich hänge mal Bild und Code an. Vielleicht gibt's hier nen Engel der mal drauf guckt - ich bin overload
Code: (geht leider nicht als .txt)
$hwstack = 20
$regfile = "m8def.DAT"
$crystal = 128000
Config Adc = Single , Prescaler = Auto
Config Portb = &B00000111
Config Portc = &B00111111
Config Portd = &B11111111
Portb = 0
Portc = 0
Portd = 0
Stop Ac
Wdtcr = &B11010011
Enable Interrupts
Dim A As Byte
Dim Z As Byte
Dim Zeichen As String * 1
Do
Taster1 Alias Pinb.6
Config Taster1 = Input
Portb.6 = 1
Debounce Taster1 , 0 , Morsen
Loop
Morsen:
Restore Daten
Do
Read Zeichen
If Zeichen = "0" Then Gosub P0
If Zeichen = "1" Then Gosub P1
If Zeichen = "2" Then Gosub P2
If Zeichen = "3" Then Gosub P3
If Zeichen = "4" Then Gosub P4
If Zeichen = "5" Then Gosub P5
If Zeichen = "6" Then Gosub P6
If Zeichen = "7" Then Gosub P7
If Zeichen = "8" Then Gosub P8
If Zeichen = "9" Then Gosub P9
If Zeichen = "A" Then Gosub Pa
If Zeichen = "B" Then Gosub Pb
If Zeichen = "C" Then Gosub Pc
If Zeichen = "D" Then Gosub Pd
If Zeichen = "E" Then Gosub Pee
If Zeichen = "F" Then Gosub Pf
If Zeichen = "G" Then Gosub Pg
If Zeichen = "H" Then Gosub Ph
If Zeichen = "I" Then Gosub Pi
If Zeichen = "J" Then Gosub Pj
If Zeichen = "K" Then Gosub Pk
If Zeichen = "L" Then Gosub Pl
If Zeichen = "M" Then Gosub Pm
If Zeichen = "N" Then Gosub Pn
If Zeichen = "O" Then Gosub Po
If Zeichen = "P" Then Gosub Pp
If Zeichen = "Q" Then Gosub Pq
If Zeichen = "R" Then Gosub Pr
If Zeichen = "S" Then Gosub Ps
If Zeichen = "T" Then Gosub Pt
If Zeichen = "U" Then Gosub Pu
If Zeichen = "V" Then Gosub Pv
If Zeichen = "W" Then Gosub Pw
If Zeichen = "X" Then Gosub Px
If Zeichen = "XX" Then Gosub Pxx 'X kurz
If Zeichen = "Y" Then Gosub Py
If Zeichen = "Z" Then Gosub Pz
If Zeichen = " " Then Gosub Pleer 'leer lang
If Zeichen = "kp" Then Gosub Kleer 'leer kurz
If Zeichen = "+" Then Gosub Pplus
If Zeichen = "++" Then Gosub Ppp 'plus kurz
If Zeichen = "-" Then Gosub Pminus
If Zeichen = "*" Then Gosub Pstern
If Zeichen = "." Then Gosub Ppunkt
If Zeichen = "/" Then Gosub Slash
If Zeichen = "?" Then Return
Loop
End
Slash:
Portb = &B00000010
Portc = &B00000001
Portd = &B00000000
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
P0:
Portb = &B00000000
Portc = &B00000000
Portd = &B11111111
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
P1:
Portb = &B00000010
Portc = &B00000000
Portd = &B00110000
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
P2:
Portb = &B00000000
Portc = &B00110000
Portd = &B11101110
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
P3:
Portb = &B00000000
Portc = &B00110000
Portd = &B11111100
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
P4:
Portb = &B00000000
Portc = &B00110000
Portd = &B00110001
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
P5:
Portb = &B00000000
Portc = &B00110000
Portd = &B11011101
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
P6:
Portb = &B00000000
Portc = &B00110000
Portd = &B00011111
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
P7:
Portb = &B00000000
Portc = &B00000000
Portd = &B11110000
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
P8:
Portb = &B00000000
Portc = &B00110000
Portd = &B11111111
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
P9:
Portb = &B00000000
Portc = &B00110000
Portd = &B11111101
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Pa:
Portb = &B00000000
Portc = &B00110000
Portd = &B11110011
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Pb:
Portb = &B00000000
Portc = &B00011100
Portd = &B11111100
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Pc:
Portb = &B00000000
Portc = &B00000000
Portd = &B11001111
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Pd:
Portb = &B00000000
Portc = &B00001100
Portd = &B11111100
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Pee:
Portb = &B00000000
Portc = &B00100000
Portd = &B11001111
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Pf:
Portb = &B00000000
Portc = &B00100000
Portd = &B11000011
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Pg:
Portb = &B00000000
Portc = &B00010000
Portd = &B11011111
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Ph:
Portb = &B00000000
Portc = &B00110000
Portd = &B00110011
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Pi:
Portb = &B00000000
Portc = &B00001100
Portd = &B00000000
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Pj:
Portb = &B00000000
Portc = &B00000000
Portd = &B00111110
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Pk:
Portb = &B00000010
Portc = &B00100010
Portd = &B00000011
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Pl:
Portb = &B00000000
Portc = &B00000000
Portd = &B00001111
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Pm:
Portb = &B00000110
Portc = &B00000000
Portd = &B00110011
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Pn:
Portb = &B00000100
Portc = &B00000010
Portd = &B00110011
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Po:
Portb = &B00000000
Portc = &B00000000
Portd = &B11111111
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Pp:
Portb = &B00000000
Portc = &B00110000
Portd = &B11100011
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Pq:
Portb = &B00000000
Portc = &B00000010
Portd = &B11111111
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Pr:
Portb = &B00000000
Portc = &B00110010
Portd = &B11100011
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Ps:
Portb = &B00000000
Portc = &B00110000
Portd = &B11011101
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Pt:
Portb = &B00000000
Portc = &B00001100
Portd = &B11000000
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Pu:
Portb = &B00000000
Portc = &B00000000
Portd = &B00111111
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Pv:
Portb = &B00000010
Portc = &B00000001
Portd = &B00000011
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Pw:
Portb = &B00000000
Portc = &B00000011
Portd = &B00110011
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Px:
Portb = &B00000110
Portc = &B00000011
Portd = &B00000000
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Pxx:
Portb = &B00000110
Portc = &B00000011
Portd = &B00000000
Waitms 2000
Portb = 0
Portc = 0
Portd = 0
Return
Py:
Portb = &B00000110
Portc = &B00000100
Portd = &B00000000
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Pz:
Portb = &B00000010
Portc = &B00000001
Portd = &B11001100
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Pplus:
Portb = &B00000000
Portc = &B00111100
Portd = &B00000000
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Ppp:
Portb = &B00000000
Portc = &B00111100
Portd = &B00000000
Waitms 2000
Portb = 0
Portc = 0
Portd = 0
Return
Pminus:
Portb = &B00000000
Portc = &B00110000
Portd = &B00000000
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Pleer:
Portb = &B00000000
Portc = &B00000000
Portd = &B00000000
Waitms 2000
Portb = 0
Portc = 0
Portd = 0
Return
Kleer:
Portb = &B00000000
Portc = &B00000000
Portd = &B00000000
Waitms 2000
Portb = 0
Portc = 0
Portd = 0
Pstern:
Portb = &B00000110
Portc = &B00111111
Portd = &B00000000
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Ppunkt:
Portb = &B0000001
Portc = &B0000000
Portd = &B0000000
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Daten:
Data "N" , " " , " " , " " , " " , " " ,
Data "4" , " " , "0" , " " , " " , " " , " " , " " ,
Data "G" , "R" , "A" , "D" , " " , " " , " " , " " , " " ,
Data "4" , " " , "4" , " " , " " , " " , " " , " " , " " ,
Data "M" , "I" , "N" , "U" , "T" , "E" , "N" , " " , " " , " " , " " , " " ,
Data "5" , " " , "3" , " " , "." , " " , "1" , " " , " " , " " , " " , " " ,
Data "S" , "E" , "K" , "U" , "N" , "D" , "E" , "N" , " " , " " , " " , " " , " " ,
Data " " , " " , " " , " " , " " ,
Data "E" , " " , " " , " " , " " , " " ,
Data "7" , " " , "3" , " " , " " , " " , " " , " " ,
Data "G" , "R" , "A" , "D" , " " , " " , " " , " " , " " ,
Data "5" , "9" , " " , " " , " " , " " , " " , " " ,
Data "M" , "I" , "N" , "U" , "T" , "E" , "N" , " " , " " , " " , " " , " " ,
Data "0" , " " , "5" , " " , "." , " " , "8" , " " , " " , " " , " " , " " ,
Data "S" , "E" , "K" , "U" , "N" , "D" , "E" , "N" , " " , " " , " " , " " , " " ,
Data " " , " " , " " , " " , " " ,
Data "F" , "E" , "E" , "D" , " " , " " , " " , " " , " " , "T" , "H" , "E" , " " , " " , " " , " " , " " ,
Data "C" , "A" , "T" , " " , " " , " " , " " , " " ,
Data " " , " " , " " , " " , " " ,
Data "?"