Code:
.include"m644PAdef.inc"
;Ports als Ausgang konfigurieren
ldi R16, 0b11111111
out DDRC, R16
out DDRA, R16
out DDRB, R16
ldi R16, 0b00000000
out PORTC, R16
out PORTA, R16
out PORTB, R16
;Stack
ldi R16, LOW(RAMEND)
out SPL, R16
ldi R16, HIGH(RAMEND)
out SPH, R16
;Initialisierungszeit
rcall Warte_1s
ldi R16, 0b00110000
out PortC, R16
sbi PORTA, 7
rcall Warte_1s
cbi PORTA, 7
rcall Warte_1s
sbi PORTA, 7
rcall Warte_1s
cbi PORTA, 7
rcall Warte_1s
sbi PORTA, 7
rcall Warte_1s
cbi PORTA, 7
rcall Warte_1s
;Function Set
ldi R16, 0b00100100
out PORTC, R16
out PORTB, R16
sbi PORTA, 7
rcall Warte_1s
cbi PORTA, 7
rcall Warte_1s
;Display on/off Controll
ldi R16, 0b00001111
out PORTC, R16
out PORTB, R16
sbi PORTA, 7
rcall Warte_1s
cbi PORTA, 7
rcall Warte_1s
;Display clear
ldi R16, 0b00000001
out PORTC, R16
out PORTB, R16
sbi PORTA, 7
rcall Warte_1s
cbi PORTA, 7
rcall Warte_1s
;Entry Mode Set
ldi R16, 0b00000110
out PORTC, R16
out PORTB, R16
sbi PORTA, 7
rcall Warte_1s
cbi PORTA, 7
rcall Warte_1s
;Cursor Home
ldi R16, 0b00000010
out PORTC, R16
sbi PORTA, 7
rcall Warte_1s
cbi PORTA, 7
rcall Warte_1s
;Sende an LCD
rcall Warte_1s
ldi R16, 0b01010101
out PORTC, R16
out PORTB, R16
sbi PORTA, 5
sbi PORTA, 7
rcall Warte_1s
cbi PORTA, 7
cbi PORTA, 5
E:
rjmp E
Lesezeichen