'**************************************************************** '* Name : Miniversion V01.BAS * '* Author : Tomtom DL1MFK * '* Version : 1.0 03.12.2007 * '* Notes : Demoversion für den Einsatz in der Mini-Version * '* : * '**************************************************************** '**************************************************************** ' Register-Deklarationen * '**************************************************************** $regfile = "M8def.dat" $crystal = 8000000 '$baud = 19200 '**************************************************************** ' Deklarationen * '**************************************************************** Dim Bytes As Word Dim Byte1 As Byte Dim Byte2 As Byte Dim I As Byte ' Zählvariable Dim Stelle0 As Word Dim Stelle1 As Word Dim Stelle2 As Word Dim Stelle3 As Word Dim Lin As Byte ' Zeilennummer Dim Col As Byte ' Spaltennummer Config Pind.4 = Output Config Pind.6 = Output Config Pind.7 = Output Lc_dat Alias Portd.4 ' Daten (LC pin 11) Lc_clk Alias Portd.7 ' Clock (LC pin 10) Lc_ce Alias Portd.6 ' Enable (LC pin 9) '**************************************************************** ' Konstanten * '**************************************************************** Const Command0 = &B1000_0000_0000_0000 '**************************************************************** ' Initialisierung * '**************************************************************** Gosub Osd_init Gosub Rufz_anzeigen '**************************************************************** ' Hauptschleife * '**************************************************************** Do ' If Pind.5 = 0 Then ' Bytes = &B1101_1101_0000_0011 ' COM 5 ... umschalten auf Internen Sync für Farbiges Bild ... ' Gosub Leitung ' Else ' Bytes = &B1101_1100_0000_0011 ' COM 5 ... umschalten auf Einblendung ' Gosub Leitung ' End If Gosub Alle_zeichen 'Gosub Zaehlen 'Gosub Rufz_anzeigen Waitms 200 Loop ' End '**************************************************************** ' OSD Initialisierung * '**************************************************************** Osd_init: Gosub Disp_aus Bytes = &B1100_0001_0000_0000 ' Com 4 Reset Gosub Leitung Bytes = &B1100_0100_0000_0000 ' Com 4 Ram löschen !!! Gosub Leitung Waitms 500 ' 'Bytes = &B1100_0000_0010_0001 ' Com 4 Disp an ' 'Gosub Leitung ' Bytes = &B1010_0000_0000_1001 ' COM 2 Vertikal 1mal so groß in 1. und 2. Zeile V Verschiebung 1ßßß ' Gosub Leitung ' Bytes = &B1011_0000_0101_1010 ' COM 3 Horizontal 1mal so groß in 1. und 2. Zeile H Verschiebung 01_1111 ' Gosub Leitung ' LC-Oszillator als Dot-clock ' Bytes = &B1101_1101_0000_0011 ' COM 5 ... PAL ... ' Gosub Leitung ' Bytes = &B1110_1100_0000_0000 ' COM 6 ' Gosub Leitung ' Bytes = &B1111_0000_0000_0000 ' COM 7 ' Gosub Leitung ' Bytes = &B1111_0011_0000_1010 ' COM 10 LNC Farbe Einstellen Zeile1 Cyan ' Gosub Leitung ' Bytes = &B1111_0100_0000_0000 ' COM 11 ' Gosub Leitung ' Bytes = &B1111_0101_0000_0000 ' COM 12 ' Gosub Leitung ' Bytes = &B1111_1011_0000_0000 ' COM 18 ' Gosub Leitung Gosub Disp_an Return '**************************************************************** ' Rufzeichen einblenden * '**************************************************************** Rufz_anzeigen: ' Rufzeichen anzeigen: Lin = 12 : Col = 19 Gosub Position Gosub Leitung Byte1 = &B1001_0000 Byte2 = "D" Gosub Leitung2 Byte2 = "L" Gosub Leitung2 Byte2 = "1" Gosub Leitung2 Byte2 = "M" Gosub Leitung2 Byte2 = "F" Gosub Leitung2 Byte2 = "K" Gosub Leitung2 Return '**************************************************************** ' Bis 100 zählen und Anzeigen * '**************************************************************** Zaehlen: For I = 0 To 100 Lin = 1 : Col = 1 Gosub Position ' Position aus Zeile und Spalte Gosub Leitung Byte1 = &B1001_0000 Stelle0 = I \ 100 Byte2 = 48 + Stelle0 Gosub Leitung2 Stelle0 = I Mod 100 Stelle1 = Stelle0 \ 10 Byte2 = 48 + Stelle1 Gosub Leitung2 Stelle2 = Stelle0 Mod 10 Byte2 = 48 + Stelle2 Gosub Leitung2 Waitms 50 Next Return '**************************************************************** '' AlleZeichen Schleife * '**************************************************************** Alle_zeichen: Bytes = &B1000_0000_0000_0000 ' Pos: Line 0, Col 0 Gosub Leitung Byte1 = &B1001_0000 For I = 0 To 255 Byte2 = I Gosub Leitung2 Next Return '**************************************************************** ' Daten auf die 3 Leitungen * '**************************************************************** Leitung: ' Byte1 und Byte2 aus Bytes Byte1 = High(bytes) Byte2 = Low(bytes) Leitung2: ' Byte1 und Byte2 einzeln gesetzt Lc_ce = 0 Waitus 3 Shiftout Lc_dat , Lc_clk , Byte1 , 2 Waitus 3 Shiftout Lc_dat , Lc_clk , Byte2 , 2 Waitus 3 Lc_ce = 1 Return '***************************************************************** ' Position aus Zeile und Spalte * '***************************************************************** Position: Lin = Lin - 1 ' 1. Zeile = 0 Col = Col - 1 ' 1. Spalte = 0 Bytes = Makeint(col , Lin) Bytes = Bytes Or Command0 Return '**************************************************************** ' Display An/Ausschalten * '**************************************************************** Disp_an: Bytes = &B1100_0000_0010_0001 ' Com4 Display angeschaltet mit Rand um Zeichen 'Bytes = &B1100_0000_0010_0001 ' Com4 Display angeschaltet mit Hg unter Zeichen 'Bytes = &B1100_0000_0000_0001 ' Com4 Display an ohne Hg Gosub Leitung Return Disp_aus: Bytes = &B1100_0000_0010_0000 ' Com4 Display aus mit Hg 'Bytes = &B1100_0000_0000_0000 ' Com4 Display aus ohne Hg Gosub Leitung Return