list p=16f628a ; Definition des PIC´s #include ; Laden der jeweiligen include Datei für den PIC ERRORLEVEL -302 loops equ 0x20 ; Wartezeit für WAIT in Millisekunden loops2 equ 0x21 ; interner timer für wait LcdStatus equ 0x22 ; Puffer für aus dem LCD ausgelesenes Statusbyte LcdDaten equ 0x23 ; Puffer für zum LCD zu schreibendes Byte Taste equ 0x24 ; Tastaturpuffer ZAEHL1 equ 0x25 ; Hilfsvariable für Warte-Routine ZAEHL2 equ 0x26 ; Hilfsvariable für Warte-Routine ZAEHL3 equ 0x27 ; Hilfsvariable für Warte-Routine ZAEHL4 equ 0x28 ; Hilfsvariable für Warte-Routine ZAEHL5 equ 0x29 ; Hilfsvariable für Warte-Routine ZAEHL6 equ 0x44 ; Hilfsvariable für Warte-Routine ZAEHL7 equ 0x31 ; Hilfsvariable für Warte-Routine ZAEHL8 equ 0x32 ; Hilfsvariable für Warte-Routine ZAEHL9 equ 0x33 ; Hilfsvariable für Warte-Routine ZAEHL10 equ 0x34 ; Hilfsvariable für Warte-Routine ZAEHL11 equ 0x35 ; Hilfsvariable für Warte-Routine ZAEHL12 equ 0x36 ; Hilfsvariable für Warte-Routine ZAEHL13 equ 0x37 ; Hilfsvariable für Warte-Routine ZAEHL14 equ 0x38 ; Hilfsvariable für Warte-Routine ZAEHL15 equ 0x39 ; Hilfsvariab ZAEHL16 equ 0x40 ; Hilfsvariable für Warte-Routine ZAEHL17 equ 0x41 ; Hilfsvariable für Warte-Routine ZAEHL18 equ 0x42 ; Hilfsvariab Count_Eistee equ 0x43 counter equ 0x44 ABC equ 0x45 #define LcdE PORTB,0 ; enable Lcd #define LcdRw PORTB,3 ; read Lcd #define LcdRs PORTB,2 ; Daten Lcd (nicht control) #define LcdPort PORTB ; Datenbus des LCD (obere 4 Bit) ; f?r Tastatur-Anschlu? #define KRow1 PORTB,1 ;Keyboard 1 4 7 * #define KRow2 PORTB,2 ;Keyboard 2 5 8 0 #define KRow3 PORTB,3 ;Keyboard 3 6 9 # #define KLine1 PORTB,4 ;Keyboard 1 2 3 #define KLine2 PORTB,5 ;Keyboard 4 5 6 #define KLine3 PORTB,6 ;Keyboard 7 8 9 #define KLine4 PORTB,7 ;Keyboard * 0 # Ini_con Equ B'00000000' ; Interupt disable Ini_opt Equ B'00000010' ; pull-up ;******************************************************** ; Das Programm beginnt mit der Initialisierung Init bsf STATUS, RP0 ; auf Bank 1 umschalten clrf TRISA ; PortA zu output´s bcf STATUS, RP0 ; auf Bank 0 schalten clrf PORTA bsf STATUS, RP0 ; Bank 1 movlw Ini_opt ; pull-up Wiederst?nde ein movwf OPTION_REG movlw B'00000000' ; PortB alle outputs movwf TRISB bcf STATUS, RP0 ; Bank 0 clrf PORTB ; PortB zu output´s movlw Ini_con ; Interupt disable movwf INTCON movlw 0x30 ; Tastendruckzähler movwf Count_Eistee ; Tastendruckzähler ;Display initialisieren call InitLcd mainloop call Tastfrei ; darauf warten, das keine Taste gedr?ckt ist call WAIT ; entprellen nur bei schlechten Tasten n?tig drueck call Tastatur ; wird nun eine Taste gedr?ckt? movfw Taste ; Tastencode nach w; Taste=0 dann Z=1 btfsc STATUS, Z ; skip wenn Taste<>0 goto drueck ; Tastencode=0 d.h. keine Taste gedr?ckt, weiter warten call OutLcdDaten ; Tastencode am LCD ausgeben goto mainloop ; auf ein neues ;***************************************************** ;+++LCD-Routinen************************************** ;***************************************************** ;LCD initialisieren in 9 Schritten, Begr??ung ausgeben InitLcd movlw D'255' ; 250 ms Pause nach dem Einschalten movwf loops call WAIT movlw B'00110000' ; 1 movwf LcdPort bsf LcdE nop bcf LcdE movlw D'50' ; 50 ms Pause movwf loops call WAIT movlw B'00110000' ; 2 call Control8Bit movlw B'00110000' ; 3 call Control8Bit movlw B'00100000' ; 4 call Control8Bit movlw B'00000001' ; l?schen und cusor home call OutLcdControl movlw B'00101000' ; 5 function set, 4-bit 2-zeilig, 5x7 call OutLcdControl movlw B'00001000' ; 6 display off call OutLcdControl movlw B'00000110' ; 7 entry mode, increment, disable display-shift call OutLcdControl movlw B'00000011' ; 8 cursor home, cursor home call OutLcdControl movlw B'00001100' ; 9 display on call OutLcdControl movlw ' ' call OutLcdDaten movlw ' ' call OutLcdDaten movlw ' ' call OutLcdDaten movlw ' ' call OutLcdDaten movlw ' ' call OutLcdDaten movlw 'X' ; 'XiMiX:' ausgeben call OutLcdDaten movlw 'i' call OutLcdDaten movlw 'M' call OutLcdDaten movlw 'i' call OutLcdDaten movlw 'X' call OutLcdDaten movlw B'11000000' ;Ausgabe 2 Zeile call OutLcdControl ;Ausgabe 2 Zeile movlw ' ' call OutLcdDaten movlw ' ' call OutLcdDaten movlw ' ' call OutLcdDaten movlw ' ' call OutLcdDaten movlw 'W' ; 'EISTEE:' ausgeben call OutLcdDaten movlw 'E' call OutLcdDaten movlw 'L' call OutLcdDaten movlw 'C' call OutLcdDaten movlw 'O' call OutLcdDaten movlw 'M' call OutLcdDaten movlw 'E' call OutLcdDaten return ;***************************************************** ; ein Steuerbyte aus W 8-bittig ?bertragen Control8Bit movwf LcdPort bsf LcdE nop bcf LcdE movlw D'10' movwf loops call WAIT return ;***************************************************** ; darauf warten, da? das Display bereit zur Datenannahme ist ; dazu wird das busy-Bit des LCD abgefragt LcdBusy bsf STATUS, RP0 ; make Port B4..7 input movlw B'11110000' iorwf TRISB, f bcf STATUS, RP0 BusyLoop bcf LcdRs ; Steuerregister bsf LcdRw ; Lesen bsf LcdE nop movf LcdPort, w ; 4 obere Bits lesen (D7..D4) movwf LcdStatus ; und in LcdStatus speichern bcf LcdE nop bsf LcdE nop ; 4 untere Bits lesen (D3..D0) und ignorieren bcf LcdE btfsc LcdStatus, 7 ; teste bit 7 goto BusyLoop bcf LcdRw bsf STATUS, RP0 ; make Port B4..7 output movlw B'00001111' andwf TRISB, f bcf STATUS, RP0 return ;***************************************************** ; aus W ein Byte mit Steuerdaten zum Display ?bertragen OutLcdControl movwf LcdDaten ; Byte in LcdDaten zwischenspeichern call LcdBusy ; warten bis Display bereit ist movf LcdDaten, w ; Byte zur?ck nach W holen andlw H'F0' ; low-Teil l?schen movwf LcdPort ; Hi-teil Daten schreiben bsf LcdE nop bcf LcdE ; Disable LcdBus swapf LcdDaten, w ; Byte verdreht nach W holen andlw H'F0' ; High Teil l?schen movwf LcdPort ; Low-teil Daten schreiben bsf LcdE nop bcf LcdE ; Disable LcdBus return ;***************************************************** ; aus W ein Datenbyte (zum Anzeigen) an's Display ?bertragen OutLcdDaten movwf LcdDaten ; Byte in LcdDaten zwischenspeichern call LcdBusy ; warten bis Display bereit ist movf LcdDaten, w ; Byte zur?ck nach W holen andlw H'F0' ; low-Teil l?schen movwf LcdPort ; Hi-teil Daten schreiben bsf LcdRs ; Daten bsf LcdE ; Enable LcdBus nop bcf LcdE ; Disable LcdBus swapf LcdDaten, w ; Byte verdreht nach W holen andlw H'F0' ; High Teil l?schen movwf LcdPort ; Low-teil Daten schreiben bsf LcdRs ; Daten bsf LcdE nop bcf LcdE ; Disable LcdBus bcf LcdRs ; return ;***************************************************** ;+++Tastatur-Routinen********************************* ;***************************************************** ; warten darauf, da? keine Taste mehr gedr?ckt ist Tastfrei ; Warten auf freie Tastatur call Tastatur ; Tastencode nach Taste & W movfw Taste ; wenn code=0 dann Z=1 btfss STATUS, Z ; wenn Z=1 dann skip goto Tastfrei ; weiter warten return ; Tastatur ist frei ;***************************************************** ; ist eine Taste gedr?ckt? und welche? ; der Tastencode wird in W und Taste gespeichert (ASCII) ; wenn keine Taste gedr?ckt wurde, wird 0 zur?ckgegeben ; ; zur Erinnerung liste ich noch mal die weiter oben aufgef?hrten ; Definitionen auf ; mit denen ist festgelegt, an welche Pins des PortB die einzelnen ; Spalten und Zeilen der Tastatur abgeschlossen sind ;#define KRow1 PORTB,1 ;Keyboard 1 4 7 * ;#define KRow2 PORTB,2 ;Keyboard 2 5 8 0 ;#define KRow3 PORTB,3 ;Keyboard 3 6 9 # ;#define KLine1 PORTB,4 ;Keyboard 1 2 3 ;#define KLine2 PORTB,5 ;Keyboard 4 5 6 ;#define KLine3 PORTB,6 ;Keyboard 7 8 9 ;#define KLine4 PORTB,7 ;Keyboard * 0 # Tastatur ; zuerst m?ssen die Tastaturzeilen-Pins auf Eingang gestellt werden bsf STATUS, RP0 ; Bank 1 movlw Ini_opt ; pull-up Widerst?nde ein movwf OPTION_REG movlw B'11110000' ; RB0 .. RB3 output, RB4 .. RB7 input movwf TRISB bcf STATUS, RP0 ; Bank 0 ; das Enable-Pin des Displays mu? auf Low stehen, damit das Display ; abgeschaltet ist solange wir die Tastatur abfragen clrf PORTB ; Display inaktiv am Bus ; w wird auf 0 gesetzt, dieser Wert wird durch ein ASSCI-Zeichen ; ?berschrieben, falls eine Taste gedr?ckt ist ; falls keine Taste gedr?ckt ist, bleibt 0 erhalten movlw 0 ; W=0 bcf KRow1 ; 1. spalte aktivieren bsf KRow3 bsf KRow2 call key1 ; 1. Spalte abfragen bcf KRow2 ; 2.Spalte aktivieren bsf KRow1 ; 1.Spalte ausschalten call key2 ; 2. Spalte bcf KRow3 ; 3. Spalte aktivieren bsf KRow2 ; 2. spalte ausschalten call key3 ; 3. Spalte bsf KRow3 ; 3. Spalte ausschalten movwf Taste ; PortB wieder komplett zu Output machen bsf STATUS, RP0 ; Bank 1 movlw B'00000000' ; RB1 .. RB7 output movwf TRISB bcf STATUS, RP0 ; Bank 0 return key1 btfss KLine1 call Eistee18 ; aufruf des Unterprogrammes für 1/8 Eistee btfss KLine2 call Eistee14 btfss KLine3 call Eistee12 btfss KLine4 call Zaehler return key2 btfss KLine1 retlw '2' btfss KLine2 call Wasser18 btfss KLine3 call Wasser14 btfss KLine4 call Wasser12 return key3 btfss KLine1 call Eisteebel. btfss KLine2 call Wasserbel. btfss KLine3 call dos.plus btfss KLine4 call dos.minus return Eistee18 incf Count_Eistee,1 movlw B'11000000' ;Ausgabe 2 Zeile call OutLcdControl ;Ausgabe 2 Zeile movlw ' ' call OutLcdDaten movlw ' ' call OutLcdDaten movlw ' ' call OutLcdDaten movlw '1' call OutLcdDaten movlw '/' call OutLcdDaten movlw '8' call OutLcdDaten movlw ' ' call OutLcdDaten movlw 'E' ; 'EISTEE:' ausgeben call OutLcdDaten movlw 'I' call OutLcdDaten movlw 'S' call OutLcdDaten movlw 'T' call OutLcdDaten movlw 'E' call OutLcdDaten movlw 'E' call OutLcdDaten movlw b'00000011' iorwf PORTA, 1 call wait3s bcf PORTA,1 call Display Eistee14 movlw B'11000000' ;Ausgabe 2 Zeile call OutLcdControl ;Ausgabe 2 Zeile movlw ' ' call OutLcdDaten movlw ' ' call OutLcdDaten movlw ' ' call OutLcdDaten movlw '1' call OutLcdDaten movlw '/' call OutLcdDaten movlw '4' call OutLcdDaten movlw ' ' call OutLcdDaten movlw 'E' ; 'EISTEE:' ausgeben call OutLcdDaten movlw 'I' call OutLcdDaten movlw 'S' call OutLcdDaten movlw 'T' call OutLcdDaten movlw 'E' call OutLcdDaten movlw 'E' call OutLcdDaten movlw b'00000011' iorwf PORTA, 1 call wait5s bcf PORTA,1 call Display Eistee12 movlw B'11000000' ;Ausgabe 2 Zeile call OutLcdControl ;Ausgabe 2 Zeile movlw ' ' ; 1/2 Eistee augeben call OutLcdDaten movlw ' ' call OutLcdDaten movlw ' ' call OutLcdDaten movlw '1' call OutLcdDaten movlw '/' call OutLcdDaten movlw '2' call OutLcdDaten movlw ' ' call OutLcdDaten movlw 'E' call OutLcdDaten movlw 'I' call OutLcdDaten movlw 'S' call OutLcdDaten movlw 'T' call OutLcdDaten movlw 'E' call OutLcdDaten movlw 'E' call OutLcdDaten movlw b'00000011' iorwf PORTA, 1 call wait6s bcf PORTA,1 call Display Wasser18 movlw B'11000000' ;Ausgabe 2 Zeile call OutLcdControl ;Ausgabe 2 Zeile movlw ' ' call OutLcdDaten movlw ' ' call OutLcdDaten movlw ' ' call OutLcdDaten movlw '1' call OutLcdDaten movlw '/' call OutLcdDaten movlw '8' call OutLcdDaten movlw ' ' call OutLcdDaten movlw 'W' ; 'EISTEE:' ausgeben call OutLcdDaten movlw 'A' call OutLcdDaten movlw 'S' call OutLcdDaten movlw 'S' call OutLcdDaten movlw 'E' call OutLcdDaten movlw 'R' call OutLcdDaten bsf PORTA,0 call wait4s ; für die Zeit von 4sekunden bcf PORTA,0 call Display Wasser14 movlw B'11000000' ;Ausgabe 2 Zeile call OutLcdControl ;Ausgabe 2 Zeile movlw ' ' call OutLcdDaten movlw ' ' call OutLcdDaten movlw ' ' call OutLcdDaten movlw '1' call OutLcdDaten movlw '/' call OutLcdDaten movlw '4' call OutLcdDaten movlw ' ' call OutLcdDaten movlw 'W' ; 'EISTEE:' ausgeben call OutLcdDaten movlw 'A' call OutLcdDaten movlw 'S' call OutLcdDaten movlw 'S' call OutLcdDaten movlw 'E' call OutLcdDaten movlw 'R' call OutLcdDaten bsf PORTA,0 ; Relais für Wasser ein call wait5s ; für die Zeit von 5sekunden bcf PORTA,0 ; Relais für Wasser aus call Display ; Unterprogramm mit Display Initialisierung + Ausgabe von 1.Zeile XiMiX, 2. Zeile Welcome Wasser12 movlw B'11000000' ;Ausgabe 2 Zeile call OutLcdControl ;Ausgabe 2 Zeile movlw ' ' ; 1/2 Wasser call OutLcdDaten movlw ' ' call OutLcdDaten movlw ' ' call OutLcdDaten movlw '1' call OutLcdDaten movlw '/' call OutLcdDaten movlw '2' call OutLcdDaten movlw ' ' call OutLcdDaten movlw 'W' call OutLcdDaten movlw 'A' call OutLcdDaten movlw 'S' call OutLcdDaten movlw 'S' call OutLcdDaten movlw 'E' call OutLcdDaten movlw 'R' call OutLcdDaten bsf PORTA,0 ; Relais für Wasser zieht an call wait6s ; für die Zeit von 7sekunden bcf PORTA,0 ; Relais für Wasser fällt wider ab call Display ; Aufruf des Unterprogrammes zur Initialisierung des Displays Eisteebel. movlw B'11000000' ;Ausgabe 2 Zeile call OutLcdControl ;Ausgabe 2 Zeile movlw 'B' call OutLcdDaten movlw 'E' call OutLcdDaten movlw 'L' call OutLcdDaten movlw 'I' call OutLcdDaten movlw 'E' call OutLcdDaten movlw 'B' call OutLcdDaten movlw 'I' call OutLcdDaten movlw 'G' ; 'EISTEE:' ausgeben call OutLcdDaten movlw ' ' call OutLcdDaten movlw 'E' call OutLcdDaten movlw 'I' call OutLcdDaten movlw 'S' call OutLcdDaten movlw 'T' call OutLcdDaten movlw 'E' call OutLcdDaten movlw 'E' call OutLcdDaten bsf PORTA,0 bcf PORTA,0 call Display Wasserbel. movlw B'11000000' ;Ausgabe 2 Zeile call OutLcdControl ;Ausgabe 2 Zeile movlw 'B' call OutLcdDaten movlw 'E' call OutLcdDaten movlw 'L' call OutLcdDaten movlw 'I' call OutLcdDaten movlw 'E' call OutLcdDaten movlw 'B' call OutLcdDaten movlw 'I' call OutLcdDaten movlw 'G' ; 'EISTEE:' ausgeben call OutLcdDaten movlw ' ' call OutLcdDaten movlw 'W' call OutLcdDaten movlw 'A' call OutLcdDaten movlw 'S' call OutLcdDaten movlw 'S' call OutLcdDaten movlw 'E' call OutLcdDaten movlw 'R' call OutLcdDaten bsf PORTA,0 bcf PORTA,0 call Display Zaehler call WAIT movlw B'00110000' ; 1 movwf LcdPort bsf LcdE nop bcf LcdE movlw D'50' ; 50 ms Pause movwf loops call WAIT movlw B'00110000' ; 2 call Control8Bit movlw B'00110000' ; 3 call Control8Bit movlw B'00100000' ; 4 call Control8Bit movlw B'00000001' ; l?schen und cusor home call OutLcdControl movlw B'00101000' ; 5 function set, 4-bit 2-zeilig, 5x7 call OutLcdControl movlw B'00001000' ; 6 display off call OutLcdControl movlw B'00000110' ; 7 entry mode, increment, disable display-shift call OutLcdControl movlw B'00000011' ; 8 cursor home, cursor home call OutLcdControl movlw B'00001100' ; 9 display on call OutLcdControl movlw 'S' call OutLcdDaten movlw 't' call OutLcdDaten movlw 'a' call OutLcdDaten movlw 'n' call OutLcdDaten movlw 'd' call OutLcdDaten movlw ':' ; 'XiMiX:' ausgeben call OutLcdDaten movfw Count_Eistee ; Tastendruckanzahl Ausgeben call OutLcdDaten movlw ' ' call OutLcdDaten movlw '/' call OutLcdDaten movlw '2' call OutLcdDaten movlw '5' call OutLcdDaten movlw '5' call OutLcdDaten call wait5s Display ; Unterprogramm für die Display Routine call WAIT movlw B'00110000' ; 1 movwf LcdPort bsf LcdE nop bcf LcdE movlw D'50' ; 50 ms Pause movwf loops call WAIT movlw B'00110000' ; 2 call Control8Bit movlw B'00110000' ; 3 call Control8Bit movlw B'00100000' ; 4 call Control8Bit movlw B'00000001' ; l?schen und cusor home call OutLcdControl movlw B'00101000' ; 5 function set, 4-bit 2-zeilig, 5x7 call OutLcdControl movlw B'00001000' ; 6 display off call OutLcdControl movlw B'00000110' ; 7 entry mode, increment, disable display-shift call OutLcdControl movlw B'00000011' ; 8 cursor home, cursor home call OutLcdControl movlw B'00001100' ; 9 display on call OutLcdControl movlw ' ' ; 'XiMiX:' ausgeben call OutLcdDaten movlw ' ' call OutLcdDaten movlw ' ' call OutLcdDaten movlw ' ' call OutLcdDaten movlw ' ' call OutLcdDaten movlw 'X' call OutLcdDaten movlw 'i' call OutLcdDaten movlw 'M' call OutLcdDaten movlw 'i' call OutLcdDaten movlw 'X' call OutLcdDaten movlw B'11000000' ;Ausgabe 2 Zeile call OutLcdControl ;Ausgabe 2 Zeile movlw ' ' ; 'WELCOME:' ausgeben call OutLcdDaten movlw ' ' call OutLcdDaten movlw ' ' call OutLcdDaten movlw ' ' call OutLcdDaten movlw 'W' call OutLcdDaten movlw 'E' call OutLcdDaten movlw 'L' call OutLcdDaten movlw 'C' call OutLcdDaten movlw 'O' call OutLcdDaten movlw 'M' call OutLcdDaten movlw 'E' call OutLcdDaten goto mainloop return WAIT top movlw .250 ; timing adjustment variable (1ms) movwf loops2 top2 nop ; warten und nichts tun nop nop nop nop nop nop decfsz loops2, F ; innere Schleife fertig? goto top2 ; nein, noch mal rum ; decfsz loops, F ; ?u?ere Schleife fertig? goto top ; nein, noch mal rum retlw 0 ; FERTIG und return ;******* WARTEZEITEN 2- 7sekunden ************ wait2s ; Warteschleife 2sekunden movlw d'110' movwf ZAEHL1 movlw d'94' movwf ZAEHL2 movlw d'26' movwf ZAEHL3 tloop2s: decfsz ZAEHL1 goto tloop2s decfsz ZAEHL2 goto tloop2s decfsz ZAEHL3 goto tloop2s return wait3s ; Warteschleife 3sekunden movlw d'38' movwf ZAEHL4 movlw d'13' movwf ZAEHL5 movlw d'39' movwf ZAEHL6 tloop3s: decfsz ZAEHL4 goto tloop3s decfsz ZAEHL5 goto tloop3s decfsz ZAEHL6 goto tloop3s return wait4s ; Warteschleife 4sekunden movlw d'224' movwf ZAEHL7 movlw d'187' movwf ZAEHL8 movlw d'51' movwf ZAEHL9 tloop4s: decfsz ZAEHL7 goto tloop4s decfsz ZAEHL8 goto tloop4s decfsz ZAEHL9 goto tloop4s return wait5s ; Warteschleife 5sekunden movlw d'151' movwf ZAEHL10 movlw d'106' movwf ZAEHL11 movlw d'64' movwf ZAEHL12 tloop5s: decfsz ZAEHL10 goto tloop5s decfsz ZAEHL11 goto tloop5s decfsz ZAEHL12 goto tloop5s return wait6s ; Warteschleife 6 Sekunden movlw d'80' movwf ZAEHL13 movlw d'25' movwf ZAEHL14 movlw d'77' movwf ZAEHL15 tloop6s: decfsz ZAEHL13 goto tloop6s decfsz ZAEHL14 goto tloop6s decfsz ZAEHL15 goto tloop6s return wait7s ; Warteschleife 7 Sekunden movlw d'9' movwf ZAEHL16 movlw d'200' movwf ZAEHL17 movlw d'89' movwf ZAEHL18 tloop7s: decfsz ZAEHL16 goto tloop7s decfsz ZAEHL17 goto tloop7s decfsz ZAEHL18 goto tloop7s return dos.plus call dos. ; unterprogramm für Display ausgabe movf counter,w xorlw D'1' movlw '1' ; Ausgabe auf Display Dosierung: 1 call OutLcdDaten btfsc counter,1 call wait5s ; Wartezeit call dos. movf counter,w xorlw D'2' movlw '2' call OutLcdDaten btfsc STATUS,Z call wait5s dos.minus call dos. ; unterprogramm für Display ausgabe movf counter,w xorlw D'1' movlw '1' ; Ausgabe auf Display Dosierung: 1 call OutLcdDaten btfsc counter,1 call wait5s ; Wartezeit call dos. movf counter,w xorlw D'2' movlw '2' call OutLcdDaten btfsc STATUS,Z call wait5s dos. call WAIT movlw B'00110000' ; 1 movwf LcdPort bsf LcdE nop bcf LcdE movlw D'50' ; 50 ms Pause movwf loops call WAIT movlw B'00110000' ; 2 call Control8Bit movlw B'00110000' ; 3 call Control8Bit movlw B'00100000' ; 4 call Control8Bit movlw B'00000001' ; l?schen und cusor home call OutLcdControl movlw B'00101000' ; 5 function set, 4-bit 2-zeilig, 5x7 call OutLcdControl movlw B'00001000' ; 6 display off call OutLcdControl movlw B'00000110' ; 7 entry mode, increment, disable display-shift call OutLcdControl movlw B'00000011' ; 8 cursor home, cursor home call OutLcdControl movlw B'00001100' ; 9 display on call OutLcdControl movlw ' ' ; 'XiMiX:' ausgeben call OutLcdDaten movlw ' ' call OutLcdDaten movlw ' ' call OutLcdDaten movlw ' ' call OutLcdDaten movlw ' ' call OutLcdDaten movlw 'X' call OutLcdDaten movlw 'i' call OutLcdDaten movlw 'M' call OutLcdDaten movlw 'i' call OutLcdDaten movlw 'X' call OutLcdDaten movlw B'11000000' ;Ausgabe 2 Zeile call OutLcdControl ;Ausgabe 2 Zeile movlw 'D' call OutLcdDaten movlw 'o' call OutLcdDaten movlw 's' call OutLcdDaten movlw 'i' call OutLcdDaten movlw 'e' call OutLcdDaten movlw 'r' call OutLcdDaten movlw 'u' call OutLcdDaten movlw 'n' call OutLcdDaten movlw 'g' call OutLcdDaten movlw ':' call OutLcdDaten end