.equ sclk=0 .equ rclk=1 .equ sdat=3 .include "m16def.inc" ;Definitionsdatei einbinden, ggf. durch ;2333def.inc ersetzen .def temp = r16 ldi temp, LOW(RAMEND) ; LOW-Byte der obersten RAM-Adresse out SPL, temp ldi temp, HIGH(RAMEND) ; HIGH-Byte der obersten RAM-Adresse out SPH, temp LDI ZH,HIGH(2*Displaydaten) LDI ZL,LOW(2*Displaydaten) LDI r16, 0xFF out DDRC, r16 out DDRA, r16 LDI r16, 0x0 rcall Verzoegerung out PortA, r16 out PortC, r16 ;00Font Reset Comand/Data /CE /Rd /Wr LDI r16, 0b00000110 out PortA, r16 rcall VerzKur sbi PortA, 4 rcall VerzKur ; Daten schreiben Anfang LDI r16, 0b10000000 rcall CommandWrite LDI r16, 0b00000000 rcall DataWrite LDI r16, 0b00000000 rcall DataWrite LDI r16, 0b01000010 rcall CommandWrite LDI r16, 0b00010000 rcall DataWrite LDI r16, 0b00000000 rcall DataWrite LDI r16, 0b01000011 rcall CommandWrite LDI r16, 0b00000000 rcall DataWrite LDI r16, 0b00010000 rcall DataWrite LDI r16, 0b01000001 rcall CommandWrite LDI r16, 0b00010000 rcall DataWrite LDI r16, 0b00000000 rcall DataWrite LDI r16, 0b01000001 rcall CommandWrite LDI r16, 0b00000000 rcall DataWrite LDI r16, 0b00000000 rcall DataWrite LDI r16, 0b00100100 rcall CommandWrite LDI r16, 0b01010101 rcall DataWrite LDI r16, 0b11000000 rcall CommandWrite LDI r16, 0b10101010 rcall DataWrite LDI r16, 0b11000000 rcall CommandWrite ;WIEDERHOLUNG LDI r16, 0b01010101 rcall DataWrite LDI r16, 0b11000000 rcall CommandWrite LDI r16, 0b10101010 rcall DataWrite LDI r16, 0b11000000 rcall CommandWrite LDI r16, 0b01010101 rcall DataWrite LDI r16, 0b11000000 rcall CommandWrite LDI r16, 0b10101010 rcall DataWrite LDI r16, 0b11000000 rcall CommandWrite LDI r16, 0b01010101 rcall DataWrite LDI r16, 0b11000000 rcall CommandWrite LDI r16, 0b10101010 rcall DataWrite LDI r16, 0b11000000 rcall CommandWrite ;Wiederholung Ende LDI r16, 0b00000000 rcall DataWrite LDI r16, 0b00010000 rcall DataWrite LDI r16, 0b00100100 rcall CommandWrite LDI r16, 0b00110100 rcall DataWrite LDI r16, 0b11000000 rcall CommandWrite LDI r16, 0b00101111 rcall DataWrite LDI r16, 0b11000000 rcall CommandWrite LDI r16, 0b10011100 rcall CommandWrite ;Zweites Beispiel LDI r16, 0b10010000 rcall CommandWrite LDI r16, 0b00000000 rcall DataWrite LDI r16, 0b00001110 rcall DataWrite LDI r16, 0b01000010 rcall CommandWrite LDI r16, 0b00000000 rcall DataWrite LDI r16, 0b00001110 rcall DataWrite LDI r16, 0b00100100 rcall CommandWrite LDI r16, 0b00000000 rcall DataWrite LDI r16, 0b11000000 rcall CommandWrite LDI r16, 0b00001100 rcall DataWrite LDI r16, 0b11000000 rcall CommandWrite LDI r16, 0b10000100 rcall CommandWrite LDI r16, 0b10011000 rcall CommandWrite ende: rjmp ende DataWrite: out PortC,r16 sbi PortA, 2 rcall VerzKur cbi PortA, 2 rcall VerzKur sbi PortA, 2 rcall VerzKur ret CommandWrite: out PortC,r16 sbi PortA, 3 sbi PortA, 2 rcall VerzKur cbi PortA, 2 rcall VerzKur rcall VerzKur sbi PortA, 2 cbi PortA, 3 rcall VerzKur rcall VerzKur rcall VerzKur rcall VerzKur ret Verzoegerung: push r16 push r17 push r18 ldi r16,7 Schlr16: ldi r17,255 Schlr17: ldi r18,255 Schlr18: nop dec r18 BRNE Schlr18 dec r17 BRNE Schlr17 dec r16 BRNE Schlr16 pop r18 pop r17 pop r16 ret VerzKur: push r16 push r17 ldi r16,8 Schlkr16: ldi r17,255 Schlkr17: dec r17 BRNE Schlkr17 dec r16 BRNE Schlkr16 pop r17 pop r16 ret