Answered step by step
Verified Expert Solution
Question
1 Approved Answer
this is lcd code : LIST P = PIC 1 6 F 8 7 7 include P 1 6 f 8 7 7 . inc
this is lcd code : LIST PPICF
include Pfinc
CONFIG CPOFF & WDTOFF & BODENOFF & PWRTEOFF & HSOSC & WRTENABLEON & LVPOFF & DEBUGOFF & CPDOFF
; LCD
;
org x
reset goto start
org x
start bcf STATUS, RP
bcf STATUS, RP ;Bank
clrf PORTD
clrf PORTE
bsf STATUS, RP ;Bank
movlw x
movwf ADCON
clrf TRISE ;porte output
clrf TRISD ;portd output
bcf STATUS, RP ;Bank
call init
;
movlw xC ;PLACE for the data on the LCD
movwf x
call lcdc
call mdel
movlw xA ; CHAR the data
movwf x
call lcdd
call mdel
;
wait goto wait
;
;subroutine to initialize LCD
;
init movlw x
movwf x
call lcdc
call del
movlw x
movwf x
call lcdc
call del
movlw x
movwf x
call lcdc
call mdel
movlw x ; display clear
movwf x
call lcdc
call mdel
movlw x ; IDS increment,no shift ID S
movwf x
call lcdc
call mdel
movlw xc ; DCB set display no cursor, no blinking
movwf x
call lcdc
call mdel
movlw x ; dl bits interface,n lines,fx dots
movwf x
call lcdc
call mdel
return
;
;subroutine to write command to LCD
;
lcdc movlw x ; ERS
movwf PORTE
movf xw
movwf PORTD
movlw x ; ERS
movwf PORTE
call sdel
movlw x ; ERS
movwf PORTE
return
;
;subroutine to write data to LCD
;
lcdd movlw x ; E RS
movwf PORTE
movf xw
movwf PORTD
movlw x ; E rs
movwf PORTE
call sdel
movlw x ; E rs
movwf PORTE
return
;
del movlw xcd
movwf x
lulaa movlw x
movwf x
lulaa decfsz x
goto lulaa
decfsz x
goto lulaa
return
del movlw x
movwf x
lulaa decfsz x
goto lulaa
return
sdel movlw x ; movlw cycle
movwf x ; movwf cycle
lulaa movlw xfa
movwf x
lulaa decfsz x ; decfsz cycle
goto lulaa ; goto cycles
decfsz x
goto lulaa
return
mdel movlw xa
movwf x
lulaa movlw x
movwf x
lulaa movlw xfa
movwf x
lulaa decfsz x
goto lulaa
decfsz x
goto lulaa
decfsz x
goto lulaa
return
end
and this is keyboard codeLIST PPICF
include
CONFIG CPOFF & WDTOFF & BODENOFF & PWRTEOFF & HSOSC & WRTENABLEON & LVPOFF & DEBUGOFF & CPDOFF
org x
reset: goto start
org x
start: bcf STATUS,RP
bcf STATUS,RP ;Bank
clrf PORTD
bsf STATUS,RP ;Bank
bcf INTCON,GIE ;No interrupt
movlw xF
movwf TRISB
bcf OPTIONREG,x ;Enable PortB PullUp
clrf TRISD
bcf STATUS,RP ;Bank
;
main: call wkb
movwf PORTD
goto main
;
wkb: bcf PORTB,x ;scan Row
bsf PORTB,x
bsf PORTB,x
bsf PORTB,x
btfss PORTB,x
goto kb
btfss PORTB,x
goto kb
btfss PORTB,x
goto kb
btfss PORTB,x
goto kba
bsf PORTB,x
bcf PORTB,x ;scan Row
btfss PORTB,x
goto kb
btfss PORTB,x
goto kb
btfss PORTB,x
goto kb
btfss PORTB,x
goto kbb
bsf PORTB,x
bcf PORTB,x ;scan Row
btfss PORTB,x
goto kb
btfss PORTB,x
goto kb
btfss PORTB,x
goto kb
btfss PORTB,x
goto kbc
bsf PORTB,x
bcf PORTB,x ;scan Row
btfss PORTB,x
goto kbe
btfss PORTB,x
goto kb
btfss PORTB,x
goto kbf
btfss PORTB,x
goto kbd
goto wkb
kb: movlw x
goto disp
kb: movlw x
goto disp
kb: movlw x
goto disp
kb: movlw x
goto disp
kb: movlw x
goto disp
kb: movlw x
goto disp
kb: movlw x
goto disp
kb: movlw x
goto disp
kb: movlw x
goto disp
kb: movlw x
goto disp
kba: movlw xA
goto disp
kbb: movlw xB
goto disp
kbc: movlw xC
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started