.device Mega16 .Include "m16def.inc" .DEF Temp = R16 .DEF Data = R17 .Org 0x00 Init: LDI TEMP,0x04 OUT SPH,Temp LDI TEMP,0x5F ;Stackponiter gesetzt LDI temp,0xFF OUT DDRC,Temp LDI Temp,0xF0 ;DDRC setzten OUt DDRA,Temp Rcall Wait Rcall LCD_init ;Initalisiere LCD Display LCD_Init: LDI TEMP,0x30 OUT PORTC,TEMP SBI PORTA,7 Nop Nop Nop CBI PORTA,7 Rcall Wait LDI TEMP,0x30 OUT PORTC,TEMP SBI PORTA,7 Nop Nop Nop CBI PORTA,7 Rcall Wait LDI TEMP,0x30 OUT PORTC,TEMP SBI PORTA,7 Nop Nop Nop CBI PORTA,7 Rcall Wait LDI Data,0x30 Rcall Send LDI Data,0x38 Rcall Send LDI Data,0x0F Rcall Send LDI Data,0x01 Rcall Send LDI Data,0x06 Rcall Send LDI Data,0x01 Rcall Send LDI Data,'R' Rcall Send ;------------------------------------ LDI TEMP,0x30 OUT PORTC,TEMP SBI PORTA,4 Nop Nop Nop CBI PORTA,4 Rcall Wait LDI TEMP,0x30 OUT PORTC,TEMP SBI PORTA,4 Nop Nop Nop CBI PORTA,4 Rcall Wait LDI Data,0x30 Rcall Send2 LDI Data,0x38 Rcall Send2 LDI Data,0x0F Rcall Send2 LDI Data,0x01 Rcall Send2 LDI Data,0x06 Rcall Send2 LDI Data,0x01 Rcall Send2 LDI Data,'R' Rcall Send2 Loop: RJMP loop Send: Rcall Busy OUT PORTC,Data SBI PORTA,7 Nop nop nop CBI PORTA,7 Ret Send2: Rcall Busy OUT PORTC,Data SBI PORTA,4 Nop nop nop CBI PORTA,4 Ret Busy: SBI PORTA,6 nop nop IN TEMP,PINC SBRC TEMP,7 RJMP Busy CBI PORTA,6 nop nop RET Wait: LDI Temp,0x05 OUT TCCR0,temp IN TEMP,TIFR SBRS TEMP,0 RJMP Wait LDI TEMP,0x03 OUT TIFR,TEMP CLR TEMP OUT TCNT0,TEMP OUT TCCR0,TEMP Ret