fuer alle die wissen wollen wie es in Assembler aussieht... (allerdings
fuer ein samsung 8x24 display mit M50530 Controller im 4bit Mode)
lcd_wait_for_bf:
push temp3
push temp1
;zustand vom LCD_PORT sichern
in temp1, LCD_PORT
push temp1
;Datenbits auf Input
cbi LCD_DDR, LCD_D4
cbi LCD_DDR, LCD_D5
cbi LCD_DDR, LCD_D6
cbi LCD_DDR, LCD_D7
;Pullups aus. Mag das scheiss display nicht.
cbi LCD_PORT, LCD_D4
cbi LCD_PORT, LCD_D5
cbi LCD_PORT, LCD_D6
cbi LCD_PORT, LCD_D7
lcd_wait_for_bf_:
sbi LCD_PORT, LCD_RW
cbi LCD_PORT, LCD_IOC1
cbi LCD_PORT, LCD_IOC2
rcall lcd_enable ; get MSB
in temp3, LCD_PIN
rcall lcd_enable ; get LSB
sbrc temp3, LCD_D7
rjmp lcd_wait_for_bf_
;klare verhaeltnise wiederherstellen
cbi LCD_PORT, LCD_RW
cbi LCD_PORT, LCD_IOC1
cbi LCD_PORT, LCD_IOC2
sbi LCD_DDR, LCD_D4
sbi LCD_DDR, LCD_D5
sbi LCD_DDR, LCD_D6
sbi LCD_DDR, LCD_D7
;Zustand von LCD_PORT wiederherstellen aka alle bits wie vorher
setzen
pop temp1
out LCD_PORT, temp1
pop temp1
pop temp3
ret
cu Tarzanwiejane