Första pinnen på PORTB är kopplad till E, den andra till R/W
Kod: Markera allt
Busy bsf STATUS,5
movlw 80h
movwf TRISA
bcf STATUS,5 ;RA7 är nu input
movlw 03h
movwf PORTB
goto Wait
Wait btfsc PORTA,7
goto Wait
movlw 00h
movwf PORTB
bsf STATUS,5
movlw 00h
movwf TRISA
bcf STATUS,5 ;RA7=out
Return