Birabeach
Geocacher
Hab mir mal krankheitsbedingt die Mühe gemacht eine 16 Segmentanzeige an einen ATmega8 zu klemmen.
Ziel war es eine Ausgabe ohne LCD zu haben die auch ordendlichen Text ausgeben kann.
Werde das ganze in einer Stage nützen,deshalb der Taster, für einen NC kann die übliche LDR Abfrage mit eingeklöppelt werden
Portbelegung folgt noch
Hier das Prog:
$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 = "Y" Then Gosub Py
If Zeichen = "Z" Then Gosub Pz
If Zeichen = " " Then Gosub Pleer
If Zeichen = "+" Then Gosub Pplus
If Zeichen = "-" Then Gosub Pminus
If Zeichen = "*" Then Gosub Pstern
If Zeichen = "." Then Gosub Ppunkt
If Zeichen = "?" Then Return
Loop
End
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
Py:
Portb = &B00000110
Portc = &B00001100
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
Pminus:
Portb = &B00000000
Portc = &B00110000
Portd = &B00000000
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Pleer:
Portb = &B00000000
Portc = &B00000000
Portd = &B00000000
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
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 "1" , "2" , "3" , "4" , "5" , "6" , "7" , "8" , "9" , "0" , "*"
Data "A" , "B" , "C" , "D" , "E" , "F" , "G"
Data "H" , "I" , "J" , "K" , "L" , "M"
Data "N" , "O" , "P" , "Q" , "R" , "S" , "T"
Data "U" , "V" , "W" , "X" , "Y" , "Z"
Data "*" , " " , "*" , "+" , " " , "+" , , "-" ,
Data "?"
Ziel war es eine Ausgabe ohne LCD zu haben die auch ordendlichen Text ausgeben kann.
Werde das ganze in einer Stage nützen,deshalb der Taster, für einen NC kann die übliche LDR Abfrage mit eingeklöppelt werden
Portbelegung folgt noch
Hier das Prog:
$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 = "Y" Then Gosub Py
If Zeichen = "Z" Then Gosub Pz
If Zeichen = " " Then Gosub Pleer
If Zeichen = "+" Then Gosub Pplus
If Zeichen = "-" Then Gosub Pminus
If Zeichen = "*" Then Gosub Pstern
If Zeichen = "." Then Gosub Ppunkt
If Zeichen = "?" Then Return
Loop
End
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
Py:
Portb = &B00000110
Portc = &B00001100
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
Pminus:
Portb = &B00000000
Portc = &B00110000
Portd = &B00000000
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
Pleer:
Portb = &B00000000
Portc = &B00000000
Portd = &B00000000
Waitms 6000
Portb = 0
Portc = 0
Portd = 0
Return
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 "1" , "2" , "3" , "4" , "5" , "6" , "7" , "8" , "9" , "0" , "*"
Data "A" , "B" , "C" , "D" , "E" , "F" , "G"
Data "H" , "I" , "J" , "K" , "L" , "M"
Data "N" , "O" , "P" , "Q" , "R" , "S" , "T"
Data "U" , "V" , "W" , "X" , "Y" , "Z"
Data "*" , " " , "*" , "+" , " " , "+" , , "-" ,
Data "?"