Question: write the code in assembly programming with PIC 1 6 F 8 7 7 microprocessor i work in MPLAB IDE v 8 . 9 2
write the code in assembly programming with PICF microprocessor
i work in MPLAB IDE v
i want to build "model" of a bit microprocessor which includes the following units:
ALU, IO LCD display, button matrix and memory
Operation description of the units: Data reception: the operands, bits and the operation CODE OP bits are obtained through a matrix of buttons in binaryOnly buttons and ABC can be used.
example :
C B A
The first number will be recorded in the address x the second in x and the type of operation in x
In case of entering an incorrect operation code, "ERROR" will be shown on the display
The received numbers should be displayed on the LCD in the top row
According to the CODE OP the ALU unit recognizes the operation and executes the command:
: AB the result in xvalue and sign
: AB multiplication the result in x
: AB just a whole part the result in x
: AB the result in x
: the number in B the result in x
: the number in A the result in x
The result of the operation must be displayed on the LCD in the second line. this is my 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
endand this is my keyboard code :LIST 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,xprovide me the full code! not a template
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
