Hallo Zusammen,
ich habe eine kleines Problem. Beschäfftige mich seit kurzen mit mc und bin noch ein kleiner Anfänger.
Also folgendes ist mein Problem. Ich möchte eine Zeit/Uhr in einer Dot Matrix darstellen. Mit einer Timer Routine, also Minute +1 Stunde +1 etc funktioniert die Matrix auch wie sie soll. Dann habe ich einen Code gefunden mit dem ich meinen DCF1 ranhängen kann http://rn-wissen.de/wiki/index.php/DCF77-Decoder_als_Bascom-Library . Vorher mit dem Breadboard und LCD getestet. Erst kleine Empfangsprobleme, nach zwischenbau eines Singanlverstärkers innerhalb von 1-5 Minuten Funkzeit.
Also dachte ich mir, dass ich den Teil mit dem LCD aus dem Code lösche und meine vielen If schleifen in die Sub schreibe und schon leuchtet es fröhlich vor sich hin. Nur leider passiert nichts. Habe probiert die Zeitvariablen _min und _hour zu nutzen, allerdings auch da funktioniert nichts. In der Zwischenzeit habe ich so viel gelesen und probiert das ich völlig durch einander bin. Zwischenzeitlich hatte ich schon einen kleinen Erfolg, das die MAtrix mit der Softclock lief und dann ich nehem es an) beim stellen wieder resetet wurde. Leider habe ich diesen nicht mehr, da ich anscheint nicht pfiffig genug diesen zu speichern. Ich beutzte einen atm 16a, mit einer 6x8 Matrix einer 2x6 Matrix und einer 4X3 Matrix.
Es wäre echt Prima wenn mir mal einer auf die Sprünge helfen könnte wie ich weiter vorgehen kann oder muss.
Vielen Dank schon mal für eure Mühe
ich habe eine kleines Problem. Beschäfftige mich seit kurzen mit mc und bin noch ein kleiner Anfänger.
Also folgendes ist mein Problem. Ich möchte eine Zeit/Uhr in einer Dot Matrix darstellen. Mit einer Timer Routine, also Minute +1 Stunde +1 etc funktioniert die Matrix auch wie sie soll. Dann habe ich einen Code gefunden mit dem ich meinen DCF1 ranhängen kann http://rn-wissen.de/wiki/index.php/DCF77-Decoder_als_Bascom-Library . Vorher mit dem Breadboard und LCD getestet. Erst kleine Empfangsprobleme, nach zwischenbau eines Singanlverstärkers innerhalb von 1-5 Minuten Funkzeit.
Also dachte ich mir, dass ich den Teil mit dem LCD aus dem Code lösche und meine vielen If schleifen in die Sub schreibe und schon leuchtet es fröhlich vor sich hin. Nur leider passiert nichts. Habe probiert die Zeitvariablen _min und _hour zu nutzen, allerdings auch da funktioniert nichts. In der Zwischenzeit habe ich so viel gelesen und probiert das ich völlig durch einander bin. Zwischenzeitlich hatte ich schon einen kleinen Erfolg, das die MAtrix mit der Softclock lief und dann ich nehem es an) beim stellen wieder resetet wurde. Leider habe ich diesen nicht mehr, da ich anscheint nicht pfiffig genug diesen zu speichern. Ich beutzte einen atm 16a, mit einer 6x8 Matrix einer 2x6 Matrix und einer 4X3 Matrix.
Es wäre echt Prima wenn mir mal einer auf die Sprünge helfen könnte wie ich weiter vorgehen kann oder muss.
Vielen Dank schon mal für eure Mühe
Code:
'###########################################################################
'Programmname: Decodertest.bas Version 4.11
'
'Aufgabe:
'Es wird ein DCF-Empfänger (CONRAD 641138) an Portd.3 angeschlossen
'und DCF-Uhrzeit und -Datum auf dem LCD 4x16 ausgegeben.
'Dieses Programm ist ausgelegt für die Dcf77.lib ab V4.00.
'###########################################################################
$regfile = "m16adef.dat" 'ATmega 32
$crystal = 8000000 'Quarz: 8 MHz
$baud = 9600
$hwstack = 32 'hardware stack
$swstack = 10 'software stack
$framesize = 40 'frame space
$include "dcf77_soft.bas"
'###########################################################################
'Hauptprogramm:
Ddrd = &B11111111 ' D1-D6 Zeile einser Minten ; D7 Spalte 1 einser Minuten
Ddrc = &B11111111 'C0 - C6 Spalten 2 - 7 einser Minuten; C7 Spalte 1 fünfer Minuten
Ddrb = &B01111111 ' B0 - B2 Spalten Stunden ; B3 - B6 Zeilen Stunden
Ddra = &B11111110 ' A1 - A2 Zeilen fünfer Minuten ; A3 - A7 Spalte 2 - 6 fünfer Minuten
' A0 Eingang DCF
Portd = &B00000000
Portc = &B00000000
Portb = &B01111000
Porta = &B11111111
Declare Sub Showtime()
Dim I As Byte
Dim Minute As Word
Dim Min_ein As Word
Dim Stunde As Word
Dim Sekunde As Byte
'---------------------------------------------------------------------------
'Hauptprogramm:
Time$ = "02:11:00"
I = 0
Dcfstatus.7 = 1
Sekunde = 0
'DCF-Decoder EIN
'****************** HAUPTPROGRAMMSCHLEIFE **********************************
'Testprogramm:
Do
If Sekunde <> _sec Then
Call Showtime()
Sekunde = _sec
End If
Loop
End
'************* ENDE HAUPTPROGRAMM ******************************************
Sub Showtime()
If Dcfstatus6 = 1 Then
_min = Minute
_hour = Stunde
If Minute = 1 Then
Porta = &B00001010
Portd = &B10111111 : Portc = &B00000000
End If
If Minute = 2 Then
Portd = &B10111111 : Portc = &B00000001
End If
If Minute = 3 Then
Portd = &B10111111 : Portc = &B00000011
End If
If Minute = 4 Then
Portd = &B10111111 : Portc = &B00000111
End If
If Minute = 5 Then
Porta = &B00000100
Portc = &B10000111
End If
If Minute = 6 Then
Portd = &B00111111 : Portc = &B10001000
End If
If Minute = 7 Then
Portd = &B00111111 : Portc = &B10011000
End If
If Minute = 8 Then
Portd = &B00111111 : Portc = &B10111000
End If
If Minute = 9 Then
Portd = &B00111111 : Portc = &B11111000
End If
If Minute = 10 Then
Porta = &B10000100
End If
If Minute = 11 Then
Portd = &B11011111 : Portc = &B10000000
End If
If Minute = 12 Then
Portd = &B11011111 : Portc = &B10000001
End If
If Minute = 13 Then
Portd = &B11011111 : Portc = &B10000011
End If
If Minute = 14 Then
Portd = &B11011111 : Portc = &B10000111
End If
If Minute = 15 Then
Porta = &B11000100
End If
If Minute = 16 Then
Portd = &B01011111 : Portc = &B10001000
End If
If Minute = 17 Then
Portd = &B01011111 : Portc = &B10011000
End If
If Minute = 18 Then
Portd = &B01011111 : Portc = &B10111000
End If
If Minute = 19 Then
Portd = &B01011111 : Portc = &B11111000
End If
If Minute = 20 Then
Porta = &B11100100
End If
If Minute = 21 Then
Portd = &B11101111 : Portc = &B10000000
End If
If Minute = 22 Then
Portd = &B11101111 : Portc = &B10000001
End If
If Minute = 23 Then
Portd = &B11101111 : Portc = &B10000011
End If
If Minute = 24 Then
Portd = &B11101111 : Portc = &B10000111
End If
If Minute = 25 Then
Porta = &B11110100
End If
If Minute = 26 Then
Portd = &B01101111 : Portc = &B10001000
End If
If Minute = 27 Then
Portd = &B01101111 : Portc = &B10011000
End If
If Minute = 28 Then
Portd = &B01101111 : Portc = &B10111000
End If
If Minute = 29 Then
Portd = &B01101111 : Portc = &B11111000
End If
If Minute = 30 Then
Porta = &B11111100
End If
If Minute = 31 Then
Portd = &B11111101 : Portc = &B10000000
End If
If Minute = 32 Then
Portd = &B11111101 : Portc = &B10000001
End If
If Minute = 33 Then
Portd = &B11111101 : Portc = &B10000011
End If
If Minute = 34 Then
Portd = &B11111101 : Portc = &B10000111
End If
If Minute = 35 Then
Porta = &B00000010
End If
If Minute = 36 Then
Portd = &B01111101 : Portc = &B10001000
End If
If Minute = 37 Then
Portd = &B01111101 : Portc = &B10011000
End If
If Minute = 38 Then
Portd = &B01111101 : Portc = &B10111000
End If
If Minute = 39 Then
Portc = &B11111000
End If
If Minute = 40 Then
Porta = &B10000010
End If
If Minute = 41 Then
Portd = &B11111011 : Portc = &B10000000
End If
If Minute = 42 Then
Portd = &B11111011 : Portc = &B10000001
End If
If Minute = 43 Then
Portd = &B11111011 : Portc = &B10000011
End If
If Minute = 44 Then
Portd = &B11111011 : Portc = &B10000111
End If
If Minute = 45 Then
Porta = &B11000010
End If
If Minute = 46 Then
Portd = &B01111011 : Portc = &B10001000
End If
If Minute = 47 Then
Portc = &B01111011 : Portc = &B10011000
End If
If Minute = 48 Then
Portd = &B01111011 : Portc = &B10111000
End If
If Minute = 49 Then
Portd = &B01111011 : Portc = &B11111000
End If
If Minute = 50 Then
Porta = &B11100010
End If
If Minute = 51 Then
Portd = &B11110111 : Portc = &B10000000
End If
If Minute = 52 Then
Portd = &B11110111 : Portc = &B10000001
End If
If Minute = 53 Then
Portc = &B11110111 : Portc = &B10000011
End If
If Minute = 54 Then
Portd = &B11110111 : Portc = &B10000111
End If
If Minute = 55 Then
Porta = &B11110010
End If
If Minute = 56 Then
Portd = &B01110111 : Portc = &B10001000
End If
If Minute = 57 Then
Portd = &B01110111 : Portc = &B10011000
End If
If Minute = 58 Then
Portd = &B01110111 : Portc = &B10111000
End If
If Minute = 59 Then
Portd = &B01110111 : Portc = &B11111000
End If
If Minute = 0 Then
Porta = &B11111010
End If
If Stunde = 1 Then
Portb = &B00111100 ' Zeile 1 = B6 ... Zeile 4 = B3 0 =aktive
End If
If Stunde = 2 Then ' Spalte 1 = B2 .... Spalte 3 = B0 1 = aktive
Portb = &B00111010
End If
If Stunde = 3 Then
Portb = &B00111001
End If
If Stunde = 4 Then
Portb = &B01011100
End If
If Stunde = 5 Then
Portb = &B01011010
End If
If Stunde = 6 Then
Portb = &B01011001
End If
If Stunde = 7 Then
Portb = &B01101100
End If
If Stunde = 8 Then
Portb = &B01101010
End If
If Stunde = 9 Then
Portb = &B01101001
End If
If Stunde = 10 Then
Portb = &B01110100
End If
If Stunde = 11 Then
Portb = &B01110010
End If
If Stunde = 12 Then
Portb = &B01110001
End If
End Sub
'---------------------------------------------------------------------------
Getdatetime: 'Nicht genutzt!
Setdate:
Settime:
Return
'---------------------- Interrupt Routine DCF77 ----------------------------
Tim2_isr:
Timer2 = Startwert
Call Dcf77_soft
Return