Hello Fellows,
Hope everyone here is in great health.
I need your help fellows, I have been asked the following Question:
"Write a program that ANDs the input logic levels available at the pins RB0, RB1,
RB2,RB3, and outputs the result to pin RA0"
I have done the coding to it using MPLAB IDE:
. And after compiling the coding, I have added the .hex file created to the circuit I simulated, but the problem is that the logic is not workig, i.e. if I make inputs RB0 to RB3 ANDed value is zero, the LED connected to the RA0 output lights up.
I have attached the .hex file, .asm file.
As for the proteus ISIS .DSN file it is here:
**broken link removed**
I hope I could find anyones help.
Thanks a lot and looking forward for your help
TipTip
Hope everyone here is in great health.
I need your help fellows, I have been asked the following Question:
"Write a program that ANDs the input logic levels available at the pins RB0, RB1,
RB2,RB3, and outputs the result to pin RA0"
I have done the coding to it using MPLAB IDE:
Code:
processor 16f84A
include <p16f84A.inc>
__config _HS_OSC & _WDT_OFF & _PWRTE_ON
ORG H'00'
BSF STATUS,RP0
MOVLW H'0F'
MOVWF TRISB
MOVLW H'00'
MOVWF TRISA
BCF STATUS, RP0
DOAGAIN BTFSS PORTB,0
CALL OUTPUT0
BTFSS PORTB,1
CALL OUTPUT0
BTFSS PORTB,2
CALL OUTPUT0
BTFSS PORTB,3
CALL OUTPUT0
CALL OUTPUT1
GOTO DOAGAIN
OUTPUT0 MOVLW H'00'
MOVWF PORTA
RETURN
OUTPUT1 MOVLW H'01'
MOVWF PORTA
RETURN
end
. And after compiling the coding, I have added the .hex file created to the circuit I simulated, but the problem is that the logic is not workig, i.e. if I make inputs RB0 to RB3 ANDed value is zero, the LED connected to the RA0 output lights up.
I have attached the .hex file, .asm file.
As for the proteus ISIS .DSN file it is here:
**broken link removed**
I hope I could find anyones help.
Thanks a lot and looking forward for your help
TipTip